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

Function extract_roles_keycloak_path

crates/openshell-server/src/auth/oidc.rs:420–428  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

418
419 #[test]
420 fn extract_roles_keycloak_path() {
421 let json = serde_json::json!({
422 "sub": "user1",
423 "realm_access": { "roles": ["openshell-user", "openshell-admin"] }
424 });
425 let mut claims: OidcClaims = serde_json::from_value(json).unwrap();
426 claims.extract_roles("realm_access.roles");
427 assert_eq!(claims.roles, vec!["openshell-user", "openshell-admin"]);
428 }
429
430 #[test]
431 fn extract_roles_flat_path() {

Callers

nothing calls this directly

Calls 1

extract_rolesMethod · 0.80

Tested by

no test coverage detected