-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
biscuit v2 #19
Merged
Merged
biscuit v2 #19
Conversation
This file contains 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
divarvel
force-pushed
the
secret-project
branch
from
September 1, 2021 14:39
f9c5446
to
8e7c989
Compare
According to the biscuit v2 _feuille de route_, the datalog is now evaluated in a staged process: each block is ran in sequence, with its checks. This way, a new block cannot generate new facts that could interfere with previous blocks rules and checks. In effects, this makes `#authority` and `#ambient` flagging automatic, and generalized to every block, not just the authority.
divarvel
force-pushed
the
secret-project
branch
from
September 2, 2021 12:51
8e7c989
to
a21a344
Compare
divarvel
force-pushed
the
secret-project
branch
from
September 7, 2021 12:04
5b7dc59
to
594ff8a
Compare
`validateBiscuit` and friends don't care at all about the proof type since it has already been validated. `serializeBiscuit` and friends already know how to handle both open and sealed tokens, it was just a matter of automatically projecting Open and Sealed tokens to the main case, with a little typeclass. This allows to remove most of the `fromOpen` / `fromSealed` uses.
`Biscuit'` and `BiscuitProof` where not exposed and prevented external libs from exposing polymorphic helpers.
The three layers of type aliases were hard to follow and did a poor job of hiding the doubly-primed base types.
The benefits are two fold: - when multiple public keys are available (and chosen through `rootKeyId`), it allows keeping track of which one was used - the `check` type param in `Biscuit` is no longer a phantom type, and proper types are used, instead of promoted constructors. This removes the need for `DataKinds` and ticked types in user code.
This will allow lib users to query a verified biscuit to extract information Todo: add tests to make sure relevant facts are there
- improved wording - additional explanation paragraphs - fixed code examples - reordered exports
The haskell lib was not computing the signature the way the spec and the rust impl did.
this will pave the way for accepting different signature algorithms
The spec mandates url-compatible b64, hex was only there for internal debugging purposes
Revocation ids are block signatures, which are available in the outermost protobuf encoding. This allows to skip the whole parsing altogether for already revoked biscuits
divarvel
force-pushed
the
secret-project
branch
from
September 25, 2021 13:26
f8b7008
to
4f2efef
Compare
It can work on any biscuit, regardless of its proof type or verification status
There were already `fromSealed` and `toSealed` to generalize biscuits to `OpenOrSealed`. The new helpers do the opposite operation: from an `OpenOrSealed` biscuit, they try to specialize it to `Open` or `Sealed`.
The computation itself does not care about whether the biscuit was checked or not, but the exposed helpers are monomorphic, to avoid unknowingly consume an unchecked biscuit.
Namely: - `seal` - `sealUnchecked` - `addBlockUnchecked` This required removing the open import for the `Crypto` module
It used to take a backwards list (authority at the end) to make test code easier to implement. The test code `Token` (and friends) was moved to a test module, and `verifyBlocks` now has a more predictable behaviour.
This is more in line with the vocabulary around signature verification
divarvel
force-pushed
the
secret-project
branch
from
October 2, 2021 06:41
3ecf529
to
65fcd31
Compare
divarvel
force-pushed
the
secret-project
branch
from
October 6, 2021 20:30
6eb0c9c
to
9e965c3
Compare
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.
biscuit-auth/biscuit#72
ToDo