You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/rbac.md
+28-7Lines changed: 28 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,28 +31,30 @@ and inject resources (projects) into query.
31
31
-[x] add new tests specific to RBAC
32
32
-[x] Add feature flag to [default_settings](https://github.com/uc-cdis/indexd/blob/8ff50b9c829920907181d5c186c907e06f5c4a5d/indexd/default_settings.py)
33
33
-[x] Remove extraneous logging and debugging code
34
-
-[] Ensure ARE_RECORDS_DISCOVERABLE, GLOBAL_DISCOVERY_AUTHZ See [discussion](https://github.com/uc-cdis/indexd/pull/400#discussion_r2243579240)
34
+
-[x] Ensure ARE_RECORDS_DISCOVERABLE, GLOBAL_DISCOVERY_AUTHZ See [discussion](https://github.com/uc-cdis/indexd/pull/400#discussion_r2243579240)
35
35
-[ ] Add a corresponding feature flag to helm chart
36
36
37
37
---
38
-
# reviewers guide
39
38
40
-
## Code Review
39
+
## Implementation Overview
40
+
41
41
* Main changes were made to:
42
42
* indexd/auth
43
43
* indexd/index/drivers/alchemy.py
44
-
* All of the changes above:
44
+
45
+
* All the changes above:
45
46
* should be transparent to the user, and they should not notice any difference in behavior.
46
47
* should be non-breaking, as it only changes the behavior when the `authz` parameter is empty.
47
48
* However, it will throw a 401/403 is the user does not have access to the requested resource,or does not have and Authorization header which is a change from the previous behavior where it would return all the records regardless of the user's access.
49
+
48
50
* "Breaking" Changes:
49
51
* In order to enforce authorization, we need to ensure that all records have an `authz` field.
50
52
* (This is not a change in behavior to OHSU/ACED/Calypr, but it is a change in behavior to the Indexd API in that effectively authz is mandatory on write)
53
+
51
54
* Misc:
52
55
* Added stack traces to log for unhandled exceptions see changes to blueprint.py for various endpoints
53
-
* Tests:
54
56
55
-
**Architecture Rationale for`tests/rbac`**
57
+
## **Testing `tests/rbac`**
56
58
57
59
The `tests/rbac` suite is designed to validate RBAC-aware behavior in the indexd service, while ensuring the stability and integrity of legacy functionality. The following principles guide its architecture:
58
60
@@ -68,7 +70,26 @@ The `tests/rbac` suite is designed to validate RBAC-aware behavior in the indexd
68
70
-**Mocked Authorization Backend:**
69
71
Arborist responses are mocked to provide deterministic and isolated test scenarios, enabling reliable validation of access control logic without external dependencies.
70
72
71
-
-**Feature Flag Validation:**
73
+
##**Configuration:**
72
74
Tests verify both enabled and disabled states of the RBAC feature flag, confirming that the system defaults to legacy behavior unless explicitly configured otherwise.
73
75
76
+
*`ARE_RECORDS_DISCOVERABLE`
77
+
78
+
-**Type:**`bool`
79
+
-**Default:**`True`
80
+
-**Description:**
81
+
Controls whether any records in IndexD are discoverable via search or listing endpoints.
82
+
If set to `False`, all records are hidden from discovery, regardless of their individual authorization settings.
83
+
Note: Role-Based Access Control (RBAC) is not enabled by default.
84
+
85
+
*`GLOBAL_DISCOVERY_AUTHZ`
86
+
87
+
-**Type:**`list` or `None`
88
+
-**Default:**`[]`
89
+
-**Description:**
90
+
Overrides per-record authorization for GET/read operations during record discovery.
91
+
If set to a list of authorization requirements, these are applied globally to all records for discovery purposes.
92
+
If set to `None`, the system uses each record's individual `authz` field for authorization checks.
93
+
This setting does not affect file access permissions, only record discovery.
94
+
74
95
This approach ensures robust coverage of the new RBAC functionality while maintaining the integrity and reliability of the existing test suite.
0 commit comments