feat(auth): implement session methods with Payload-backed JWT
Some checks failed
CI / typecheck + lint + boundaries + test + build (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Coverage snapshot / snapshot (push) Has been cancelled
Release Please / release-please (push) Has been cancelled
Sentry PII guard (R31) / pii-guard (push) Has been cancelled
CI / Playwright e2e (push) Has been cancelled
CI / Storybook smoke tests + visual regression (push) Has been cancelled
Mutation testing (nightly) / mutate (push) Has been cancelled
Library trace revalidation (weekly) / revalidate (push) Has been cancelled
Some checks failed
CI / typecheck + lint + boundaries + test + build (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Coverage snapshot / snapshot (push) Has been cancelled
Release Please / release-please (push) Has been cancelled
Sentry PII guard (R31) / pii-guard (push) Has been cancelled
CI / Playwright e2e (push) Has been cancelled
CI / Storybook smoke tests + visual regression (push) Has been cancelled
Mutation testing (nightly) / mutate (push) Has been cancelled
Library trace revalidation (weekly) / revalidate (push) Has been cancelled
Replace NotImplementedError stubs in AuthenticationService with working implementations: createSession signs a HS256 JWT using Payload's instance secret, validateSession verifies and decodes the token then looks up the user, invalidateSession returns a blank cookie with maxAge 0. No external JWT dependency — uses Node crypto HMAC directly. Also clarify withAudit/withAnalytics comments: the wrappers intentionally delegate recording to the use case body (only it knows which fields to extract), so the TODO was misleading.
This commit is contained in:
@@ -21,11 +21,10 @@ export type Audited<F> = F & { readonly __audited: true };
|
||||
* tests).
|
||||
*/
|
||||
export function withAudit<Args extends unknown[], R>(
|
||||
// TODO: wire automated recording from manifest declarations.
|
||||
// `audits[]` declarations. For now, the wrapper exists to:
|
||||
// (1) require callers to pass the auditLog at bind time (dep is available)
|
||||
// (2) attach the `__audited` brand so the boot-time assertion can verify
|
||||
// mutating use cases were bound through the audit-aware path.
|
||||
// The wrapper attaches the brand and ensures the auditLog dependency is
|
||||
// available at bind time. Actual `auditLog.record()` calls live in the
|
||||
// use case body — only the use case knows which fields to extract from
|
||||
// its input/output for the audit entry.
|
||||
auditLog: IAuditLog,
|
||||
fn: (...args: Args) => Promise<R>,
|
||||
): Audited<(...args: Args) => Promise<R>> {
|
||||
|
||||
Reference in New Issue
Block a user