Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/sea-snake/verify-google-jwt' int…
Browse files Browse the repository at this point in the history
…o sea-snake/verify-google-jwt
  • Loading branch information
sea-snake committed Jan 15, 2025
2 parents 8b29f4f + 75f87ad commit 299205a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
2 changes: 2 additions & 0 deletions src/frontend/generated/internet_identity_idl.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const idlFactory = ({ IDL }) => {
'canister_creation_cycles_cost' : IDL.Opt(IDL.Nat64),
'related_origins' : IDL.Opt(IDL.Vec(IDL.Text)),
'captcha_config' : IDL.Opt(CaptchaConfig),
'openid_google_client_id' : IDL.Opt(IDL.Text),
'register_rate_limit' : IDL.Opt(RateLimitConfig),
});
const UserNumber = IDL.Nat64;
Expand Down Expand Up @@ -561,6 +562,7 @@ export const init = ({ IDL }) => {
'canister_creation_cycles_cost' : IDL.Opt(IDL.Nat64),
'related_origins' : IDL.Opt(IDL.Vec(IDL.Text)),
'captcha_config' : IDL.Opt(CaptchaConfig),
'openid_google_client_id' : IDL.Opt(IDL.Text),
'register_rate_limit' : IDL.Opt(RateLimitConfig),
});
return [IDL.Opt(InternetIdentityInit)];
Expand Down
1 change: 1 addition & 0 deletions src/frontend/generated/internet_identity_types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ export interface InternetIdentityInit {
'canister_creation_cycles_cost' : [] | [bigint],
'related_origins' : [] | [Array<string>],
'captcha_config' : [] | [CaptchaConfig],
'openid_google_client_id' : [] | [string],
'register_rate_limit' : [] | [RateLimitConfig],
}
export interface InternetIdentityStats {
Expand Down
32 changes: 16 additions & 16 deletions src/internet_identity/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ async fn add_tentative_device(
tentative_device_registration::add_tentative_device(anchor_number, device_data).await;
match result {
Ok(TentativeRegistrationInfo {
verification_code,
device_registration_timeout,
}) => AddTentativeDeviceResponse::AddedTentatively {
verification_code,
device_registration_timeout,
}) => AddTentativeDeviceResponse::AddedTentatively {
verification_code,
device_registration_timeout,
},
Expand Down Expand Up @@ -154,7 +154,7 @@ fn add(anchor_number: AnchorNumber, device_data: DeviceData) {
anchor_operation_with_authz_check(anchor_number, |anchor| {
Ok::<_, String>(((), anchor_management::add(anchor, device_data)))
})
.unwrap_or_else(|err| trap(err.as_str()))
.unwrap_or_else(|err| trap(err.as_str()))
}

#[update]
Expand All @@ -165,7 +165,7 @@ fn update(anchor_number: AnchorNumber, device_key: DeviceKey, device_data: Devic
anchor_management::update(anchor, device_key, device_data),
))
})
.unwrap_or_else(|err| trap(err.as_str()))
.unwrap_or_else(|err| trap(err.as_str()))
}

#[update]
Expand All @@ -176,7 +176,7 @@ fn replace(anchor_number: AnchorNumber, device_key: DeviceKey, device_data: Devi
anchor_management::replace(anchor_number, anchor, device_key, device_data),
))
})
.unwrap_or_else(|err| trap(err.as_str()))
.unwrap_or_else(|err| trap(err.as_str()))
}

#[update]
Expand All @@ -187,7 +187,7 @@ fn remove(anchor_number: AnchorNumber, device_key: DeviceKey) {
anchor_management::remove(anchor_number, anchor, device_key),
))
})
.unwrap_or_else(|err| trap(err.as_str()))
.unwrap_or_else(|err| trap(err.as_str()))
}

/// Returns all devices of the anchor (authentication and recovery) but no information about device registrations.
Expand Down Expand Up @@ -271,7 +271,7 @@ async fn prepare_delegation(
max_time_to_live,
&ii_domain,
)
.await
.await
}

#[query]
Expand Down Expand Up @@ -470,7 +470,7 @@ fn update_root_hash() {
/// Calls raw rand to retrieve a random salt (32 bytes).
async fn random_salt() -> Salt {
let res: Vec<u8> = match call(Principal::management_canister(), "raw_rand", ()).await {
Ok((res, )) => res,
Ok((res,)) => res,
Err((_, err)) => trap(&format!("failed to get salt: {err}")),
};
let salt: Salt = res[..].try_into().unwrap_or_else(|_| {
Expand Down Expand Up @@ -752,7 +752,7 @@ mod attribute_sharing_mvp {
issuer: req.issuer.clone(),
},
)
.await;
.await;
Ok(prepared_id_alias)
}

Expand Down Expand Up @@ -791,11 +791,11 @@ mod test {
CandidSource::Text(&canister_interface),
CandidSource::File(Path::new("internet_identity.did")),
)
.unwrap_or_else(|e| {
panic!(
"the canister code interface is not equal to the did file: {:?}",
e
)
});
.unwrap_or_else(|e| {
panic!(
"the canister code interface is not equal to the did file: {:?}",
e
)
});
}
}

0 comments on commit 299205a

Please sign in to comment.