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

Auth Unification, Custom Auths, better tests #435

Merged
merged 156 commits into from
May 10, 2024

Conversation

Ansonhkg
Copy link
Collaborator

@Ansonhkg Ansonhkg commented Apr 23, 2024

Description

This PR introduces Tinny, an improved mini e2e testing framework that allows us to write tests in TypeScript. It leverages esbuild for rapid test compilation and execution. Tinny includes typed test helper functions to generate new identities within tests, and provides APIs to modify the development environment.

See docs:
https://github.com/LIT-Protocol/js-sdk/tree/feature/lit-2958-auth-unification-ts-tests/local-tests

Note

We are not merging this PR to master until all related PRs are merged to this branch.

Cherry Picked:

We should also raise a PR to remove all existing V0 features when we are ready to deploy. They are now being tracked here

Changes

  • Local Network Context: Fixed issues to ensure local network settings are accurately recognized during test runs.
  • Helper Functions: Introduced new helper functions for siweMessage creation and authSig crafting, addressing circular dependencies in the auth-helpers package.
  • Fetch Polyfill: Implemented a temporary fix to ensure the fetch API is polyfilled correctly when bundling the tests.
  • Interface Updates: Restored the litNodeClient to the ILitNodeClient interface to ensure type consistency.
  • Auth unification params: Expanded authNeededCallbacks to support additional parameters and introduced a - higher-level function, getPkpSessionSigs, to streamline PKP sessionSigs creation process.
  • Type Migration: Migrated type definitions to the types package to enhance modularity and maintenance.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Screen.Recording.2024-04-23.at.23.26.00.mov

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@Ansonhkg Ansonhkg marked this pull request as ready for review April 23, 2024 19:11
Copy link

@joshLong145 joshLong145 left a comment

Choose a reason for hiding this comment

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

Left some comments going to do another pass

local-tests/build.mjs Show resolved Hide resolved
packages/auth-helpers/src/lib/craft-auth-sig.ts Outdated Show resolved Hide resolved
packages/contracts-sdk/src/lib/contracts-sdk.ts Outdated Show resolved Hide resolved
packages/types/src/lib/ILitNodeClient.ts Show resolved Hide resolved
packages/types/src/lib/interfaces.ts Outdated Show resolved Hide resolved
packages/types/src/lib/interfaces.ts Outdated Show resolved Hide resolved
packages/types/src/lib/models.ts Show resolved Hide resolved
@Ansonhkg Ansonhkg changed the title [STAGING] BREAKING - Auth Unification [6.0] Staging - Auth Unification, Custom Auths, better tests May 10, 2024
@joshLong145 joshLong145 changed the base branch from master to staging/v6 May 10, 2024 18:36
Josh Long added 2 commits May 10, 2024 15:15
@joshLong145 joshLong145 changed the title [6.0] Staging - Auth Unification, Custom Auths, better tests Auth Unification, Custom Auths, better tests May 10, 2024
@joshLong145 joshLong145 merged commit 9b1a61e into staging/v6 May 10, 2024
3 of 4 checks passed
@joshLong145 joshLong145 deleted the feature/lit-2958-auth-unification-ts-tests branch May 10, 2024 19:45
@joshLong145 joshLong145 mentioned this pull request May 10, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants