MCPcopy Create free account
hub / github.com/aws/amazon-q-developer-cli / start_pkce_authorization

Function start_pkce_authorization

crates/chat-cli/src/auth/pkce.rs:65–74  ·  view source on GitHub ↗

Starts the PKCE authorization flow, using [`START_URL`] and [`OIDC_BUILDER_ID_REGION`] as the default issuer URL and region. Returns the [`PkceClient`] to use to finish the flow.

(
    start_url: Option<String>,
    region: Option<String>,
)

Source from the content-addressed store, hash-verified

63/// Starts the PKCE authorization flow, using [`START_URL`] and [`OIDC_BUILDER_ID_REGION`] as the
64/// default issuer URL and region. Returns the [`PkceClient`] to use to finish the flow.
65pub async fn start_pkce_authorization(
66 start_url: Option<String>,
67 region: Option<String>,
68) -> Result<(Client, PkceRegistration), AuthError> {
69 let issuer_url = start_url.as_deref().unwrap_or(START_URL);
70 let region = region.clone().map_or(OIDC_BUILDER_ID_REGION, Region::new);
71 let client = client(region.clone());
72 let registration = PkceRegistration::register(&client, region, issuer_url.to_string(), None).await?;
73 Ok((client, registration))
74}
75
76/// Represents a client used for registering with AWS IAM OIDC.
77#[async_trait::async_trait]

Callers 1

executeMethod · 0.85

Calls 3

to_stringMethod · 0.80
clientFunction · 0.70
cloneMethod · 0.45

Tested by

no test coverage detected