Skip to content

Commit c941fc0

Browse files
committed
improve doc
1 parent 53d4702 commit c941fc0

File tree

1 file changed

+28
-7
lines changed

1 file changed

+28
-7
lines changed

docs/rbac.md

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,28 +31,30 @@ and inject resources (projects) into query.
3131
- [x] add new tests specific to RBAC
3232
- [x] Add feature flag to [default_settings](https://github.com/uc-cdis/indexd/blob/8ff50b9c829920907181d5c186c907e06f5c4a5d/indexd/default_settings.py)
3333
- [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)
3535
- [ ] Add a corresponding feature flag to helm chart
3636

3737
---
38-
# reviewers guide
3938

40-
## Code Review
39+
## Implementation Overview
40+
4141
* Main changes were made to:
4242
* indexd/auth
4343
* indexd/index/drivers/alchemy.py
44-
* All of the changes above:
44+
45+
* All the changes above:
4546
* should be transparent to the user, and they should not notice any difference in behavior.
4647
* should be non-breaking, as it only changes the behavior when the `authz` parameter is empty.
4748
* 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+
4850
* "Breaking" Changes:
4951
* In order to enforce authorization, we need to ensure that all records have an `authz` field.
5052
* (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+
5154
* Misc:
5255
* Added stack traces to log for unhandled exceptions see changes to blueprint.py for various endpoints
53-
* Tests:
5456

55-
**Architecture Rationale for `tests/rbac`**
57+
## **Testing `tests/rbac`**
5658

5759
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:
5860

@@ -68,7 +70,26 @@ The `tests/rbac` suite is designed to validate RBAC-aware behavior in the indexd
6870
- **Mocked Authorization Backend:**
6971
Arborist responses are mocked to provide deterministic and isolated test scenarios, enabling reliable validation of access control logic without external dependencies.
7072

71-
- **Feature Flag Validation:**
73+
## **Configuration:**
7274
Tests verify both enabled and disabled states of the RBAC feature flag, confirming that the system defaults to legacy behavior unless explicitly configured otherwise.
7375

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+
7495
This approach ensures robust coverage of the new RBAC functionality while maintaining the integrity and reliability of the existing test suite.

0 commit comments

Comments
 (0)