MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / bundle_from_response_sets_fields

Function bundle_from_response_sets_fields

crates/openshell-cli/src/oidc_auth.rs:520–533  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

518
519 #[test]
520 fn bundle_from_response_sets_fields() {
521 use oauth2::basic::BasicTokenResponse;
522
523 let token_response: BasicTokenResponse = serde_json::from_str(
524 r#"{"access_token":"test-access","token_type":"bearer","expires_in":300,"refresh_token":"test-refresh"}"#,
525 )
526 .unwrap();
527 let bundle = bundle_from_oauth2_response(&token_response, "https://issuer", "my-client");
528 assert_eq!(bundle.access_token, "test-access");
529 assert_eq!(bundle.refresh_token.as_deref(), Some("test-refresh"));
530 assert_eq!(bundle.issuer, "https://issuer");
531 assert_eq!(bundle.client_id, "my-client");
532 assert!(bundle.expires_at.is_some());
533 }
534}

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected