-
Notifications
You must be signed in to change notification settings - Fork 3
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
Authorization core module #19
Conversation
Tiny DSL ParserImplementation for each conditional parsing is being done as a small state machine that iterates on a (conditional) expression, Caveat: To split many conditionals in individual ones I've chosen a pythonic approach to save time and sanity. |
Probably will rename again
As of now, all expected functionality have been implemented ✍️ These mechanics are exposed on Implementation have been done using TDD: Breaking problem in small pieces then assembling them up. However, it is far from ready to go as it's the first working draft. What's left to do then, you ask? Refactor on overall designNamely:
|
@andreyrcdias Since you're doing a study on refactor, your views on these tasks I mentioned above are welcome :-) |
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.
First of all, really incredible implementation, nice job.
Before given more thoughts on it, I will raise a red flag about this PR size and enforce that our current movement about more atomic tasks that reflect in atomic PRs should be applied to this project as well. Even that I didn't ended up having many considerations it was really hard to evaluate this because of the size together with the high complexity.
Now, about the implementation, I overall approve this. I'm just in doubt about the READ evaluation, about a operation of this kind never being set as unauthorized and just having its scope restricted, to clarify, the idea is that the READ operation should filter the return using the scope instead of returning a clear message that the operation is not allowed?
Hey @rafamelos, thank you lots for taking the time to review this. I apologise for making you go through my refactoring thinking. I believe things are a bit simpler right now.
Thanks you!
Definitely. Totally agree with you. I've had a hard time splitting this up because we would need a intermediate stage between main and feature branches. But I'm stopping now with these published interfaces and for further integration (w/ ORM, GraphQL and others), I'm doing other (smaller) PRs. You have my word haha.
The rationale behind READ is that if a user is authenticated, then it is semantically authorised to ask for READ operations on any resource. In this sense, the access control happens on limiting the scope, as you noted yourself. I've documented this on flow.check_permission(). -- A few notes for further reviews. Currently, the public API (and this whole PR) consists of two modules:
About the DSL, it's gonna be used for ORM serializaiton. So I'm leaving this for another PR to keep things consistent here. |
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.
Sorry for the delay to give my opinion here. Reiterating @rafamelos's words, a really good job 👏🏽.
I also found it a bit dense to understand, but I agree with this whole implementation. I left my simple contribution that has no impact on what was proposed.
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.
Any big changes to point out, nice improvement since last viewed. Just one point about our discussion in friday, is inline policies going to be included in this?
Thanks @rafamelos and @andreyrcdias 🙏 Making explicit some of implementation premises:
I've done and applied all suggested changes, thanks again guys. |
@rafamelos about your question, IMO this could be another PR so it's small and easily reviewable. I think you'd agree with me on this hahaha. |
This PR leads to the creation of four issues:
|
@@ -0,0 +1,200 @@ | |||
# test_authorization.py |
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.
👀
Contexts
The entire context about research, design decisions and everything are on #18.
Relevant implementation details and will be placed on code through mindful comments.
Checkers
Work is being split on these "greater" granularity:
core
moduleTDD is being applied to, within each of these tasks, find the thinnest and possible workable solution.