Commit Graph

18 Commits

Author SHA1 Message Date
saravanakumardb1
46ee14371c fix(ci): add --pool forks to all vitest test scripts to fix kill EPERM on Node v25
Root cause: tinypool worker teardown calls kill() which returns EPERM
in the act_runner host environment on Node.js v25.2.1. Tests pass but
the vitest process crashes during cleanup, causing CI failure.

Fix: --pool forks CLI flag on every package/service test script, plus
pool: 'forks' in all vitest.config.ts files. This uses child_process.fork()
worker management which handles termination cleanly.

60 package.json files updated, 10 vitest.config.ts files updated.
2026-03-27 23:23:38 -07:00
saravanakumardb1
b6348fd4fe fix(security): harden npm publish — add .npmrc + publishConfig to all 57 packages
- Created .npmrc with @bytelyst scoped registry pointing to local Gitea
- Added publishConfig.registry to all 57 @bytelyst/* package.json files
- Created scripts/harden-publish-config.sh for future re-runs
- Prevents accidental publish to npmjs.org or corporate JFrog registry
2026-03-26 21:51:05 -07:00
saravanakumardb1
adfa5b9fec fix(react-auth): align source version with published package 2026-03-23 18:36:15 -07:00
saravanakumardb1
9471d4c56f fix(test): add @vitest-environment happy-dom to React UI test files
6 test files across 4 packages (auth-ui, dashboard-components,
dashboard-shell, react-auth) failed with 'document is not defined'
when run from the monorepo root because the root vitest config uses
environment: 'node'. The package-local configs set happy-dom but are
ignored when vitest is invoked from root.

Fix: Add per-file '// @vitest-environment happy-dom' annotations,
which is the recommended vitest pattern for mixed-environment monorepos.
This ensures tests work regardless of which config is loaded.

Recovers 148 tests across 6 files.
2026-03-21 16:21:42 -07:00
saravanakumardb1
79e704286f feat(react-auth): include productId in login/register request bodies
When productId is configured via createAuthProvider({ productId }),
it is now included in the login and register POST bodies alongside
email/password. Previously it was only injected for OAuth calls.

This is required by platform-service which validates productId on
all auth endpoints.
2026-03-18 20:54:20 -07:00
root
8ad3e1be34 test(core): strengthen app and auth assertions 2026-03-14 14:25:18 +00:00
saravanakumardb1
f4b9124065 feat(auth): add Phase 5C-5E endpoints + SDK methods — TOTP secret, push approvals, QR auth
- GET /auth/mfa/totp/secret — retrieve decrypted TOTP secret for auth app
- POST /auth/mfa/push/create, GET /pending, POST /:id/respond, GET /:id/status
- POST /auth/qr/create, POST /auth/qr/confirm, GET /auth/qr/:id/status
- Kotlin SDK: getTotpSecret, getPendingApprovals, respondToApproval, confirmQrLogin
- Swift SDK: getTotpSecret, getPendingApprovals, respondToApproval, confirmQrLogin
- All 53 auth tests passing
2026-03-12 15:01:51 -07:00
saravanakumardb1
53f2a97d40 feat(auth): SmartAuth SDK packages — OAuth, MFA, passkeys, devices, RS256, auth-ui
Phase 1C: @bytelyst/auth-client + @bytelyst/react-auth Google Sign-In
- loginWithGoogle/Microsoft/Apple(idToken) → POST /auth/oauth/:provider
- getProviders/linkProvider/unlinkProvider → provider management
- React context: loginWithGoogle, providers state, refreshProviders

Phase 2D: MFA + Social Login SDK + Auth UI
- verifyMfa/setupTotp/verifyTotpSetup/disableMfa/getMfaStatus
- regenerateRecoveryCodes → recovery code management
- React context: mfaRequired/mfaChallenge/mfaMethods state, verifyMfa action
- login() handles MfaLoginResult (returns false, sets MFA state)
- NEW @bytelyst/auth-ui: LoginForm, MfaChallenge, SocialButtons components

Phase 3: Passkeys + Device SDK
- getPasskeyRegisterOptions/verifyPasskeyRegistration
- getPasskeyAuthOptions/verifyPasskeyAuth/listPasskeys/deletePasskey
- listDevices/trustDevice/revokeDevice/revokeAllDevices

Phase 4C: @bytelyst/auth RS256 support
- createJwtUtils({ algorithm: 'RS256', rsaPrivateKey, rsaPublicKey })
- Dual verification: RS256 first, HS256 fallback (migration-safe)
- Remote JWKS support via jwksUrl option
- Backward-compatible: HS256 remains default

Phase 5B: Admin security endpoints
- getSecurityOverview/unlockUser/exportAuthData/cancelDeletion

Tests: 101 total (36 auth-client + 21 react-auth + 13 auth-ui + 31 auth)
Builds: all 4 packages pass tsc
2026-03-12 10:50:56 -07:00
saravanakumardb1
062d87a93a test(react-auth): add tests for updateUser, onInit, and onInit-null-fallback 2026-02-28 11:48:48 -08:00
saravanakumardb1
1925370604 fix(react-auth): add updateUser to AuthContextValue + provider for local user state mutation 2026-02-28 11:38:27 -08:00
saravanakumardb1
da165a589a refactor(dashboards): wire @bytelyst/telemetry-client into admin-web + tracker-web, add onInit + baseUrl to react-auth 2026-02-28 11:27:57 -08:00
saravanakumardb1
b400c76c0a feat(packages): add @bytelyst/auth-client + telemetry-client, extend react-auth lifecycle
- @bytelyst/auth-client: browser/RN-safe auth API wrapper (17 tests)
- @bytelyst/telemetry-client: shared telemetry with configurable transport (11 tests)
- @bytelyst/react-auth: add register, forgotPw, changePw, deleteAccount, token refresh (10 tests)
- eslint.config: add missing browser globals
2026-02-28 04:49:46 -08:00
c84185da24 test(react-auth): switch vitest env to happy-dom 2026-02-14 13:15:12 -08:00
saravanakumardb1
54e062b989 chore: remove unused devDeps found by depcheck
- react-auth: removed @testing-library/jest-dom (not imported)
- testing: removed @bytelyst/errors, @fastify/cors (not imported)
2026-02-13 00:17:04 -08:00
saravanakumardb1
428e973548 test(react-auth): add 10 tests with jsdom + React Testing Library
Tests: createAuthProvider factory, AuthProvider rendering, login/logout
flows, localStorage persistence, onLoginFallback, useAuth outside provider,
custom storage prefix.
2026-02-12 22:55:44 -08:00
saravanakumardb1
11e79aa4f9 feat(react-auth): add onLoginFallback to createAuthProvider config
Allows dashboards to provide fallback login logic (e.g. mock credentials)
when the API is unavailable. Used by admin-dashboard-web.
2026-02-12 22:21:25 -08:00
saravanakumardb1
90b9cf93d8 fix(common): configure ESLint 9 and fix lint issues
- Added @eslint/js dependency
- Updated eslint.config.js for ESLint 9 compatibility
- Added required globals (crypto, localStorage, React, etc.)
- Fixed unused imports and variables
- Disabled sort-imports temporarily
- Formatted all files with Prettier
2026-02-12 16:37:30 -08:00
saravanakumardb1
cf8781cc11 feat(react-auth): add @bytelyst/react-auth package
- createAuthProvider<TUser>() factory returns typed AuthProvider + useAuth hook
- Configurable storagePrefix, loginEndpoint, mapLoginResponse, onLogout
- localStorage persistence for user, access token, refresh token
- Uses @bytelyst/api-client for login requests
- Replaces 3 duplicated auth-context.tsx files across LysnrAI dashboards
- Peer dep: react >=18.0.0, workspace dep: @bytelyst/api-client
2026-02-12 11:22:41 -08:00