Skip to content

Type fga errors properly#16736

Draft
leovalais wants to merge 8 commits into
devfrom
lva/type-openfga-errors
Draft

Type fga errors properly#16736
leovalais wants to merge 8 commits into
devfrom
lva/type-openfga-errors

Conversation

@leovalais
Copy link
Copy Markdown
Contributor

@leovalais leovalais commented May 13, 2026

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.

leovalais added 8 commits May 12, 2026 17:15
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>
@github-actions github-actions Bot added the area:editoast Work on Editoast Service label May 13, 2026
@leovalais leovalais self-assigned this May 13, 2026
@leovalais leovalais moved this to Awaiting merge in Board PI 20 May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:editoast Work on Editoast Service

Projects

Status: Awaiting merge

Development

Successfully merging this pull request may close these issues.

editoast: fga: parse and type OpenFGA errors

1 participant