-
Notifications
You must be signed in to change notification settings - Fork 46
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
OpenFGA client crate #10504
OpenFGA client crate #10504
Conversation
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## dev #10504 +/- ##
==========================================
- Coverage 82.55% 81.68% -0.88%
==========================================
Files 1087 1095 +8
Lines 108101 110260 +2159
Branches 742 742
==========================================
+ Hits 89248 90071 +823
- Misses 18811 20147 +1336
Partials 42 42
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
131388a
to
ac0adfd
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.
Only a first pass on src/client.rs
. I'll take a look at the rest later.
a767ba2
to
4ee9be3
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.
Small review of the docker-compose
d95db11
to
9da4085
Compare
6ea7ac1
to
73606ae
Compare
I tested the docker integration, and so far it's good (in As discussed with @flomonster , if you already have a database with some data and you start the stack, you will have some SQL errors from the container
On a fresh install of this stack (I tested it), the issue is not present: those commands are directly executed by the script |
2484f16
to
749e0b6
Compare
3348b28
to
3b89317
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.
Thanks for all the work on this PR. There are a bunch of unchecked items in the description, do we need to put them in an issue?
fad9eb6
to
c8c61f0
Compare
c8c61f0
to
a3d3056
Compare
Probably better, but we'll need those to be done eventually to have the full permission system we envision to work. |
a3d3056
to
4d4ea1e
Compare
Signed-off-by: Leo Valais <[email protected]>
Signed-off-by: Leo Valais <[email protected]> Co-authored-by: Florian Amsallem <[email protected]>
Now openfga uses port 8091. Signed-off-by: Florian Amsallem <[email protected]>
4d4ea1e
to
56946bd
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.
LGTM
Note
This is a lengthy PR which also requires some amount of OpenFGA knowledge to be understood. It's probably better to peer review it.
editoast_authz
(in which we'll map the authorization model, define our objects, their conversion, relations, etc.)fga
binary is necessary to run unit tests for now: https://github.com/openfga/cliTODO:
POST /stores/{}/list-users
POST /stores/{}/stream-list-objects
POST /stores/{}/expand
POST /stores/{}/read
POST /stores/{}/batch-check
authorization_model_id
in the client to forward it to requests—as advised by OpenFGAcheck
assertions (make them public + async variant?)compile_model
?mod client
mod model
crate
(ongoing)docker compose
User.id ≠ '*'
User.id
andObject.id
? Not really required for us.list-users
as this will change thetrait User
APIfga!
relations!
derive(User)
derive(Object)
About macros
This crates introduces a few macro_rules, which are only used for tests currently.
relations!
allows defining typed relations concisely to allow quick comparisons with the OpenFGA schema. I think we should keep this one, that'll help the review process and reduce straightforward boilerplate.fga_type!
declares the newtype structs representing thetypes
of OpenFGA and generates a few implementations. I think this one should remain a#[cfg(test)]
definition. However I think derive macrosderive(fga::User, fga::Object)
would help us and cost nothing as they are trivial to implement.fga!
allows manipulating and instantiating types and relations with the same syntax as OpenFGA, but in a type-safe way. This is particularly useful for the conciseness of unit tests. I think it should be exported.