fixes OpenAPI spec security definitions #121
Closed
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.
SpiceDB does not use
ApiKeyAuth
authentication, butBearer
authentication, wherethe type of bearer token is an API Key, as defined by the OpenAPI v3 spec.
However, the OpenAPI v2 Spec, which is the one supported by grpc-gateway,
does not support bearer authentication:
https://swagger.io/docs/specification/v2_0/authentication/authentication/
Still, the grpc-gateway maintainers indicated in
grpc-ecosystem/grpc-gateway#1089
that bearer is actually supported in grpc-gateway generator.
In authzed/authzed-go#255 a user reported
trying to generate Java client code out of the SpiceDB OpenAPI spec,
but had errors because the generated error did not properly provide
the preshared key with the expected
Authorization: Bearer <psk>
format.
I'm not 100% sure if this is a legit intermediate state
between v2 and v3 we can leverage, but the current generated
client code is clearly broken anyway.
See https://swagger.io/docs/specification/v3_0/authentication/api-keys/
See https://swagger.io/docs/specification/v3_0/authentication/bearer-authentication/
The generated Swagger Spec looks like this