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

Function extract_roles_flat_path

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

Source from the content-addressed store, hash-verified

429
430 #[test]
431 fn extract_roles_flat_path() {
432 // Entra ID / Okta style: roles at top level
433 let json = serde_json::json!({
434 "sub": "user1",
435 "roles": ["OpenShell.Admin", "OpenShell.User"]
436 });
437 let mut claims: OidcClaims = serde_json::from_value(json).unwrap();
438 claims.extract_roles("roles");
439 assert_eq!(claims.roles, vec!["OpenShell.Admin", "OpenShell.User"]);
440 }
441
442 #[test]
443 fn extract_roles_groups_path() {

Callers

nothing calls this directly

Calls 1

extract_rolesMethod · 0.80

Tested by

no test coverage detected