[BREAKING] Separate biscuit-proto to own crate#331
Open
saoirse-a wants to merge 1 commit into
Open
Conversation
Instead of exposing the generated protobuf code in biscuit-auth, it now exists as its own crate in biscuit-proto. No types from biscuit-proto appear in the public API of biscuit-auth, so the generated code can evolve independently of biscuit-auth without breakage. Practically, this meant: 1. No longer public conversion methods between the biscuit-auth types and the proto types. 2. Consistently use the `Algorithm` type defined in biscuit-auth, instead of the proto generated one. 3. Add several additional `dump_*` methods to `Authorizer` to allow the test cases example dump the authorizer's content without converting it to a snapshot.
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.
Instead of exposing the generated protobuf code in biscuit-auth, this PR introduces a
biscuit-protocrate which exposes the protobuf types. No types from biscuit-proto appear in the public API of biscuit-auth, so the generated code can evolve independently of biscuit-auth without breakage. For example, if tonic changes its codegen or a change to the protobuf format would result in a breaking change to the Rust types, this doesn't require a breaking update to biscuit-auth.Practically, this means:
Algorithmtype defined in biscuit-auth, instead of the proto generated one; this is mostly a code clean up for some modules where both types were intermixed.dump_*methods toAuthorizerto allow the test cases example dump the authorizer's content without converting it to a snapshot.Future work
As a follow on change, I want to refactor the samples generation to separate testing and sample generation, with sample generation as a separate binary crate (not uploaded to crates.io). Then biscuit-auth's sample tests can consume the checked in samples in the same way as the other language libraries, instead of being the source of truth for the samples (which will instead be the new
biscuit-generate-samplescrate.)