Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
joyqvq committed May 15, 2024
1 parent 682998d commit 21ace79
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
2 changes: 0 additions & 2 deletions fastcrypto-zkp/src/bn254/unit_tests/zk_login_e2e_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,6 @@ struct TestData {
#[tokio::test]
async fn test_end_to_end_all_providers() {
// All JWT generated against nonce hTPpgF7XAKbW37rEUS6pEVZqmoI. This is derived based on max_epoch = 10, kp generated from seed = [0; 32], and jwt_randomness 100681567828351849884072155819400689117.

println!("{:?}", std::env::current_dir());
let file =
std::fs::File::open("src/bn254/zklogin_test_vectors.json").expect("Unable to open file");
let test_datum: Vec<TestData> = serde_json::from_reader(file).unwrap();
Expand Down
2 changes: 2 additions & 0 deletions fastcrypto-zkp/src/bn254/unit_tests/zk_login_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,8 @@ async fn test_get_jwks() {
OIDCProvider::Apple,
OIDCProvider::Microsoft,
OIDCProvider::AwsTenant(("us-east-1".to_string(), "us-east-1_LPSLCkC3A".to_string())),
OIDCProvider::KarrierOne,
OIDCProvider::Credenza3,
] {
let res = fetch_jwks(&p, &client).await;
assert!(res.is_ok());
Expand Down
2 changes: 1 addition & 1 deletion fastcrypto-zkp/src/bn254/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ pub fn get_oidc_url(
OIDCProvider::Slack => format!("https://slack.com/openid/connect/authorize?response_type=code&client_id={}&redirect_uri={}&nonce={}&scope=openid", client_id, redirect_url, nonce),
OIDCProvider::Microsoft => format!("https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id={}&scope=openid&response_type=id_token&redirect_uri={}&nonce={}", client_id, redirect_url, nonce),
OIDCProvider::KarrierOne => format!("https://openid.karrier.one/Account/PhoneLogin?ReturnUrl=/connect/authorize?nonce={}&redirect_uri={}&response_type=id_token&scope=openid&client_id={}", nonce, redirect_url, client_id),
OIDCProvider::Credenza3 => format!("https://accounts.credenza3.com/oauth2/authorize?client_id={}&response_type=token&scope=openid+profile+email+phone&redirect_uri={}&nonce={}", client_id, redirect_url, nonce),
OIDCProvider::Credenza3 => format!("https://accounts.credenza3.com/oauth2/authorize?client_id={}&response_type=token&scope=openid+profile+email+phone&redirect_uri={}&nonce={}&state=state", client_id, redirect_url, nonce),
OIDCProvider::AwsTenant((region, tenant_id)) => format!("https://{}.auth.{}.amazoncognito.com/login?response_type=token&client_id={}&redirect_uri={}&nonce={}", tenant_id, region, client_id, redirect_url, nonce),
OIDCProvider::TestIssuer => return Err(FastCryptoError::InvalidInput), // Test issuer does not issue JWTs interactively, this is not valid to call.
})
Expand Down
1 change: 0 additions & 1 deletion fastcrypto-zkp/src/bn254/zk_login.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ impl FromStr for OIDCProvider {
if let Some(captures) = re.captures(s) {
let region = captures.name("region").unwrap().as_str();
let tenant_id = captures.name("tenant_id").unwrap().as_str();
println!("region: {}, tenant_id: {}", region, tenant_id);
Ok(Self::AwsTenant((region.to_owned(), tenant_id.to_owned())))
} else {
Err(FastCryptoError::InvalidInput)
Expand Down

0 comments on commit 21ace79

Please sign in to comment.