Skip to content

Conversation

@Ansonhkg
Copy link
Collaborator

@Ansonhkg Ansonhkg commented Sep 5, 2025

WHAT

Custom auth E2E tests were producing false-positive results. It was working because it was using the cached Alice's delegation auth sig instead of using a fresh PKP.

CHANGES

  • Fixed the custom auth test to use Eve's PKP instead of Alice.
  • Updated the custom auth validation ipfs cid QmTdTemgWBYS76ACdZPttsve6edukyXjCdsNYNK1QDeXKY
  • Disabled some custom auth tests for the time being, will need to have follow up PRs for that.

TEST

This PR depends on the hardcoded keysets fixes here

bun test e2e/src/tickets/custom-auth.spec.ts --timeout 500000

- add missing `maxPrice` in the custom auth payload
- e2e: fix custom auths
@Ansonhkg Ansonhkg added 🐞 Bug Fix Something isn't working v8 | Naga labels Sep 5, 2025
litActionCode: requestBody.litActionCode,
litActionIpfsId: requestBody.litActionIpfsId,
jsParams: requestBody.jsParams,
maxPrice: getUserMaxPrice({
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This was missing in the payload

@Ansonhkg Ansonhkg self-assigned this Sep 5, 2025
@Ansonhkg Ansonhkg changed the title [Bug] Fix False Positive Custom Auth Tests 3 - [Bug] Fix False Positive Custom Auth Tests Sep 5, 2025
@Ansonhkg Ansonhkg changed the title 3 - [Bug] Fix False Positive Custom Auth Tests [Bug] Fix False Positive Custom Auth Tests Sep 5, 2025
Comment on lines 41 to 63
// (async () => {
// const dAppUniqueAuthMethodType = "0x20b2c2163698c4ba8166450ff2378d96c009016deba048b9b125a696c74ea4b5";
// const { pkpPublicKey, username, password, authMethodId } = jsParams;

// // Custom validation logic for amazing-app-x35ju8
// const EXPECTED_USERNAME = 'alice';
// const EXPECTED_PASSWORD = 'lit';
// const userIsValid = username === EXPECTED_USERNAME && password === EXPECTED_PASSWORD;

// // Check PKP permissions
// const tokenId = await Lit.Actions.pubkeyToTokenId({ publicKey: pkpPublicKey });
// const permittedAuthMethods = await Lit.Actions.getPermittedAuthMethods({ tokenId });

// const isPermitted = permittedAuthMethods.some((permittedAuthMethod) => {
// return permittedAuthMethod["auth_method_type"] === dAppUniqueAuthMethodType &&
// permittedAuthMethod["id"] === authMethodId;
// });

// const isValid = isPermitted && userIsValid;
// LitActions.setResponse({ response: isValid ? "true" : "false" });
// })();
// ============================================================
const validationIpfsCid = 'QmP3ZoTSGQ2P9cAZ4pBUjmPC34xbJZFRoWnCXT2SdHA2uD';
Copy link
Contributor

Choose a reason for hiding this comment

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

Image

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

updated

Copy link
Collaborator

@glitch003 glitch003 left a comment

Choose a reason for hiding this comment

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

seems good as long as questions are addressed

Ansonhkg added a commit that referenced this pull request Sep 15, 2025
@Ansonhkg Ansonhkg merged commit 7b54590 into naga_add_hardcoded_keysets-3 Sep 15, 2025
2 of 3 checks passed
@Ansonhkg Ansonhkg deleted the feature/jss-85-bug-fix-custom-auth-e2e-tests branch September 15, 2025 16:31
@Ansonhkg Ansonhkg mentioned this pull request Sep 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 Bug Fix Something isn't working v8 | Naga

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants