docs: add ADR for authorization schema source tracking - #444
Conversation
Adds 0025 ADR describing how authorization schema definitions and their source are tracked. Part 1 of the schema loading pipeline stack.
|
Thanks for the pull request, @rodmgwgu! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
BryanttV
left a comment
There was a problem hiding this comment.
Thanks! I have a few questions.
| * a permission-category table (stable id and display fields); | ||
| * a permission-definition table (namespace and name forming the complete permission id, plus | ||
| display fields, category, and supported scopes); | ||
| * a role-definition table (stable role id, display fields, supported scopes, and the ``hidden`` | ||
| flag from `ADR 0023`_); and | ||
| * a role-permission table holding one row per ``(role, permission, scope)`` relationship. |
There was a problem hiding this comment.
Can we include how each of these tables will be used? I think the storage approach for both dynamic and static rules should be covered in a separate ADR. Also that ADR should also explain how these tables relate to ExtendedCasbinRule and its current fields. I think it'd be a good continuation of: #422 (store, however we want to call the lifecycle phase)
What do you think?
There was a problem hiding this comment.
Originally, I thought on using ExtendedCasbinRule for tracking this, however decided on not using it because it is more geared towards assignments (g rules), and is one-to-one related to the corresponding CasbinRule, while we could have more than one contributing source for a single role or permission.
Also to avoid confusions and keep concerns separated.
| Because attribution lives at the role-permission grain, a core grant and a module-added grant on | ||
| the same role remain individually attributed. For ``course_admin``: |
There was a problem hiding this comment.
nit: I think we should shared vocabulary for this. Maybe we can call the built-in roles built-in (come with deployment) and user-defined those added by extensions, or any other alternative
There was a problem hiding this comment.
agree, this is confusing, on other ADRs we were talking about static vs dynamic right? I think we can keep those, I'll update the text to reflect that.
There was a problem hiding this comment.
Mmm after reading it again, the actual distinction we want here is the "roles that come with Open edX" vs "roles added by another module or plugin", however, technically there shouldn't be any difference between roles that come with Open edX and the ones added by a module, as we will be using the same mechanism to register them anyways.
I'l revise this text to make this clearer.
mariajgrimaldi
left a comment
There was a problem hiding this comment.
This makes total sense to me! Excited to see what comes out of this :)
I think we could consider this ADR as done, if we need any changes then we can implement them retroactively. One note though, this ADR defines two things: storage of these definitions after compilation and the derivability of sources, not sure if it'd be better to split them. I'll let it up to you to decide!
Problem
The authorization schema loading pipeline needs a documented decision record explaining how schema definitions and their source are tracked before the implementation lands.
Approach
Adds ADR
0025-authorization-schema-source-tracking.rstdescribing the source-tracking design.AI Usage
Kiro was used to assist on research and write the ADR with human guidance and validation.
Stack (1/3) — split from a single combined commit for reviewability:
main)rod/authz-schema-files— authz schema YAML files (base: this branch)rod/authz-schema-loader— schema loading pipeline (base: PR 2)Merge checklist: