()
| 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() { |
nothing calls this directly
no test coverage detected