Type fga errors properly#16736
Draft
leovalais wants to merge 8 commits into
Draft
Conversation
No code changes. Signed-off-by: Léo VALAIS <leovalais+git@proton.me>
No code changes. Signed-off-by: Léo VALAIS <leovalais+git@proton.me>
No code changes. Signed-off-by: Léo VALAIS <leovalais+git@proton.me>
It's an aggregation of shortcuts of protected operations from different resources. Prevents polluting v2.rs as the trait implementation inevitably grows. No code changes. Signed-off-by: Léo VALAIS <leovalais+git@proton.me>
Signed-off-by: Léo VALAIS <leovalais+git@proton.me>
Extracts all possible errors from OpenFGA's protobuf spec and compiles all that in an `fga::Error` type. Additional custom variants are included there as well (the former `ParsingError`). Fallback to reqwest Error should parsing fail. `TooManyTuples` error has been removed. If the slice length exceeds the configured limit, `crate::Error::Validation` will be returned. `InitializationError` has been left on purpose since multiple stores can share the same name and we only assume unicity on editoast's side. So no OpenFGA error will help us there and we need a custom error. Signed-off-by: Léo VALAIS <leovalais+git@proton.me>
Prepared writes and deletes were tested, but not the function taking a single slice as parameter. Signed-off-by: Léo VALAIS <leovalais+git@proton.me>
Signed-off-by: Léo VALAIS <leovalais+git@proton.me>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #14174
Tip
review each commit separately
Uses OpenFGA's protobuf specification to type error responses in detail. Most errors now live in
fga::client::Error, see commit description for more detail.Last commit will be squashed after review.
To merge after #16709
Important
Ready to review, only kept as a draft to avoid spamming since not mergeable atm.