Commit Graph

54 Commits

Author SHA1 Message Date
26951cc472 fix import for derived accounts and hopefully make other account-access code more robust 2025-06-08 19:14:41 -06:00
24cfeca1eb fix some errors and correct recent type duplications & bloat (cherry-picked from d8f2587d1c) 2025-06-07 17:53:36 -06:00
Matthew Raymer
473a115841 WIP: BROKEN FOR ELECTRON: Fixes in progress 2025-05-28 13:09:51 +00:00
Matthew Raymer
6af17c6868 refactor: remove unused imports and parameters in passkeyDidPeer.ts
- Remove unused imports:
  - DIDResolutionResult from did-resolver
  - sha256 from ethereum-cryptography/sha256.js
- Remove unused parameters from verifyJwtP256 and verifyJwtWebCrypto:
  - credIdHex
  - clientDataJsonBase64Url
  - credId

This change improves code cleanliness by removing unused code while
maintaining the core passkey authentication functionality.
2025-05-28 10:37:01 +00:00
Matthew Raymer
2d548bce1c fix: use challenge parameter in verifyJwtWebCrypto preimage
- Remove unused client data hashing in verifyJwtWebCrypto
- Use challenge parameter directly in preimage construction
- Fix TS6133 error for unused challenge parameter
- Make verification logic consistent with verifyJwtP256

This change maintains the same verification logic while properly
utilizing the challenge parameter in the signature verification.
2025-05-28 10:28:57 +00:00
Matthew Raymer
81ef55b2bf fix: use challenge parameter in verifyJwtP256 preimage
- Remove unused client data hashing in verifyJwtP256
- Use challenge parameter directly in preimage construction
- Fix TS6133 error for unused challenge parameter

This change maintains the same verification logic while properly
utilizing the challenge parameter in the signature verification.
2025-05-28 10:27:19 +00:00
Matthew Raymer
86cc2b6d68 fix: resolve TypeScript errors in passkeyDidPeer.ts
- Fix import path for VerifyAuthenticationResponseOpts to use main package
- Add proper type assertions for credential response using AuthenticatorAssertionResponse
- Add back p256 import from @noble/curves/p256
- Remove unused functions marked with @typescript-eslint/no-unused-vars:
  - peerDidToDidDocument
  - COSEtoPEM
  - base64urlDecodeArrayBuffer
  - base64urlEncodeArrayBuffer
  - pemToCryptoKey

This change improves type safety and removes dead code while maintaining
the core passkey authentication functionality.
2025-05-28 10:24:17 +00:00
Matthew Raymer
cf335c54ff fix: consolidate KeyMeta interface and improve type safety
- Remove duplicate KeyMeta interface from crypto/vc/index.ts
- Import KeyMeta from common.ts as single source of truth
- Add missing fields to KeyMeta interface (identity, passkeyCredIdHex)
- Remove unused ErrorResponse interface from endorserServer.ts
- Fix import path for KeyMeta in crypto/vc/index.ts

This change resolves type compatibility issues and ensures consistent
KeyMeta type usage across the codebase.
2025-05-28 10:13:01 +00:00
2d654b4586 fix linting 2025-05-26 22:56:00 -06:00
fe77dbdcdd add encryption & decryption for the sensitive identity & mnemonic in SQL DB 2025-05-26 22:42:20 -06:00
Matthew Raymer
dac7705003 fix: move lexical declarations outside case blocks in AbsurdSqlDatabaseService
- Move queryResult and allResult declarations outside switch statement
- Change const declarations to let since they're now in outer scope
- Remove const declarations from inside case blocks

This fixes the 'no-case-declarations' linter errors by ensuring variables
are declared in a scope that encompasses all case blocks, preventing
potential scoping issues.

Note: Type definition errors for external modules remain and should be
addressed separately.
2025-05-27 03:14:02 +00:00
3f46e3817a add encryption for the two SQL columns, replace basic DB utils, add USE_DEXIE_DB flag, and start adding SQL everywhere 2025-05-26 19:03:20 -06:00
Matthew Raymer
a4d184b1c6 refactor(qr): improve QR code scanning robustness and error handling
- Enhance JWT extraction with unified path handling and validation
- Add debouncing to prevent duplicate scans
- Improve error handling and logging throughout QR flow
- Add proper TypeScript interfaces for QR scan results
- Implement mobile app lifecycle handlers (pause/resume)
- Enhance logging with structured data and consistent levels
- Clean up scanner resources properly on component destroy
- Split contact handling into separate method for better organization
- Add proper type for UserNameDialog ref

This commit improves the reliability and maintainability of the QR code
scanning functionality while adding better error handling and logging.
2025-04-22 11:04:56 +00:00
Matthew Raymer
c9536dd643 refactor: Replace console logging with logger utility
- Add logger import across multiple view components
- Replace console.error/warn/log with logger methods
- Update error handling to use structured logging
- Improve type safety for error objects
- Add crypto-browserify polyfill for browser environment

The changes improve logging by:
1. Using consistent logging interface
2. Adding structured error logging
3. Improving error type safety
4. Centralizing logging configuration
5. Fixing browser compatibility issues

Affected files:
- Multiple view components
- vite.config.ts
- Build configuration
2025-03-11 09:35:55 +00:00
Matthew Raymer
52cbe81f23 (chore): merge mostly pathway changes 2025-02-06 13:34:48 +00:00
6a070a1715 fix linting (and change a little wording in onboarding page) 2025-02-03 16:36:13 -07:00
5943df756a make screen where user can create a group onboarding meeting 2025-02-02 17:06:51 -07:00
Matthew Raymer
6903a02df6 Merge fixes 2025-01-11 12:45:43 +00:00
e97bc4893e change all copied contact URLs to contact-import, and handle multiples & singles separately 2025-01-09 20:10:00 -07:00
181de625ba add sanity checks for importing bulk contacts, eg. when there is a truncated link 2025-01-07 20:56:39 -07:00
2e7700731b switch so personal contact JWT is link to this server (not endorser.ch), make empty-did URL show user's info 2025-01-06 08:52:10 -07:00
Matthew Raymer
8b77d2b573 Refatored vite.config to be a bit more streamlined before adding alternate build options. This did end up requiring me to remove @ from imports for some reason. Tests came out fine. 2025-01-05 08:38:15 +00:00
e286a8f002 change the contact-sharing data into a JWT for the contact-import page 2024-12-23 20:07:14 -07:00
bf6035ec47 fix the verificationMethod type in the local ETHR DID resolver 2024-12-23 20:05:33 -07:00
149481d468 finish the loading of an invite RegisterAction when clicking on a link 2024-10-06 20:01:07 -06:00
1bfdcab90b add page for one-on-one invites (incomplete) 2024-10-05 18:35:59 -06:00
a271d9c206 add link directly into contact page to add a new contact via "contactJwt" query parameter 2024-09-27 18:41:11 -06:00
d724d8093c add ability to edit a GiveAction 2024-07-23 20:14:07 -06:00
4270374a67 create an identifier by default, while letting them choose if passkeys are enabled 2024-07-19 20:49:43 -06:00
b2ebc2992b cache the passkey JWANT access token for multiple signatures 2024-07-19 12:44:54 -06:00
cd0a31e6f5 remove remaining getIdentity calls & fix QR code for did:peer 2024-07-15 20:47:10 -06:00
f6338c05ee move low-level DID-related create & decode into separate folder (#120)
Co-authored-by: Trent Larson <trent@trentlarson.com>
Reviewed-on: trent_larson/crowd-funder-for-time-pwa#120
Co-authored-by: trentlarson <trent@trentlarson.com>
Co-committed-by: trentlarson <trent@trentlarson.com>
2024-07-13 13:24:54 -04:00
7cb9e2aa52 replace remaining didJwt.createJwt calls with one that checks for did:peer 2024-07-11 19:35:17 -06:00
145a1da37e linting cleanup 2024-07-09 19:42:55 -06:00
bce003e508 change accessToken to take a DID 2024-07-09 19:20:05 -06:00
45f0a14661 add expiration inside JWANT & refactor getHeaders to move toward supporting did:peer 2024-07-09 17:56:48 -06:00
9677a344c2 misc syntactic & type-checking clean-up 2024-07-06 07:15:46 -06:00
4cb434fd5d passkey test (#116)
Co-authored-by: Trent Larson <trent@trentlarson.com>
Reviewed-on: trent_larson/crowd-funder-for-time-pwa#116
Co-authored-by: trentlarson <trent@trentlarson.com>
Co-committed-by: trentlarson <trent@trentlarson.com>
2024-06-24 22:21:24 -04:00
ef5f81932d Initial stab at vitejs update 2024-03-24 11:18:29 -06:00
934664b9c9 add the hashed-next-key to the contact data, shown & stored 2024-01-03 17:44:41 -07:00
ce06e8f0fa update derivation path to the one for time 2023-10-31 19:58:07 -06:00
94d9c425ad add QR scanner for adding a contact 2023-09-07 18:59:19 -06:00
0c05505c46 allow use of custom derivation path, and add way to increment derivation for existing 2023-08-20 19:46:12 -06:00
Matthew Raymer
754bced2a9 Considerable cleanup. I think I also found the issue from the other day with values not loading from settings. 2023-07-06 18:12:21 +08:00
cfeabf05a4 refactor DB organization (prepping for more tables) 2023-03-18 17:04:14 -06:00
2a7c858662 refactor: use our own SimpleSigner since library version is deprecated 2023-01-09 19:08:41 -07:00
Matthew Aaron Raymer
ba85663048 Linted 2023-01-07 13:19:04 +08:00
9d566fa977 fix: use SimpleSigner directly from did-jwt 2023-01-06 19:25:53 -07:00
Matthew Aaron Raymer
150b35c4c7 Update with our own SimpleSigner 2023-01-06 17:30:41 +08:00
Matthew Aaron Raymer
f858a4d29a Linted 2023-01-04 17:09:11 +08:00