-
Notifications
You must be signed in to change notification settings - Fork 182
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
Parse manifest #426
Merged
Merged
Parse manifest #426
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
chm-diederichs
force-pushed
the
parse-manifest
branch
from
August 29, 2023 12:42
be1cf1d
to
76a9e9e
Compare
chm-diederichs
force-pushed
the
parse-manifest
branch
from
September 6, 2023 10:22
187e4db
to
46bf985
Compare
mafintosh
reviewed
Sep 6, 2023
mafintosh
reviewed
Sep 6, 2023
index.js
Outdated
@@ -74,10 +75,11 @@ module.exports = class Hypercore extends EventEmitter { | |||
this.writable = false | |||
this.opened = false | |||
this.closed = false | |||
this.sign = null |
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.
dont think this is used
mafintosh
reviewed
Sep 6, 2023
index.js
Outdated
this.crypto = o.crypto | ||
this.id = o.id | ||
this.key = o.key | ||
this.core = o.core | ||
this.replicator = o.replicator | ||
this.encryption = o.encryption | ||
this.writable = !this._readonly && !!this.auth && !!this.auth.sign | ||
this.writable = !this._readonly || !!(this.keyPair && this.keyPair.secretKey) |
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.
should be &&
mafintosh
added a commit
that referenced
this pull request
Sep 6, 2023
* add auth section to upgrade * exchange auth definitions through a manifest * fix a ton of stuff * skip custom keypair tests for now * allow explicit compat mode * no need to special case keypair * actually fix preload test * make manifest explicit * also set compat mode when replicating manifest * very explicit manifest exchange * verifyBatch -> verifyBatchUpgraded * tweak namespacing and add explicit default ns * add preliminary functions for parsing manifest * typo on imports * add encodings and entropy/namespacing * add compat signer and more tests * lib/core uses manifest createAuth function * default to compat mode * make signers classes and update tests * correctly set compat on sessions/clones/upgrade * fix bad merge * need to specify compat for clone * replace auth with manifest * update clone and ensure that key is different * update tests to manifest api * load new auth if secret key is provided * remove custom auth test * support passing a sign function * remove auth tests * manifest renamed to multipleSigners * properly set compat and keyPair * pass batch to patched verify * port tests from hypercore-crypto-multisig * include file for multisig helpers * rename to verifiers and add explicit compat verifier * split out signing and verification * remove sign option and just pass keyPair or signature * only set keyPair after openCapabilities * clarify code around creating a manifest * conflict test now works * fix core copyFrom and core clone tests * fix clone and clone tests * standardise opts across append and truncate * tidy up * add multisig lib file * expose helper * fix batch flush api * fix noManifest logic * fix some typos/missing apis * set signature on tree only after verification * rename static helpers * rename defaultAuth to verifier * rename defaultAuth to verifier * remove static createVerifier method * review by @mafintosh * move manifestHash to lib/manifest --------- Co-authored-by: Mathias Buus <mathiasbuus@gmail.com>
mafintosh
added a commit
that referenced
this pull request
Sep 7, 2023
* Initial manifest support (#426) * add auth section to upgrade * exchange auth definitions through a manifest * fix a ton of stuff * skip custom keypair tests for now * allow explicit compat mode * no need to special case keypair * actually fix preload test * make manifest explicit * also set compat mode when replicating manifest * very explicit manifest exchange * verifyBatch -> verifyBatchUpgraded * tweak namespacing and add explicit default ns * add preliminary functions for parsing manifest * typo on imports * add encodings and entropy/namespacing * add compat signer and more tests * lib/core uses manifest createAuth function * default to compat mode * make signers classes and update tests * correctly set compat on sessions/clones/upgrade * fix bad merge * need to specify compat for clone * replace auth with manifest * update clone and ensure that key is different * update tests to manifest api * load new auth if secret key is provided * remove custom auth test * support passing a sign function * remove auth tests * manifest renamed to multipleSigners * properly set compat and keyPair * pass batch to patched verify * port tests from hypercore-crypto-multisig * include file for multisig helpers * rename to verifiers and add explicit compat verifier * split out signing and verification * remove sign option and just pass keyPair or signature * only set keyPair after openCapabilities * clarify code around creating a manifest * conflict test now works * fix core copyFrom and core clone tests * fix clone and clone tests * standardise opts across append and truncate * tidy up * add multisig lib file * expose helper * fix batch flush api * fix noManifest logic * fix some typos/missing apis * set signature on tree only after verification * rename static helpers * rename defaultAuth to verifier * rename defaultAuth to verifier * remove static createVerifier method * review by @mafintosh * move manifestHash to lib/manifest --------- Co-authored-by: Mathias Buus <mathiasbuus@gmail.com> * last part of the constructor should be openSession * simplify key handler * fix keypair handler * define writable condition in one place * fix typo in manifestHash * pass manifest directly to createVerifier * no need to dbl copy manifest now * tweak manifest construction * consistent errors * add manifest getter * tweak manifest checks on load * review by @chm-diederichs * set keypair in constructor if possible * simplify core append signature * tweak batch flush * simplify compat option * update batch test * move compat default to lib/core * move compat check to a single func * no manifesthash in caps --------- Co-authored-by: Christophe Diederichs <45171645+chm-diederichs@users.noreply.github.com> Co-authored-by: Christophe Diederichs <chm-diederichs@protonmail.com>
mafintosh
added a commit
that referenced
this pull request
Sep 7, 2023
* Initial manifest support (#426) * add auth section to upgrade * exchange auth definitions through a manifest * fix a ton of stuff * skip custom keypair tests for now * allow explicit compat mode * no need to special case keypair * actually fix preload test * make manifest explicit * also set compat mode when replicating manifest * very explicit manifest exchange * verifyBatch -> verifyBatchUpgraded * tweak namespacing and add explicit default ns * add preliminary functions for parsing manifest * typo on imports * add encodings and entropy/namespacing * add compat signer and more tests * lib/core uses manifest createAuth function * default to compat mode * make signers classes and update tests * correctly set compat on sessions/clones/upgrade * fix bad merge * need to specify compat for clone * replace auth with manifest * update clone and ensure that key is different * update tests to manifest api * load new auth if secret key is provided * remove custom auth test * support passing a sign function * remove auth tests * manifest renamed to multipleSigners * properly set compat and keyPair * pass batch to patched verify * port tests from hypercore-crypto-multisig * include file for multisig helpers * rename to verifiers and add explicit compat verifier * split out signing and verification * remove sign option and just pass keyPair or signature * only set keyPair after openCapabilities * clarify code around creating a manifest * conflict test now works * fix core copyFrom and core clone tests * fix clone and clone tests * standardise opts across append and truncate * tidy up * add multisig lib file * expose helper * fix batch flush api * fix noManifest logic * fix some typos/missing apis * set signature on tree only after verification * rename static helpers * rename defaultAuth to verifier * rename defaultAuth to verifier * remove static createVerifier method * review by @mafintosh * move manifestHash to lib/manifest --------- Co-authored-by: Mathias Buus <mathiasbuus@gmail.com> * last part of the constructor should be openSession * simplify key handler * fix keypair handler * define writable condition in one place * fix typo in manifestHash * pass manifest directly to createVerifier * no need to dbl copy manifest now * tweak manifest construction * consistent errors * add manifest getter * tweak manifest checks on load * review by @chm-diederichs * set keypair in constructor if possible * simplify core append signature * tweak batch flush * simplify compat option * update batch test * move compat default to lib/core * move compat check to a single func * no manifesthash in caps --------- Co-authored-by: Christophe Diederichs <45171645+chm-diederichs@users.noreply.github.com> Co-authored-by: Christophe Diederichs <chm-diederichs@protonmail.com> Manifest tweaks (#431) * more tests for now truncate/append options * move more manifest functinality into manifest.js * move isCompat to manifest and simplify clone options * enable all tests * pass batches to verifiers and move namespace support to batch * fix storage test
mafintosh
added a commit
that referenced
this pull request
Sep 7, 2023
* Initial manifest support (#426) * add auth section to upgrade * exchange auth definitions through a manifest * fix a ton of stuff * skip custom keypair tests for now * allow explicit compat mode * no need to special case keypair * actually fix preload test * make manifest explicit * also set compat mode when replicating manifest * very explicit manifest exchange * verifyBatch -> verifyBatchUpgraded * tweak namespacing and add explicit default ns * add preliminary functions for parsing manifest * typo on imports * add encodings and entropy/namespacing * add compat signer and more tests * lib/core uses manifest createAuth function * default to compat mode * make signers classes and update tests * correctly set compat on sessions/clones/upgrade * fix bad merge * need to specify compat for clone * replace auth with manifest * update clone and ensure that key is different * update tests to manifest api * load new auth if secret key is provided * remove custom auth test * support passing a sign function * remove auth tests * manifest renamed to multipleSigners * properly set compat and keyPair * pass batch to patched verify * port tests from hypercore-crypto-multisig * include file for multisig helpers * rename to verifiers and add explicit compat verifier * split out signing and verification * remove sign option and just pass keyPair or signature * only set keyPair after openCapabilities * clarify code around creating a manifest * conflict test now works * fix core copyFrom and core clone tests * fix clone and clone tests * standardise opts across append and truncate * tidy up * add multisig lib file * expose helper * fix batch flush api * fix noManifest logic * fix some typos/missing apis * set signature on tree only after verification * rename static helpers * rename defaultAuth to verifier * rename defaultAuth to verifier * remove static createVerifier method * review by @mafintosh * move manifestHash to lib/manifest --------- Co-authored-by: Mathias Buus <mathiasbuus@gmail.com> * last part of the constructor should be openSession * simplify key handler * fix keypair handler * define writable condition in one place * fix typo in manifestHash * pass manifest directly to createVerifier * no need to dbl copy manifest now * tweak manifest construction * consistent errors * add manifest getter * tweak manifest checks on load * review by @chm-diederichs * set keypair in constructor if possible * simplify core append signature * tweak batch flush * simplify compat option * update batch test * move compat default to lib/core * move compat check to a single func * no manifesthash in caps --------- Co-authored-by: Christophe Diederichs <45171645+chm-diederichs@users.noreply.github.com> Co-authored-by: Christophe Diederichs <chm-diederichs@protonmail.com> Manifest tweaks (#431) * more tests for now truncate/append options * move more manifest functinality into manifest.js * move isCompat to manifest and simplify clone options * enable all tests * pass batches to verifiers and move namespace support to batch * fix storage test
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.
No description provided.