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

Function custom_role_names

crates/openshell-server/src/auth/authz.rs:247–264  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

245
246 #[test]
247 fn custom_role_names() {
248 let id = identity_with_roles(&["OpenShell.Admin", "OpenShell.User"]);
249 let policy = AuthzPolicy {
250 admin_role: "OpenShell.Admin".to_string(),
251 user_role: "OpenShell.User".to_string(),
252 scopes_enabled: false,
253 };
254 assert!(
255 policy
256 .check(&id, "/openshell.v1.OpenShell/CreateProvider")
257 .is_ok()
258 );
259 assert!(
260 policy
261 .check(&id, "/openshell.v1.OpenShell/ListSandboxes")
262 .is_ok()
263 );
264 }
265
266 #[test]
267 fn validate_accepts_both_roles_set() {

Callers

nothing calls this directly

Calls 1

identity_with_rolesFunction · 0.85

Tested by

no test coverage detected