This repository was archived by the owner on Jun 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
feat: pubsub: add global signature policy #66
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
dcf0b90
feat: pubsub: add global signature policy
wemeetagain 3b96fa0
chore: fix linter errors
wemeetagain 81ec6bf
chore: address PR comments
wemeetagain 54cc1e1
chore: update pubsub readme
wemeetagain a5bf0f4
chore: update pubsub readme
wemeetagain ce5f79c
chore: add noSignMsgId
wemeetagain 6cb041d
chore: fix lint error
wemeetagain File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,46 @@ | ||
| 'use strict' | ||
|
|
||
| exports.codes = { | ||
| /** | ||
| * Signature policy is invalid | ||
| */ | ||
| ERR_INVALID_SIGNATURE_POLICY: 'ERR_INVALID_SIGNATURE_POLICY', | ||
| /** | ||
| * Signature policy is unhandled | ||
| */ | ||
| ERR_UNHANDLED_SIGNATURE_POLICY: 'ERR_UNHANDLED_SIGNATURE_POLICY', | ||
|
|
||
| // Strict signing codes | ||
|
|
||
| /** | ||
| * Message expected to have a `signature`, but doesn't | ||
| */ | ||
| ERR_MISSING_SIGNATURE: 'ERR_MISSING_SIGNATURE', | ||
| ERR_INVALID_SIGNATURE: 'ERR_INVALID_SIGNATURE' | ||
| /** | ||
| * Message expected to have a `seqno`, but doesn't | ||
| */ | ||
| ERR_MISSING_SEQNO: 'ERR_MISSING_SEQNO', | ||
| /** | ||
| * Message `signature` is invalid | ||
| */ | ||
| ERR_INVALID_SIGNATURE: 'ERR_INVALID_SIGNATURE', | ||
|
|
||
| // Strict no-signing codes | ||
|
|
||
| /** | ||
| * Message expected to not have a `from`, but does | ||
| */ | ||
| ERR_UNEXPECTED_FROM: 'ERR_UNEXPECTED_FROM', | ||
| /** | ||
| * Message expected to not have a `signature`, but does | ||
| */ | ||
| ERR_UNEXPECTED_SIGNATURE: 'ERR_UNEXPECTED_SIGNATURE', | ||
| /** | ||
| * Message expected to not have a `key`, but does | ||
| */ | ||
| ERR_UNEXPECTED_KEY: 'ERR_UNEXPECTED_KEY', | ||
| /** | ||
| * Message expected to not have a `seqno`, but does | ||
| */ | ||
| ERR_UNEXPECTED_SEQNO: 'ERR_UNEXPECTED_SEQNO' | ||
| } |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| 'use strict' | ||
|
|
||
| /** | ||
| * Enum for Signature Policy | ||
| * Details how message signatures are produced/consumed | ||
| */ | ||
| exports.SignaturePolicy = { | ||
| /** | ||
| * On the producing side: | ||
| * * Build messages with the signature, key (from may be enough for certain inlineable public key types), from and seqno fields. | ||
| * | ||
| * On the consuming side: | ||
| * * Enforce the fields to be present, reject otherwise. | ||
| * * Propagate only if the fields are valid and signature can be verified, reject otherwise. | ||
| */ | ||
| StrictSign: 'StrictSign', | ||
| /** | ||
| * On the producing side: | ||
| * * Build messages without the signature, key, from and seqno fields. | ||
| * * The corresponding protobuf key-value pairs are absent from the marshalled message, not just empty. | ||
| * | ||
| * On the consuming side: | ||
| * * Enforce the fields to be absent, reject otherwise. | ||
| * * Propagate only if the fields are absent, reject otherwise. | ||
| * * A message_id function will not be able to use the above fields, and should instead rely on the data field. A commonplace strategy is to calculate a hash. | ||
| */ | ||
| StrictNoSign: 'StrictNoSign' | ||
| } |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.