-
Notifications
You must be signed in to change notification settings - Fork 53
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
feat: Add Access Control Policy #2338
feat: Add Access Control Policy #2338
Conversation
Context: #2337 (comment)
Sorry I should have been more specific, the functionality you are enquiring about is the
There shouldn't and will not be any blocking. In fact once bit set index checker is implemented it would improve even the current flow such that we would not have to make |
5537879
to
7830212
Compare
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.
Looks good so far. Added some minor change requeust and suggestions.
Note done with review yet though, half through
11202f4
to
8d0979e
Compare
Hey buddy @islamaliev thanks for the comments, I realized you commented before PR was ready for lower-level review. I think most of your suggestions are resolved in the latest push. The PR should now be ready to review if you want to take another look. I will mark the comments of yours as resolved that were done. |
8d0979e
to
db1be5b
Compare
@shahzadlone Can you please explain this? Particularly as to whether or not these allow bypassing of the permissions and access to otherwise restricted data. For example does P2P allow mutation of protected docs? Does including a doc in a join allow read access to unreadable data? If you include an aggregate in a query do you gain access to restricted docs in the rest of the query (example below):
|
The only bypassing that happens is when you disable acp (i.e. make acp module unavailable). Other than that none of these should let you bypass, unless anyone of these gets something funky and fetches documents in a raw custom manner from the store without the fetcher logic. I am just noting them as unsupported (even if they may or may not work) as there are no tests for them and I haven't confidently tested every edge case of theirs to mark them as "completed". Note: Moreover, all features should work as they did before (when used without the acp). LMK if that clarifies or you need any other clarification. |
question: In this PR identity is not verified? Actors are free to claim to be whoever they like and there are no checks as to whether they are that actor or not (e.g. password)? Meaning if person A knows person B's identity they can act as person B? |
question: In this PR is there a way to query as to who owns a document? |
Note: The simple identity tests aren't pushed yet, and the removal of the hard coded values will both be pushed end of day today or tomorrow.
|
db1be5b
to
ca197a4
Compare
Note: These tests are responsible for ensuring validation occurs properly when a schema is linked to a resource and policyID, ensure that we only accepting the schema if the policyID is linked to a valid DPI or atleast the resource that is linked is DPI compliant, otherwise the schema MUST be rejected.
(1) Update ACPModule Method and then, (2) Add AddPolicy Method on the Store Interface These are both important as we add both the CLI and HTTP clients in the next few commits. This commit is mostly a prep for adding the clients.
1f6a275
to
83a1ae4
Compare
It can seem as if the identity package is not doing much right now (and most of it can be achieved through `Option`), but my authentication identity implementation will very nicely build on top of this. I also prefer the `NoIdentity` variable as it quickly shows me all references where and empty identity is specified.
Implement ACP for getting document ids as well.
Only when the collection specified has a policy, or if the default selection of all collections is implied then if any collection has a policy we show a user friendly error.
83a1ae4
to
2a5e7f5
Compare
bug bash note: upon requesting documents with invalid identity assumes there is no identity: defradb client collection docIDs -i blah returns a list of public documents. |
bug bash result: |
Relevant issue(s)
Part of Epic #1738
Resolves #2019
Resolves #2020
Resolves #2228
Description
Demo
Features
Things That Are In Scope Of This PR:
Things That Are Out Of Scope Of This PR:
De-scope to after merge.
For Reviewers:
Recommendations:
Commit Priorities:
PR(-)
are unrelated/irrelevant to this PR, can be ignored.PR(ACP)
are most important to review as they are specific to ACP implementation.PR(IDENTITY)
are also important as they are specific to Indentity implementation.PR(*-TEST)
are test related commits that should be looked at.PR(ACP-*)
are assisting ACP commits (medium priority).PR(IDENTITY-*)
are assisting ACP commits (medium priority).PR(WIP)
Should not exist before merge (work in progress commits).PR(DROP)
Temporary commits that will be dropped before the merge.Tasks
How has this been tested?
Specify the platform(s) on which this was tested: