-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for issuing id_alias credentials (#2044)
* Add support for issuing id_alias credentials. * 🤖 cargo-fmt auto-update * Update candid interface. * 🤖 npm run generate auto-update * Address review comments. * +=clippy * Fix test success criteria. * Address review feedback --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
49f0d0b
commit a4d6399
Showing
15 changed files
with
1,314 additions
and
5 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
use candid::Principal; | ||
use ic_cdk::api::management_canister::main::CanisterId; | ||
use ic_test_state_machine_client::{call_candid_as, query_candid_as, CallError, StateMachine}; | ||
use internet_identity_interface::internet_identity::types::vc_mvp::{ | ||
GetIdAliasRequest, GetIdAliasResponse, PrepareIdAliasRequest, PrepareIdAliasResponse, | ||
}; | ||
|
||
pub fn prepare_id_alias( | ||
env: &StateMachine, | ||
canister_id: CanisterId, | ||
sender: Principal, | ||
prepare_id_alias_req: PrepareIdAliasRequest, | ||
) -> Result<Option<PrepareIdAliasResponse>, CallError> { | ||
call_candid_as( | ||
env, | ||
canister_id, | ||
sender, | ||
"prepare_id_alias", | ||
(prepare_id_alias_req,), | ||
) | ||
.map(|(x,)| x) | ||
} | ||
|
||
pub fn get_id_alias( | ||
env: &StateMachine, | ||
canister_id: CanisterId, | ||
sender: Principal, | ||
get_id_alias_req: GetIdAliasRequest, | ||
) -> Result<Option<GetIdAliasResponse>, CallError> { | ||
query_candid_as( | ||
env, | ||
canister_id, | ||
sender, | ||
"get_id_alias", | ||
(get_id_alias_req,), | ||
) | ||
.map(|(x,)| x) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.