diff options
| author | mo khan <mo@mokhan.ca> | 2025-07-09 15:30:28 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-07-09 15:30:28 -0600 |
| commit | e6a1c6661f3e900d47395695ccb8d8c9942be68f (patch) | |
| tree | 08c50569f6836df1a951e0c70c6839ab07e7f68a /tests/authorization | |
| parent | 89499df2932ce2a62ed8606d4ef967175914f204 (diff) | |
test: update test to focus on :read, Sparkle
Diffstat (limited to 'tests/authorization')
| -rw-r--r-- | tests/authorization/cedar_authorizer_test.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/authorization/cedar_authorizer_test.rs b/tests/authorization/cedar_authorizer_test.rs index 0090f1a5..27801bb1 100644 --- a/tests/authorization/cedar_authorizer_test.rs +++ b/tests/authorization/cedar_authorizer_test.rs @@ -127,11 +127,19 @@ mod tests { } } + // TODO:: Add entities to represent access to: + // * list of sparkles: `:read, gid://sparkle/Sparkle/*` + // * single sparkle: `:read, gid://sparkle/Sparkle/:id` + // * create sparkle: `:create, gid://sparkle/Sparkle/*` + // * update sparkles: `:update, gid://sparkle/Sparkle/*` + // * update single sparkle: `:update, gid://sparkle/Sparkle/:id` + // * delete sparkles: `:delete, gid://sparkle/Sparkle/*` + // * delete single sparkle: `:delete, gid://sparkle/Sparkle/:id` #[test] - fn test_allow_access_to_developer_in_sparkle_project() { + fn test_allow_read_sparkles() { let request = build_request(|item: &mut HttpRequest| { item.method = "GET".to_string(); - item.path = "/dashboard".to_string(); + item.path = "/sparkles".to_string(); item.host = "sparkle.staging.runway.gitlab.net".to_string(); item.headers = build_headers(vec![ (String::from(":path"), item.path.to_string()), @@ -144,14 +152,6 @@ mod tests { ]); }); let entities = cedar_policy::Entities::empty(); - // TODO:: Add entities to represent access to: - // * list of sparkles: `:read, gid://sparkle/Sparkle/*` - // * single sparkle: `:read, gid://sparkle/Sparkle/:id` - // * create sparkle: `:create, gid://sparkle/Sparkle/*` - // * update sparkles: `:update, gid://sparkle/Sparkle/*` - // * update single sparkle: `:update, gid://sparkle/Sparkle/:id` - // * delete sparkles: `:delete, gid://sparkle/Sparkle/*` - // * delete single sparkle: `:delete, gid://sparkle/Sparkle/:id` let authorizer = subject_with(entities); assert!(authorizer.authorize(request)); } |
