-
Notifications
You must be signed in to change notification settings - Fork 44
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
add draft OpenFGA client #10504
base: lva/roles-openfga-edition
Are you sure you want to change the base?
add draft OpenFGA client #10504
Conversation
Signed-off-by: Leo Valais <[email protected]>
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 @@
## lva/roles-openfga-edition #10504 +/- ##
=============================================================
- Coverage 81.80% 81.41% -0.39%
=============================================================
Files 1073 1074 +1
Lines 106716 107105 +389
Branches 730 730
=============================================================
- Hits 87300 87201 -99
- Misses 19377 19865 +488
Partials 39 39
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Leo Valais <[email protected]>
Signed-off-by: Leo Valais <[email protected]>
Signed-off-by: Leo Valais <[email protected]>
Signed-off-by: Leo Valais <[email protected]>
Signed-off-by: Leo Valais <[email protected]>
Signed-off-by: Leo Valais <[email protected]>
Signed-off-by: Leo Valais <[email protected]>
Signed-off-by: Leo Valais <[email protected]>
0ad30c3
to
abec68a
Compare
Signed-off-by: Leo Valais <[email protected]>
Signed-off-by: Leo Valais <[email protected]>
Signed-off-by: Leo Valais <[email protected]>
Signed-off-by: Leo Valais <[email protected]>
Signed-off-by: Leo Valais <[email protected]>
Signed-off-by: Leo Valais <[email protected]>
86c5e06
to
863f612
Compare
Signed-off-by: Leo Valais <[email protected]>
863f612
to
cc19a88
Compare
Signed-off-by: Leo Valais <[email protected]>
Signed-off-by: Leo Valais <[email protected]>
Signed-off-by: Leo Valais <[email protected]>
Signed-off-by: Leo Valais <[email protected]>
e67eb9b
to
710c408
Compare
Signed-off-by: Leo Valais <[email protected]>
710c408
to
3c0cb22
Compare
Signed-off-by: Leo Valais <[email protected]>
131388a
to
ac0adfd
Compare
Important
Not to be merged into dev directly
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.
Draft OpenFGA client.
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 OpenFGAmod client
mod model
docker compose
About macros
Important
Expecting feedback on this point
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.