Skip to content
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 3017 auth unification migrate actual tests #440

Merged
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
9c4077b
fix: https://github.com/LIT-Protocol/js-sdk/pull/440#discussion_r1583…
Ansonhkg Apr 30, 2024
e01e076
fix: only BLS https://github.com/LIT-Protocol/js-sdk/pull/440#discuss…
Ansonhkg Apr 30, 2024
bcad173
fix: https://github.com/LIT-Protocol/js-sdk/pull/440#discussion_r1583…
Ansonhkg Apr 30, 2024
451e0e7
fix: https://github.com/LIT-Protocol/js-sdk/pull/440#discussion_r1583…
Ansonhkg Apr 30, 2024
d428bad
chore: added note https://github.com/LIT-Protocol/js-sdk/pull/440#dis…
Ansonhkg Apr 30, 2024
eaf014b
fix: improve readability
Ansonhkg Apr 29, 2024
660759f
fix: pass-in session key in base provider
Ansonhkg Apr 29, 2024
f30a10a
feat: cherry-pick ee7011a
Ansonhkg Apr 29, 2024
8b92666
fix: pass-in session key in base provider
Ansonhkg Apr 29, 2024
b4a53db
fix: https://github.com/LIT-Protocol/js-sdk/pull/446#discussion_r1583…
Ansonhkg Apr 29, 2024
1c17275
feat: merge https://github.com/LIT-Protocol/js-sdk/pull/446
Ansonhkg Apr 29, 2024
8a8694a
fix: remove TEMP_CACHE
Ansonhkg Apr 30, 2024
3b7de45
fix: https://github.com/LIT-Protocol/js-sdk/pull/440#discussion_r1583…
Ansonhkg Apr 30, 2024
e424daf
fix: https://github.com/LIT-Protocol/js-sdk/pull/440#discussion_r1583…
Ansonhkg Apr 30, 2024
6e0e4ef
fix: https://github.com/LIT-Protocol/js-sdk/pull/440#discussion_r1583…
Ansonhkg Apr 30, 2024
2695204
Merge branch 'feature/lit-2958-auth-unification-ts-tests' of https://…
Ansonhkg May 1, 2024
7bc363d
fix: remove authSig (need to fix `decryptToString` and `decryptToFile…
Ansonhkg May 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions packages/types/src/lib/interfaces.ts
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ansonhkg Can you please double check all you interfaces against the node counter parts eg: https://github.com/LIT-Protocol/lit-assets/blob/aff82c4381139476aeaa6faa814069b184d38d39/rust/lit-node/src/models/mod.rs#L177
Note, some params are still accepted in the nodes for backwards compatible reasons but they don't need to be present in the SDK as we're not making the SDK backwards compatible with the older node versions
For instance, we don't allow passing an AuthSig for signSessionKey: https://github.com/LIT-Protocol/lit-assets/blob/aff82c4381139476aeaa6faa814069b184d38d39/rust/lit-node/src/endpoints/versions/v1.rs#L59
There are bunch of other restrictions for the v1 endpoint in the above node file. We should make the SDK interfaces compatible with those restriction as well

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ansonhkg this comment is remaining

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea has been addressed in one of the comments below, will double check again here #435

Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,11 @@ export interface BaseJsonExecutionRequest {
authMethods?: AuthMethod[];
}

/**
* FIXME: We should create a separate interface for JsExecutionRequestBody
* a body that the SDK accepts, and another one the node actually accepts.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can't we have a single interface?

*
*/
export interface WithAuthSig extends BaseJsonExecutionRequest {
authSig: AuthSig;
sessionSigs?: any;
Expand All @@ -257,7 +262,7 @@ export interface WithSessionSigs extends BaseJsonExecutionRequest {
export type JsonExecutionRequest = WithAuthSig | WithSessionSigs;

export interface JsExecutionRequestBody {
Ansonhkg marked this conversation as resolved.
Show resolved Hide resolved
authSig?: AuthSig;
authSig: AuthSig;
code?: string;
ipfsId?: string;
authMethods?: AuthMethod[];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can't provide authMethod any more

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ansonhkg this comment is remaining?

Expand Down Expand Up @@ -313,7 +318,6 @@ export interface JsonSignSessionKeyRequestV1 {
sessionKey: string;
authMethods: AuthMethod[];
pkpPublicKey?: string;
authSig?: AuthSig;
siweMessage: string;
curveType: 'BLS';
code?: string;
Expand Down