-
Notifications
You must be signed in to change notification settings - Fork 96
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
feat: enhanced delegation enforcement checks #761
Open
krpeacock
wants to merge
23
commits into
main
Choose a base branch
from
kyle/SDK-1193-delegation-enforcement
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 22 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
7a32461
feat: DelegationChain audits for delegation targets and maximum deleg…
krpeacock 96e90b9
changelog
krpeacock 298d373
wip
krpeacock ef6c173
continuing work on not repeating delegations
krpeacock 3a89fc0
checks to prevent repeated delegations to public keys
krpeacock 0cb0acb
Merge branch 'main' into kyle/SDK-1193-delegation-enforcement
krpeacock 78e6e56
chore: lock npm version for CI (#762)
krpeacock 139356c
feat: DelegationChain audits for delegation targets and maximum deleg…
krpeacock 4f87fe1
changelog
krpeacock 95588ea
wip
krpeacock c0dab1b
continuing work on not repeating delegations
krpeacock d6d5a3c
checks to prevent repeated delegations to public keys
krpeacock 26249e3
Merge branch 'kyle/SDK-1193-delegation-enforcement' of github.com:dfi…
krpeacock 8b80563
fixing test case
krpeacock 32aad22
fixing auth-client test around expired delegations
krpeacock 9e38f30
npm version pinning was accomplished in a separate PR
krpeacock ed64572
Update packages/identity/src/identity/delegation.ts
krpeacock 194007f
Update packages/identity/src/identity/delegation.ts
krpeacock b60c736
Update packages/identity/src/identity/delegation.ts
krpeacock f5a798e
Update packages/identity/src/identity/delegation.ts
krpeacock bab42fb
refactoring to use reduce function
krpeacock f5b1c97
upgrading node version to 16 as a baseline for CI
krpeacock ba9025d
pinning node 9 again
krpeacock 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 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 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 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 |
---|---|---|
|
@@ -19,7 +19,6 @@ jobs: | |
spec: | ||
- '0.16.1' | ||
node: | ||
- 14 | ||
- 16 | ||
|
||
steps: | ||
|
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
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
12 changes: 12 additions & 0 deletions
12
packages/identity/src/identity/__snapshots__/delegation.test.ts.snap
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Delegation can include multiple targets 1`] = ` | ||
Object { | ||
"expiration": "176bb3e7000", | ||
"pubkey": "010203", | ||
"targets": Array [ | ||
"00000000002000030101", | ||
"000000000020008E0101", | ||
], | ||
} | ||
`; |
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that
options.previous
is a DelegationChain, is it really necessary to check thatoptions.previous.delegations
has no repeated delegations?Asked another way, does
DelegationChain
have an invariant thatdelegations
has no repeated public keys?If so, it should be sufficient (and simpler) here to check that
to
is not found amongoptions.previous.delegations
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If TypeScript was the runtime language of the web, we could be confident that the other chain is a valid DelegationChain. However, if we want runtime validation, we have to do the checks ourself
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good thing MAXIMUM_DELEGATION_CHAIN_LENGTH is only 20. Pretty sure this is O(n^2) or possibly O(n^2 log n).