openfga / api

Protocol Buffers used by OpenFGA
Apache License 2.0
18 stars 10 forks source link

feat: initial OpenFGA `v2beta1` protobuf API development #127

Open jon-whit opened 9 months ago

jon-whit commented 9 months ago

Description

Start the development branch for the v2beta1 protobuf API definitions for OpenFGA. This is to get things started with that new API development effort as we go into the new year.

As we work through these changes in the scope of this PR, lets try to focus on a few guiding principles:

  1. Well typed and strongly typed protobuf API contract - prefer objects over string encoded entities where you can (e.g. Object instead of string object)

  2. Separation of input types vs output types and a clear definition of required vs non-required fields within them- this really helps other development in our tooling such as in the SDKs etc..

  3. Think about the gRPC experience, not just the HTTP mapping - the protobuf API is the definitive source of truth. The HTTP API is derived off of it. When in doubt, the protobuf API should take precedence.

  4. Give a shit about naming things - if you've had a beef with the API names, speak up and fight for the cause šŸ˜„

  5. Encourage strong alignment with buf lint lint style guidelines so that we have a standard - we shouldn't have to make exceptions regularly for our protobuf API linting behavior. Stick to the community standard of using buf lint and the default rules for it.

  6. Consider Google API Improvement Proposals (AIPs) as a good starting point for inspiration behind certain API changes and design - we don't have to copy Google API guidelines, but they've clearly given a lot of API experience some thought and since they are the primary driving force behind gRPC and RPC APIs in general, their guidelines are a good reference point for ideas of achieving certain design goals. In particular, consider the AIPs around standard methods.

A few notable changes to get started:

References

Review Checklist

jon-whit commented 9 months ago