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

Function test_pkce_flow_e2e

crates/chat-cli/src/auth/pkce.rs:511–528  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

509 #[ignore = "not in ci"]
510 #[tokio::test]
511 async fn test_pkce_flow_e2e() {
512 tracing_subscriber::fmt::init();
513
514 let start_url = "https://amzn.awsapps.com/start".to_string();
515 let region = Region::new("us-east-1");
516 let client = client(region.clone());
517 let registration = PkceRegistration::register(&client, region.clone(), start_url, None)
518 .await
519 .unwrap();
520 println!("{:?}", registration);
521 if crate::util::open::open_url_async(&registration.url).await.is_err() {
522 panic!("unable to open the URL");
523 }
524 println!("Waiting for authorization to complete...");
525
526 registration.finish(&client, None).await.unwrap();
527 println!("Authorization successful");
528 }
529
530 #[tokio::test]
531 async fn test_pkce_flow_completes_successfully() {

Callers

nothing calls this directly

Calls 5

open_url_asyncFunction · 0.85
to_stringMethod · 0.80
clientFunction · 0.70
cloneMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected