-
Notifications
You must be signed in to change notification settings - Fork 11
[DMS-845] Auth redesign #774
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces a comprehensive authorization redesign document that replaces the current JSONB/trigger-driven authorization model with a relational, strategy-friendly design. The redesign aims to improve performance and maintainability while preserving existing ODS authorization semantics.
Key Changes:
- Introduces a new relational data model with
DocumentSubjectandSubjectEdOrgtables to replace JSONB authorization arrays and pathway-specific tables - Redesigns the EducationOrganization hierarchy using a clean adjacency model with recursive functions
- Integrates authorization filtering with the
DocumentIndexquery/indexing design for efficient authorized data access
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| used in the write pipeline over `EdfiDoc` and the resource schema. | ||
| 3. Invoke `ResourceAuthorizationHandler` for the `ExistingData` phase with the | ||
| appropriate strategies and the in‑memory `DocumentSecurityElements`. | ||
| 3. Validators use `IAuthorizationRepository` (which now reads `SubjectEdOrg`) |
Copilot
AI
Dec 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate step numbering: Steps 2 and 3 both use "3." This should be corrected so that step 2 is followed by step 3, and then step 4.
| 3. Validators use `IAuthorizationRepository` (which now reads `SubjectEdOrg`) | |
| 4. Validators use `IAuthorizationRepository` (which now reads `SubjectEdOrg`) |
| - Future pathways (e.g., ProgramParticipation) can be added by introducing new | ||
| enum values. | ||
| - The combination `(SubjectType, SubjectIdentifier, Pathway)` can always be recomputed | ||
| from the corresponding relationship documents, see synchronization design is section 6. |
Copilot
AI
Dec 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The phrase "synchronization design is section 6" should be "synchronization design in section 6" (missing the word "in").
| from the corresponding relationship documents, see synchronization design is section 6. | |
| from the corresponding relationship documents, see synchronization design in section 6. |
| ### 4.3 Locking Down `SubjectType` and `Pathway` Identifiers | ||
|
|
||
| This design stores `SubjectType` and `Pathway` as `smallint` for compact keys | ||
| and fast joins. However, using ad-hoc numeric enums is fragile: if the numeric |
Copilot
AI
Dec 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The phrase "ad-hoc" should use a space instead of a hyphen: "ad hoc" (this is the standard spelling for this Latin phrase when used as an adjective).
| and fast joins. However, using ad-hoc numeric enums is fragile: if the numeric | |
| and fast joins. However, using ad hoc numeric enums is fragile: if the numeric |
|
|
||
| --- | ||
|
|
||
| ## 12. Open Questions and Future Enhancements |
Copilot
AI
Dec 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Section numbering jumps from "9. SecurityElements and QueryFields" directly to "12. Open Questions and Future Enhancements", skipping sections 10 and 11. This should be corrected to either section 10 or the missing sections should be added.
| ## 12. Open Questions and Future Enhancements | |
| ## 10. Open Questions and Future Enhancements |
| - GIN on `QueryFields` filters by query parameters before paging. | ||
| - `DocumentSubject` + `SubjectEdOrg` joins are backed by narrow B‑tree indexes, | ||
| enabling fast existence checks. | ||
| - `totalCount` requests uses the same `WHERE` (including the `EXISTS`) |
Copilot
AI
Dec 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Subject-verb agreement error: "totalCount requests uses" should be "totalCount requests use" (plural subject requires plural verb form).
| - `totalCount` requests uses the same `WHERE` (including the `EXISTS`) | |
| - `totalCount` requests use the same `WHERE` (including the `EXISTS`) |
No description provided.