Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanmorley committed May 9, 2024
1 parent d84f8ec commit 9edf71a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 18 deletions.
40 changes: 23 additions & 17 deletions oktaws/src/config/organization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,24 +428,30 @@ foo = "foo"
async fn init_without_obvious_default_role() {
let mut client = OktaClient::new();
client.expect_app_links().returning(|_| Ok(Vec::new()));

// With two (different) roles
client.expect_all_roles().returning(|_| Ok(vec![
SamlRole {
provider: "arn:aws:iam::123456789012:saml-provider/okta-idp"
.parse()
.unwrap(),
role: "arn:aws:iam::123456789012:role/mock-role".parse().unwrap(),
},
SamlRole {
provider: "arn:aws:iam::123456789012:saml-provider/okta-idp"
.parse()
.unwrap(),
role: "arn:aws:iam::123456789012:role/mock-role-2".parse().unwrap(),
}
]));

let config = Config::from_organization(&client, String::from("test_user")).await.unwrap();
client.expect_all_roles().returning(|_| {
Ok(vec![
SamlRole {
provider: "arn:aws:iam::123456789012:saml-provider/okta-idp"
.parse()
.unwrap(),
role: "arn:aws:iam::123456789012:role/mock-role".parse().unwrap(),
},
SamlRole {
provider: "arn:aws:iam::123456789012:saml-provider/okta-idp"
.parse()
.unwrap(),
role: "arn:aws:iam::123456789012:role/mock-role-2"
.parse()
.unwrap(),
},
])
});

let config = Config::from_organization(&client, String::from("test_user"))
.await
.unwrap();

assert_eq!(config.role, None);
}
Expand Down
5 changes: 4 additions & 1 deletion oktaws/src/okta/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,10 @@ impl Client {
"Credentials"
};

debug!("Attempting to login to {} with {login_type}", self.base_url());
debug!(
"Attempting to login to {} with {login_type}",
self.base_url()
);

self.post("api/v1/authn", req).await
}
Expand Down

0 comments on commit 9edf71a

Please sign in to comment.