-
Notifications
You must be signed in to change notification settings - Fork 68
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
Feature/lit 2961 auth unification breaking remove existing authsigs #444
Feature/lit 2961 auth unification breaking remove existing authsigs #444
Conversation
…d due to storage provider not found
…to feature/lit-3017-auth-unification-migrate-actual-tests
…reation' into feature/lit-3017-auth-unification-migrate-actual-tests
…ode-fetch as dev dependency for now
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.
Left some comments. looking good :)
pkpPublicKey?: string; | ||
authSig?: AuthSig; | ||
siweMessage: string; | ||
curveType: 'BLS' | 'ECDSA'; |
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.
I thought we had a LIT_CURVE
introduced as a new enum could we it here?
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.
yea that's in the constants
package, it will unfortunately cause circular dependencies. I think constants
and types
should just merge, they are static values anyway and don't depend on any other packages, but they love each other and we keep separating them 💔
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.
this makes sense to me, Will make a task as a follow up.
1. Removed authSig and use sessionSigs 2. Moved all parsers/helpers to its own folder with unit tests 3. Updated `ExecuteJsProps` type to `JsonExecutionSdkParams` type and `JsonExecutionRequest` type to nodes 4.
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.
Starting to review from the commit: 35ede36. Lemme know if this needs to be reviewed before this commit
Full disclosure: I'm glossing over the helper files in the the lib/helpers
directory as I presume it's only a copy paste from the existing code?
The AuthSig removal happens only in packages/types/src/lib/interfaces.ts and replacing getSessionOrAuthSig
with getSessionSigByUrl
? Anything else?
packages/lit-node-client-nodejs/src/lib/lit-node-client-nodejs.ts
Outdated
Show resolved
Hide resolved
const bigR = typedItem.bigR ?? typedItem.bigr; | ||
|
||
typedItem.signatureShare = (typedItem.signatureShare ?? '').replaceAll( | ||
'"', | ||
'' | ||
); | ||
typedItem.bigR = (bigR ?? '').replaceAll('"', ''); | ||
typedItem.publicKey = (typedItem.publicKey ?? '').replaceAll('"', ''); | ||
typedItem.dataSigned = (typedItem.dataSigned ?? '').replaceAll('"', ''); |
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.
Do we do this in more than just here? thinking this might be better as a separate helper for sanitizing signatures.
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.
Yea, I think so. created a ticket for this https://linear.app/litprotocol/issue/LIT-3082/[js-sdk]-separate-flatten-shares-helper-function
packages/lit-node-client-nodejs/src/lib/helpers/normalize-array.ts
Outdated
Show resolved
Hide resolved
minNodeCount: number; | ||
signedData: any[]; | ||
requestId: string; | ||
}): T | { signature: SigResponse; sig: SigResponse } => { |
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.
I'm wondering if we could standardize on one of the two return values so we can remove T as it is a bit confusing the consumer of this method.
@Ansonhkg Still a bunch of unresolved comments. Can you please respond and resolve those, thanks |
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.
Approving the PRs though there are still some unresolved comments which aren't addressed. Please address those and resolve. Great job @Ansonhkg 🚀
…github.com/LIT-Protocol/js-sdk into feature/lit-2961-auth-unification-breaking-remove-existing-authsigs
8709d11
into
feature/lit-2958-auth-unification-ts-tests
Description
authSig
as an option to pass in to endpoint functions eg.pkpSign
executeJs
andsignSessionKey
pkpSign
andexecuteJs
to a dedicated helpers folder with isolated unit testsgetXXPromiseShares
methods in theLitNodeClient
& its interface, and replacing it with a genericgeneratePromise
instead. See lit-node-client-nodejs.tsNote
The commit history is a bit overlapping with other PRs because I need the tests and some other features, please review from the commit below onward (or I just open a new PR and cherry pick the commits if that's better, lmk.)
Type of change
How Has This Been Tested?
Checklist: