kinde-testkit 0.7.1 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +97 -9
  3. package/dist/chunk-BPPG4G52.js +427 -0
  4. package/dist/chunk-BPPG4G52.js.map +1 -0
  5. package/dist/{chunk-IOP27RQ5.js → chunk-CY75AADD.js} +167 -450
  6. package/dist/chunk-CY75AADD.js.map +1 -0
  7. package/dist/chunk-EZUKOKNO.js +48 -0
  8. package/dist/chunk-EZUKOKNO.js.map +1 -0
  9. package/dist/{chunk-K5YNZAOM.js → chunk-YJPE5HAM.js} +5 -3
  10. package/dist/{chunk-K5YNZAOM.js.map → chunk-YJPE5HAM.js.map} +1 -1
  11. package/dist/cli.js +8 -2
  12. package/dist/cli.js.map +1 -1
  13. package/dist/cypress-support.d.ts +45 -1
  14. package/dist/cypress-support.js +21 -6
  15. package/dist/cypress-support.js.map +1 -1
  16. package/dist/cypress.cjs +134 -10
  17. package/dist/cypress.d.cts +1 -1
  18. package/dist/cypress.d.ts +3 -2
  19. package/dist/cypress.js +2 -1
  20. package/dist/cypress.js.map +1 -1
  21. package/dist/{handle-QF340J2E.d.cts → handle-DRPxm36j.d.cts} +1 -1
  22. package/dist/{handle-DxF0uwza.d.ts → handle-Pjt9fSUq.d.ts} +3 -2
  23. package/dist/index.cjs +137 -10
  24. package/dist/index.d.cts +17 -4
  25. package/dist/index.d.ts +8 -26
  26. package/dist/index.js +27 -51
  27. package/dist/index.js.map +1 -1
  28. package/dist/jest.cjs +134 -10
  29. package/dist/jest.d.cts +3 -3
  30. package/dist/jest.d.ts +5 -4
  31. package/dist/jest.js +3 -2
  32. package/dist/jest.js.map +1 -1
  33. package/dist/playwright.d.ts +12 -3
  34. package/dist/playwright.js +30 -0
  35. package/dist/playwright.js.map +1 -1
  36. package/dist/react.d.ts +43 -0
  37. package/dist/react.js +110 -0
  38. package/dist/react.js.map +1 -0
  39. package/dist/{server-CcXI3vJ-.d.cts → server-CLRn67qI.d.cts} +24 -0
  40. package/dist/{server-Dghq0aLx.d.ts → server-CuHAHsaN.d.ts} +3 -58
  41. package/dist/sign-in-flow-DNrDXSLI.d.ts +35 -0
  42. package/dist/testkit-BvCAFsSj.d.ts +156 -0
  43. package/dist/vitest.d.ts +5 -4
  44. package/dist/vitest.js +3 -2
  45. package/dist/vitest.js.map +1 -1
  46. package/dist/{webhooks-DJyCsbdF.d.ts → webhooks-CiK9_pVw.d.ts} +82 -155
  47. package/package.json +30 -3
  48. package/dist/chunk-IOP27RQ5.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/react.ts"],"sourcesContent":["import { KindeContext, type KindeContextProps } from \"@kinde-oss/kinde-auth-react\";\nimport {\n getClaim,\n getClaims,\n getCurrentOrganization,\n getFlag,\n getPermission,\n getPermissions,\n getRoles,\n getUserOrganizations,\n getUserProfile,\n MemoryStorage,\n setActiveStorage,\n StorageKeys,\n} from \"@kinde/js-utils\";\nimport { existsSync } from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport { dirname, join } from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { createElement, type Context, type ReactNode } from \"react\";\nimport { getDefaultTestkit, type KindeTestkit, type ScenarioTokenOverrides } from \"./testkit.js\";\nimport type { Scenario } from \"./types.js\";\n\nexport interface KindeTestAuthOptions {\n /** Signs the tokens. Defaults to the shared testkit whose issuer is http://localhost:4400. */\n testkit?: KindeTestkit;\n /** Feature flags in the access token, such as { new_editor: true }. */\n featureFlags?: Record<string, boolean | string | number>;\n /** Other token settings, the same as kindeTest() and tokenFor(). */\n token?: ScenarioTokenOverrides;\n}\n\n/** A call your component made to a Kinde action, such as login() or logout(). */\nexport interface KindeTestAuthCall {\n method: \"login\" | \"register\" | \"logout\" | \"switchOrg\" | \"refreshToken\" | \"generatePortalUrl\";\n args: unknown[];\n}\n\nexport interface KindeTestAuth {\n /** Pass to React Testing Library: render(<App />, { wrapper: auth.wrapper }). */\n wrapper: (props: { children?: ReactNode }) => ReactNode;\n /** The value the wrapper gives KindeContext. */\n value: KindeContextProps;\n /** Every login(), logout(), register() and switchOrg() call, in order. */\n calls: KindeTestAuthCall[];\n accessToken: string | null;\n idToken: string | null;\n}\n\nlet contextsPromise: Promise<Array<Context<KindeContextProps | null>>> | null = null;\n\n/**\n * The KindeContext objects the installed SDKs read. @kinde-oss/kinde-auth-nextjs pins its own\n * version of @kinde-oss/kinde-auth-react, so a project can have two copies, each with its own context.\n */\nfunction kindeContexts(): Promise<Array<Context<KindeContextProps | null>>> {\n contextsPromise ??= (async () => {\n const contexts = [KindeContext];\n try {\n const require = createRequire(import.meta.url);\n let dir = dirname(require.resolve(\"@kinde-oss/kinde-auth-nextjs\"));\n while (!existsSync(join(dir, \"package.json\"))) dir = dirname(dir);\n const nested = join(dir, \"node_modules\", \"@kinde-oss\", \"kinde-auth-react\", \"dist\", \"index.mjs\");\n if (existsSync(nested)) {\n const module = (await import(pathToFileURL(nested).href)) as { KindeContext: Context<KindeContextProps | null> };\n if (module.KindeContext !== KindeContext) contexts.push(module.KindeContext);\n }\n } catch {\n // The Next.js SDK is not installed.\n }\n return contexts;\n })();\n return contextsPromise;\n}\n\nfunction flagClaims(flags: Record<string, boolean | string | number> | undefined) {\n if (!flags) return undefined;\n return Object.fromEntries(\n Object.entries(flags).map(([key, v]) => [key, { t: typeof v === \"boolean\" ? \"b\" : typeof v === \"number\" ? \"i\" : \"s\", v }]),\n ) as Record<string, { t: \"b\" | \"s\" | \"i\"; v: boolean | string | number }>;\n}\n\n/**\n * Builds Kinde auth state for components under test. Components that call useKindeAuth() from\n * @kinde-oss/kinde-auth-react or useKindeBrowserClient() from @kinde-oss/kinde-auth-nextjs read\n * real tokens signed for the scenario, through the same @kinde/js-utils functions the SDKs use.\n */\nexport async function kindeAuth(scenario: Scenario, options: KindeTestAuthOptions = {}): Promise<KindeTestAuth> {\n const testkit = options.testkit ?? (await getDefaultTestkit());\n const accessToken = await testkit.tokenFor(scenario, { ...options.token, featureFlags: flagClaims(options.featureFlags) ?? options.token?.featureFlags });\n const idToken = await testkit.idTokenFor(scenario);\n const storage = new MemoryStorage();\n if (accessToken) await storage.setSessionItem(StorageKeys.accessToken, accessToken);\n if (idToken) await storage.setSessionItem(StorageKeys.idToken, idToken);\n\n // @kinde/js-utils reads one active storage, so each call points it at this scenario's tokens first.\n const withStorage =\n <A extends unknown[], R>(fn: (...args: A) => R) =>\n (...args: A): R => {\n setActiveStorage(storage);\n return fn(...args);\n };\n const calls: KindeTestAuthCall[] = [];\n const record =\n (method: KindeTestAuthCall[\"method\"]) =>\n async (...args: unknown[]) => {\n calls.push({ method, args });\n };\n\n const authenticated = scenario.kind === \"authenticated\";\n const user = authenticated ? await withStorage(getUserProfile)() : null;\n const value = {\n isAuthenticated: authenticated,\n isLoading: false,\n user: user ?? undefined,\n error: undefined,\n login: record(\"login\"),\n register: record(\"register\"),\n logout: record(\"logout\"),\n switchOrg: record(\"switchOrg\"),\n refreshToken: async (...args: unknown[]) => {\n calls.push({ method: \"refreshToken\", args });\n return { success: true, accessToken: accessToken ?? undefined, idToken: idToken ?? undefined };\n },\n generatePortalUrl: async (...args: unknown[]) => {\n calls.push({ method: \"generatePortalUrl\", args });\n return { url: new URL(`${testkit.issuer}/testkit/portal`) };\n },\n getToken: async () => accessToken ?? undefined,\n getAccessToken: async () => accessToken ?? undefined,\n getIdToken: async () => idToken ?? undefined,\n getClaims: withStorage(getClaims),\n getClaim: withStorage(getClaim),\n getOrganization: withStorage(getCurrentOrganization),\n getCurrentOrganization: withStorage(getCurrentOrganization),\n getFlag: withStorage(getFlag),\n getUserProfile: withStorage(getUserProfile),\n getPermission: withStorage(getPermission),\n getPermissions: withStorage(getPermissions),\n getUserOrganizations: withStorage(getUserOrganizations),\n getRoles: withStorage(getRoles),\n } as unknown as KindeContextProps;\n\n const contexts = await kindeContexts();\n const wrapper = ({ children }: { children?: ReactNode }) =>\n contexts.reduce<ReactNode>((inner, context) => createElement(context.Provider, { value }, inner), children ?? null);\n return { wrapper, value, calls, accessToken, idToken };\n}\n\n/** Wraps children in Kinde auth state built by kindeAuth(). */\nexport function KindeTestProvider({ auth, children }: { auth: KindeTestAuth; children?: ReactNode }) {\n return auth.wrapper({ children });\n}\n"],"mappings":"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","names":["require"]}
@@ -294,6 +294,17 @@ interface UserMeta {
294
294
  /** Last sign-in time per organization code. */
295
295
  lastOrganizationSignIns: Record<string, string>;
296
296
  }
297
+ /** An identity for authenticateAs(). */
298
+ interface Identity {
299
+ email: string;
300
+ givenName?: string | null;
301
+ familyName?: string | null;
302
+ /** The organization code. Created when it does not exist. */
303
+ organization?: string | null;
304
+ organizationName?: string;
305
+ roles?: string[];
306
+ permissions?: string[];
307
+ }
297
308
  interface OrganizationMeta {
298
309
  externalId: string | null;
299
310
  handle: string;
@@ -331,6 +342,15 @@ declare class Directory {
331
342
  deleteOrganization(code: string): boolean;
332
343
  membership(userId: string, organizationCode: string): KindeMembership | undefined;
333
344
  addMembership(userId: string, organizationCode: string, roles?: string[], permissions?: string[]): KindeMembership;
345
+ /**
346
+ * Makes sure a user exists with exactly these roles and permissions in the organization, creating
347
+ * the user, organization and membership when they are missing. Used by authenticateAs() in browser
348
+ * tests, so a test can sign in as any identity without adding it to the seed. reset() removes it.
349
+ */
350
+ ensureIdentity(input: Identity): {
351
+ user: KindeUser;
352
+ organization: KindeOrganization | null;
353
+ };
334
354
  removeMembership(userId: string, organizationCode: string): boolean;
335
355
  role(idOrKey: string): SeedRole | undefined;
336
356
  permission(idOrKey: string): SeedPermission | undefined;
@@ -355,7 +375,10 @@ interface FailureRule {
355
375
  hang?: boolean;
356
376
  times?: number;
357
377
  retryAfter?: number;
378
+ /** Answer with a body your client cannot use. The status is 200 unless you set one. */
379
+ malformed?: MalformedKind;
358
380
  }
381
+ type MalformedKind = "invalid-json" | "empty" | "html" | "unexpected-json";
359
382
  interface ActiveFailure {
360
383
  id: string;
361
384
  path: string;
@@ -365,6 +388,7 @@ interface ActiveFailure {
365
388
  hang: boolean;
366
389
  remaining: number | null;
367
390
  retryAfter: number;
391
+ malformed: MalformedKind | null;
368
392
  hits: number;
369
393
  }
370
394
  declare class FailureInjector {
@@ -1,60 +1,5 @@
1
- import { R as ResolvedSeed, a as KindeUser, K as KindeOrganization, b as KindeMembership, O as SeedRole, P as SeedPermission, l as InvalidTokenKind, T as TestkitSeed, C as WebhookOptions, o as KindeTestkit, F as FailureInjector, w as WebhookDispatcher } from './webhooks-DJyCsbdF.js';
2
-
3
- interface UserMeta {
4
- providedId: string | null;
5
- isSuspended: boolean;
6
- isPasswordResetRequested: boolean;
7
- createdOn: string;
8
- totalSignIns: number;
9
- lastSignedIn: string | null;
10
- /** Last sign-in time per organization code. */
11
- lastOrganizationSignIns: Record<string, string>;
12
- }
13
- interface OrganizationMeta {
14
- externalId: string | null;
15
- handle: string;
16
- createdOn: string;
17
- isAllowRegistrations: boolean;
18
- }
19
- declare class Directory {
20
- readonly seed: ResolvedSeed;
21
- private readonly userMeta;
22
- private readonly orgMeta;
23
- private snapshot;
24
- constructor(seed: ResolvedSeed);
25
- restore(): void;
26
- /** Replaces the whole seed with another resolved seed, and makes it the state reset() returns to. */
27
- load(next: ResolvedSeed): void;
28
- user(id: string): KindeUser | undefined;
29
- meta(user: KindeUser): UserMeta;
30
- isSuspended(userId: string): boolean;
31
- recordSignIn(user: KindeUser, organizationCode: string | null): void;
32
- createUser(input: {
33
- email?: string | null;
34
- givenName?: string | null;
35
- familyName?: string | null;
36
- picture?: string | null;
37
- providedId?: string | null;
38
- }): KindeUser;
39
- deleteUser(id: string): boolean;
40
- organization(code: string): KindeOrganization | undefined;
41
- orgInfo(org: KindeOrganization): OrganizationMeta;
42
- createOrganization(input: {
43
- name: string;
44
- externalId?: string | null;
45
- handle?: string | null;
46
- }): KindeOrganization;
47
- deleteOrganization(code: string): boolean;
48
- membership(userId: string, organizationCode: string): KindeMembership | undefined;
49
- addMembership(userId: string, organizationCode: string, roles?: string[], permissions?: string[]): KindeMembership;
50
- removeMembership(userId: string, organizationCode: string): boolean;
51
- role(idOrKey: string): SeedRole | undefined;
52
- permission(idOrKey: string): SeedPermission | undefined;
53
- ensureRole(key: string, extra?: Partial<Omit<SeedRole, "id" | "key">>): SeedRole;
54
- ensurePermission(key: string, extra?: Partial<Omit<SeedPermission, "id" | "key">>): SeedPermission;
55
- deleteRole(id: string): SeedRole | undefined;
56
- deletePermission(id: string): SeedPermission | undefined;
57
- }
1
+ import { j as InvalidTokenKind, m as KindeTestkit } from './testkit-BvCAFsSj.js';
2
+ import { T as TestkitSeed, h as WebhookOptions, R as ResolvedSeed, F as FailureInjector, d as WebhookDispatcher, D as Directory } from './webhooks-CiK9_pVw.js';
58
3
 
59
4
  interface DeviceFlowOptions {
60
5
  /** Seconds a client must wait between polls. Kinde uses 5. Set 0 in tests that poll in a loop. */
@@ -193,4 +138,4 @@ interface RunningKindeTestkit {
193
138
  }
194
139
  declare function startKindeTestkit(options?: StartKindeTestkitOptions): Promise<RunningKindeTestkit>;
195
140
 
196
- export { ActivityLog as A, COVERAGE_GROUPS as C, DEFAULT_COVERAGE_DIRECTORY as D, type RequestEntry as R, type StartKindeTestkitOptions as S, type TokenEntry as T, type CoverageGroup as a, type CoverageGroupResult as b, type CoverageItem as c, CoverageRecorder as d, type CoverageReport as e, type CoverageSnapshot as f, type DeviceFlowOptions as g, Directory as h, type RunningKindeTestkit as i, buildReport as j, clearCoverageDirectory as k, formatCoverageReport as l, mergeSnapshots as m, readCoverageDirectory as r, startKindeTestkit as s };
141
+ export { ActivityLog as A, COVERAGE_GROUPS as C, DEFAULT_COVERAGE_DIRECTORY as D, type RequestEntry as R, type StartKindeTestkitOptions as S, type TokenEntry as T, type CoverageGroup as a, type CoverageGroupResult as b, type CoverageItem as c, CoverageRecorder as d, type CoverageReport as e, type CoverageSnapshot as f, type DeviceFlowOptions as g, type RunningKindeTestkit as h, buildReport as i, clearCoverageDirectory as j, formatCoverageReport as k, mergeSnapshots as m, readCoverageDirectory as r, startKindeTestkit as s };
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Steps for signing in through the testkit with plain HTTP requests instead of a browser page.
3
+ * The Cypress commands use these. No Node APIs here, because Cypress bundles this file for the browser.
4
+ */
5
+ /** What the social provider does when the user picks it on the sign-in page. */
6
+ type ProviderResult = "success" | "cancelled" | "error";
7
+ /** What happens at the multi-factor authentication step. */
8
+ type MfaOutcome = "none" | "passed" | "failed" | "cancelled";
9
+ /** How the user signs in on the testkit page. */
10
+ interface SignInMethodOptions {
11
+ /** "email" (the default), or a social provider such as "google", "github" or "microsoft". */
12
+ connection?: string;
13
+ /** For a social provider: "success" (the default), "cancelled" by the user, or a provider "error". */
14
+ providerResult?: ProviderResult;
15
+ /** Multi-factor authentication: "none" (the default), "passed", "failed" with a wrong code, or "cancelled". */
16
+ mfa?: MfaOutcome;
17
+ }
18
+ interface RequestSignInOptions extends SignInMethodOptions {
19
+ /** Email address or ID of the user. */
20
+ user: string;
21
+ /** Active organization, for users in more than one. */
22
+ org?: string;
23
+ }
24
+ /** The app's login route, with the hints the testkit sign-in page reads. */
25
+ declare function appLoginUrl(loginPath: string, options: RequestSignInOptions): string;
26
+ /** Reads the hidden request field from the testkit sign-in page. */
27
+ declare function readSignInRequest(html: string): string;
28
+ /** The form the sign-in page posts to /oauth2/auth/login. */
29
+ declare function signInForm(request: string, options: RequestSignInOptions): Record<string, string>;
30
+ /** Explains why the testkit did not redirect back to the app after the form was posted. */
31
+ declare function signInFailure(status: number, html: string, options: RequestSignInOptions): Error;
32
+ /** Resolves a Location header, which can be relative, against the URL that sent it. */
33
+ declare function resolveLocation(location: string, from: string): string;
34
+
35
+ export { type RequestSignInOptions as R, type SignInMethodOptions as S, appLoginUrl as a, resolveLocation as b, signInForm as c, readSignInRequest as r, signInFailure as s };
@@ -0,0 +1,156 @@
1
+ import { JWTPayload, JWK } from 'jose';
2
+
3
+ interface KindeUser {
4
+ id: string;
5
+ email: string | null;
6
+ emailVerified: boolean;
7
+ givenName: string | null;
8
+ familyName: string | null;
9
+ picture: string | null;
10
+ claims: Record<string, unknown>;
11
+ }
12
+ interface KindeOrganization {
13
+ code: string;
14
+ name: string;
15
+ metadata: Record<string, unknown>;
16
+ }
17
+ interface KindeRole {
18
+ id: string;
19
+ key: string;
20
+ name: string;
21
+ }
22
+ interface KindeApplication {
23
+ clientId: string;
24
+ clientSecret: string | null;
25
+ name: string;
26
+ organizationCode: string | null;
27
+ scopes: string[] | null;
28
+ permissions: string[] | null;
29
+ audience: string[] | null;
30
+ }
31
+ interface KindeMembership {
32
+ userId: string;
33
+ organizationCode: string;
34
+ roles: string[];
35
+ permissions: string[];
36
+ }
37
+ interface AuthenticatedScenario {
38
+ kind: "authenticated";
39
+ user: KindeUser;
40
+ organization: KindeOrganization | null;
41
+ roles: string[];
42
+ permissions: string[];
43
+ claims: Record<string, unknown>;
44
+ }
45
+ interface UnauthenticatedScenario {
46
+ kind: "unauthenticated";
47
+ }
48
+ type Scenario = AuthenticatedScenario | UnauthenticatedScenario;
49
+ interface KindePrincipal {
50
+ type: "user" | "machine";
51
+ subject: string;
52
+ issuer: string;
53
+ organization: {
54
+ code: string;
55
+ } | null;
56
+ roles: string[];
57
+ permissions: string[];
58
+ claims: Record<string, unknown>;
59
+ }
60
+ type InvalidTokenKind = "expired" | "wrong-issuer" | "wrong-audience" | "missing-subject" | "missing-organization" | "missing-permissions" | "future-iat" | "bad-signature" | "unknown-key" | "unsigned";
61
+ type Duration = number | `${number}${"s" | "m" | "h" | "d"}`;
62
+ interface KindeTokenOptions {
63
+ subject?: string;
64
+ organizationCode?: string | null;
65
+ permissions?: string[];
66
+ roles?: Array<string | KindeRole>;
67
+ scopes?: string[];
68
+ featureFlags?: Record<string, {
69
+ t: "b" | "s" | "i";
70
+ v: boolean | string | number;
71
+ }>;
72
+ claims?: Record<string, unknown>;
73
+ authMethods?: string[];
74
+ authTime?: number;
75
+ clientId?: string;
76
+ audience?: string[];
77
+ expiresIn?: Duration;
78
+ invalid?: InvalidTokenKind;
79
+ }
80
+
81
+ declare const DEFAULT_ISSUER = "http://localhost:4400";
82
+ declare const DEFAULT_CLIENT_ID = "kinde_testkit_client";
83
+ declare const DEFAULT_M2M_CLIENT_ID = "kinde_testkit_m2m";
84
+ declare const DEFAULT_SCOPES: string[];
85
+ declare const DEFAULT_AUTH_METHODS: string[];
86
+ declare const INVALID_TOKEN_KINDS: readonly InvalidTokenKind[];
87
+ interface KindeTestkitOptions {
88
+ issuer?: string;
89
+ audience?: string | string[];
90
+ clientId?: string;
91
+ accessTokenExpiresIn?: Duration;
92
+ idTokenExpiresIn?: Duration;
93
+ now?: () => number;
94
+ }
95
+ type ScenarioTokenOverrides = Pick<KindeTokenOptions, "expiresIn" | "invalid" | "scopes" | "featureFlags" | "claims" | "authMethods" | "authTime" | "clientId" | "audience">;
96
+ interface M2MTokenOptions {
97
+ clientId?: string;
98
+ organizationCode?: string | null;
99
+ scopes?: string[];
100
+ grantedScopes?: string[];
101
+ audience?: string[];
102
+ permissions?: string[];
103
+ claims?: Record<string, unknown>;
104
+ expiresIn?: Duration;
105
+ invalid?: InvalidTokenKind;
106
+ }
107
+ interface IdTokenOptions {
108
+ expiresIn?: Duration;
109
+ authMethods?: string[];
110
+ authTime?: number;
111
+ clientId?: string;
112
+ nonce?: string;
113
+ }
114
+ /** Receives every token the testkit signs, for coverage and the dashboard. */
115
+ interface TokenObserver {
116
+ accessToken?(payload: Record<string, unknown>, invalid: InvalidTokenKind | undefined, token: string): void;
117
+ idToken?(payload: Record<string, unknown>, token: string): void;
118
+ anonymous?(): void;
119
+ }
120
+ declare class KindeTestkit {
121
+ private observers;
122
+ /** Calls the observer for every token signed from now on. Returns a function that stops it. */
123
+ observe(observer: TokenObserver): () => void;
124
+ private signAccess;
125
+ readonly issuer: string;
126
+ readonly audience: string[];
127
+ readonly clientId: string;
128
+ private readonly accessTokenExpiresIn;
129
+ private readonly idTokenExpiresIn;
130
+ private readonly clock;
131
+ private readonly signingKey;
132
+ private strangerKey;
133
+ static create(options?: KindeTestkitOptions): Promise<KindeTestkit>;
134
+ private constructor();
135
+ get jwksUri(): string;
136
+ get keyId(): string;
137
+ get accessTokenLifetime(): number;
138
+ verify(token: string): Promise<JWTPayload>;
139
+ jwks(): {
140
+ keys: JWK[];
141
+ };
142
+ token(options?: KindeTokenOptions): Promise<string>;
143
+ m2mToken(options?: M2MTokenOptions): Promise<string>;
144
+ tokenFor(scenario: Scenario, overrides?: ScenarioTokenOverrides): Promise<string | null>;
145
+ idTokenFor(scenario: Scenario, options?: IdTokenOptions): Promise<string | null>;
146
+ headersFor(scenario: Scenario, overrides?: ScenarioTokenOverrides): Promise<Record<string, string>>;
147
+ principalFor(scenario: Scenario): KindePrincipal | null;
148
+ signPayload(payload: Record<string, unknown>, invalid?: "bad-signature" | "unknown-key" | "unsigned"): Promise<string>;
149
+ private sign;
150
+ private stranger;
151
+ }
152
+ declare function principalFromClaims(claims: Record<string, unknown>): KindePrincipal;
153
+ declare function getDefaultTestkit(): Promise<KindeTestkit>;
154
+ declare function createKindeToken(options?: KindeTokenOptions): Promise<string>;
155
+
156
+ export { type AuthenticatedScenario as A, DEFAULT_AUTH_METHODS as D, INVALID_TOKEN_KINDS as I, type KindeOrganization as K, type M2MTokenOptions as M, type Scenario as S, type TokenObserver as T, type UnauthenticatedScenario as U, type KindeUser as a, type KindeMembership as b, type KindeRole as c, DEFAULT_CLIENT_ID as d, DEFAULT_ISSUER as e, DEFAULT_M2M_CLIENT_ID as f, DEFAULT_SCOPES as g, type Duration as h, type IdTokenOptions as i, type InvalidTokenKind as j, type KindeApplication as k, type KindePrincipal as l, KindeTestkit as m, type KindeTestkitOptions as n, type KindeTokenOptions as o, type ScenarioTokenOverrides as p, createKindeToken as q, getDefaultTestkit as r, principalFromClaims as s };
package/dist/vitest.d.ts CHANGED
@@ -1,8 +1,9 @@
1
- import { a as KindeTestkitHandle } from './handle-DxF0uwza.js';
2
- export { K as KindeTestAuth, k as kindeTest } from './handle-DxF0uwza.js';
3
- import { S as StartKindeTestkitOptions } from './server-Dghq0aLx.js';
4
- import './webhooks-DJyCsbdF.js';
1
+ import { a as KindeTestkitHandle } from './handle-Pjt9fSUq.js';
2
+ export { K as KindeTestAuth, k as kindeTest } from './handle-Pjt9fSUq.js';
3
+ import { S as StartKindeTestkitOptions } from './server-CuHAHsaN.js';
4
+ import './testkit-BvCAFsSj.js';
5
5
  import 'jose';
6
+ import './webhooks-CiK9_pVw.js';
6
7
 
7
8
  /** Starts a testkit for the test file. Use the handle inside tests and hooks. */
8
9
  declare function useKindeTestkit(options?: StartKindeTestkitOptions): KindeTestkitHandle;
package/dist/vitest.js CHANGED
@@ -1,8 +1,9 @@
1
1
  import {
2
2
  createKindeTestkitHandle,
3
3
  kindeTest
4
- } from "./chunk-K5YNZAOM.js";
5
- import "./chunk-IOP27RQ5.js";
4
+ } from "./chunk-YJPE5HAM.js";
5
+ import "./chunk-CY75AADD.js";
6
+ import "./chunk-BPPG4G52.js";
6
7
 
7
8
  // src/vitest.ts
8
9
  import { afterAll, beforeAll } from "vitest";
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/vitest.ts"],"sourcesContent":["import { afterAll, beforeAll } from \"vitest\";\nimport { createKindeTestkitHandle, type KindeTestkitHandle } from \"./handle.js\";\nimport type { StartKindeTestkitOptions } from \"./server.js\";\n\nexport { kindeTest, type KindeTestAuth, type KindeTestkitHandle } from \"./handle.js\";\n\n/** Starts a testkit for the test file. Use the handle inside tests and hooks. */\nexport function useKindeTestkit(options: StartKindeTestkitOptions = {}): KindeTestkitHandle {\n return createKindeTestkitHandle({ beforeAll, afterAll }, options, \"useKindeTestkit\");\n}\n"],"mappings":";;;;;;;AAAA,SAAS,UAAU,iBAAiB;AAO7B,SAAS,gBAAgB,UAAoC,CAAC,GAAuB;AAC1F,SAAO,yBAAyB,EAAE,WAAW,SAAS,GAAG,SAAS,iBAAiB;AACrF;","names":[]}
1
+ {"version":3,"sources":["../src/vitest.ts"],"sourcesContent":["import { afterAll, beforeAll } from \"vitest\";\nimport { createKindeTestkitHandle, type KindeTestkitHandle } from \"./handle.js\";\nimport type { StartKindeTestkitOptions } from \"./server.js\";\n\nexport { kindeTest, type KindeTestAuth, type KindeTestkitHandle } from \"./handle.js\";\n\n/** Starts a testkit for the test file. Use the handle inside tests and hooks. */\nexport function useKindeTestkit(options: StartKindeTestkitOptions = {}): KindeTestkitHandle {\n return createKindeTestkitHandle({ beforeAll, afterAll }, options, \"useKindeTestkit\");\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,UAAU,iBAAiB;AAO7B,SAAS,gBAAgB,UAAoC,CAAC,GAAuB;AAC1F,SAAO,yBAAyB,EAAE,WAAW,SAAS,GAAG,SAAS,iBAAiB;AACrF;","names":[]}
@@ -1,157 +1,4 @@
1
- import { JWTPayload, JWK } from 'jose';
2
-
3
- interface KindeUser {
4
- id: string;
5
- email: string | null;
6
- emailVerified: boolean;
7
- givenName: string | null;
8
- familyName: string | null;
9
- picture: string | null;
10
- claims: Record<string, unknown>;
11
- }
12
- interface KindeOrganization {
13
- code: string;
14
- name: string;
15
- metadata: Record<string, unknown>;
16
- }
17
- interface KindeRole {
18
- id: string;
19
- key: string;
20
- name: string;
21
- }
22
- interface KindeApplication {
23
- clientId: string;
24
- clientSecret: string | null;
25
- name: string;
26
- organizationCode: string | null;
27
- scopes: string[] | null;
28
- permissions: string[] | null;
29
- audience: string[] | null;
30
- }
31
- interface KindeMembership {
32
- userId: string;
33
- organizationCode: string;
34
- roles: string[];
35
- permissions: string[];
36
- }
37
- interface AuthenticatedScenario {
38
- kind: "authenticated";
39
- user: KindeUser;
40
- organization: KindeOrganization | null;
41
- roles: string[];
42
- permissions: string[];
43
- claims: Record<string, unknown>;
44
- }
45
- interface UnauthenticatedScenario {
46
- kind: "unauthenticated";
47
- }
48
- type Scenario = AuthenticatedScenario | UnauthenticatedScenario;
49
- interface KindePrincipal {
50
- type: "user" | "machine";
51
- subject: string;
52
- issuer: string;
53
- organization: {
54
- code: string;
55
- } | null;
56
- roles: string[];
57
- permissions: string[];
58
- claims: Record<string, unknown>;
59
- }
60
- type InvalidTokenKind = "expired" | "wrong-issuer" | "wrong-audience" | "missing-subject" | "missing-organization" | "missing-permissions" | "future-iat" | "bad-signature" | "unknown-key" | "unsigned";
61
- type Duration = number | `${number}${"s" | "m" | "h" | "d"}`;
62
- interface KindeTokenOptions {
63
- subject?: string;
64
- organizationCode?: string | null;
65
- permissions?: string[];
66
- roles?: Array<string | KindeRole>;
67
- scopes?: string[];
68
- featureFlags?: Record<string, {
69
- t: "b" | "s" | "i";
70
- v: boolean | string | number;
71
- }>;
72
- claims?: Record<string, unknown>;
73
- authMethods?: string[];
74
- authTime?: number;
75
- clientId?: string;
76
- audience?: string[];
77
- expiresIn?: Duration;
78
- invalid?: InvalidTokenKind;
79
- }
80
-
81
- declare const DEFAULT_ISSUER = "http://localhost:4400";
82
- declare const DEFAULT_CLIENT_ID = "kinde_testkit_client";
83
- declare const DEFAULT_M2M_CLIENT_ID = "kinde_testkit_m2m";
84
- declare const DEFAULT_SCOPES: string[];
85
- declare const DEFAULT_AUTH_METHODS: string[];
86
- declare const INVALID_TOKEN_KINDS: readonly InvalidTokenKind[];
87
- interface KindeTestkitOptions {
88
- issuer?: string;
89
- audience?: string | string[];
90
- clientId?: string;
91
- accessTokenExpiresIn?: Duration;
92
- idTokenExpiresIn?: Duration;
93
- now?: () => number;
94
- }
95
- type ScenarioTokenOverrides = Pick<KindeTokenOptions, "expiresIn" | "invalid" | "scopes" | "featureFlags" | "claims" | "authMethods" | "authTime" | "clientId" | "audience">;
96
- interface M2MTokenOptions {
97
- clientId?: string;
98
- organizationCode?: string | null;
99
- scopes?: string[];
100
- grantedScopes?: string[];
101
- audience?: string[];
102
- permissions?: string[];
103
- claims?: Record<string, unknown>;
104
- expiresIn?: Duration;
105
- invalid?: InvalidTokenKind;
106
- }
107
- interface IdTokenOptions {
108
- expiresIn?: Duration;
109
- authMethods?: string[];
110
- authTime?: number;
111
- clientId?: string;
112
- nonce?: string;
113
- }
114
- /** Receives every token the testkit signs, for coverage and the dashboard. */
115
- interface TokenObserver {
116
- accessToken?(payload: Record<string, unknown>, invalid: InvalidTokenKind | undefined, token: string): void;
117
- idToken?(payload: Record<string, unknown>, token: string): void;
118
- anonymous?(): void;
119
- }
120
- declare class KindeTestkit {
121
- private observers;
122
- /** Calls the observer for every token signed from now on. Returns a function that stops it. */
123
- observe(observer: TokenObserver): () => void;
124
- private signAccess;
125
- readonly issuer: string;
126
- readonly audience: string[];
127
- readonly clientId: string;
128
- private readonly accessTokenExpiresIn;
129
- private readonly idTokenExpiresIn;
130
- private readonly clock;
131
- private readonly signingKey;
132
- private strangerKey;
133
- static create(options?: KindeTestkitOptions): Promise<KindeTestkit>;
134
- private constructor();
135
- get jwksUri(): string;
136
- get keyId(): string;
137
- get accessTokenLifetime(): number;
138
- verify(token: string): Promise<JWTPayload>;
139
- jwks(): {
140
- keys: JWK[];
141
- };
142
- token(options?: KindeTokenOptions): Promise<string>;
143
- m2mToken(options?: M2MTokenOptions): Promise<string>;
144
- tokenFor(scenario: Scenario, overrides?: ScenarioTokenOverrides): Promise<string | null>;
145
- idTokenFor(scenario: Scenario, options?: IdTokenOptions): Promise<string | null>;
146
- headersFor(scenario: Scenario, overrides?: ScenarioTokenOverrides): Promise<Record<string, string>>;
147
- principalFor(scenario: Scenario): KindePrincipal | null;
148
- signPayload(payload: Record<string, unknown>, invalid?: "bad-signature" | "unknown-key" | "unsigned"): Promise<string>;
149
- private sign;
150
- private stranger;
151
- }
152
- declare function principalFromClaims(claims: Record<string, unknown>): KindePrincipal;
153
- declare function getDefaultTestkit(): Promise<KindeTestkit>;
154
- declare function createKindeToken(options?: KindeTokenOptions): Promise<string>;
1
+ import { a as KindeUser, K as KindeOrganization, b as KindeMembership, k as KindeApplication, A as AuthenticatedScenario, m as KindeTestkit } from './testkit-BvCAFsSj.js';
155
2
 
156
3
  interface TestkitSeed {
157
4
  issuer?: string;
@@ -284,6 +131,82 @@ declare function seedScenario(seed: ResolvedSeed, ref: {
284
131
  organization?: string | null;
285
132
  }): AuthenticatedScenario;
286
133
 
134
+ interface UserMeta {
135
+ providedId: string | null;
136
+ isSuspended: boolean;
137
+ isPasswordResetRequested: boolean;
138
+ createdOn: string;
139
+ totalSignIns: number;
140
+ lastSignedIn: string | null;
141
+ /** Last sign-in time per organization code. */
142
+ lastOrganizationSignIns: Record<string, string>;
143
+ }
144
+ /** An identity for authenticateAs(). */
145
+ interface Identity {
146
+ email: string;
147
+ givenName?: string | null;
148
+ familyName?: string | null;
149
+ /** The organization code. Created when it does not exist. */
150
+ organization?: string | null;
151
+ organizationName?: string;
152
+ roles?: string[];
153
+ permissions?: string[];
154
+ }
155
+ interface OrganizationMeta {
156
+ externalId: string | null;
157
+ handle: string;
158
+ createdOn: string;
159
+ isAllowRegistrations: boolean;
160
+ }
161
+ declare class Directory {
162
+ readonly seed: ResolvedSeed;
163
+ private readonly userMeta;
164
+ private readonly orgMeta;
165
+ private snapshot;
166
+ constructor(seed: ResolvedSeed);
167
+ restore(): void;
168
+ /** Replaces the whole seed with another resolved seed, and makes it the state reset() returns to. */
169
+ load(next: ResolvedSeed): void;
170
+ user(id: string): KindeUser | undefined;
171
+ meta(user: KindeUser): UserMeta;
172
+ isSuspended(userId: string): boolean;
173
+ recordSignIn(user: KindeUser, organizationCode: string | null): void;
174
+ createUser(input: {
175
+ email?: string | null;
176
+ givenName?: string | null;
177
+ familyName?: string | null;
178
+ picture?: string | null;
179
+ providedId?: string | null;
180
+ }): KindeUser;
181
+ deleteUser(id: string): boolean;
182
+ organization(code: string): KindeOrganization | undefined;
183
+ orgInfo(org: KindeOrganization): OrganizationMeta;
184
+ createOrganization(input: {
185
+ name: string;
186
+ externalId?: string | null;
187
+ handle?: string | null;
188
+ }): KindeOrganization;
189
+ deleteOrganization(code: string): boolean;
190
+ membership(userId: string, organizationCode: string): KindeMembership | undefined;
191
+ addMembership(userId: string, organizationCode: string, roles?: string[], permissions?: string[]): KindeMembership;
192
+ /**
193
+ * Makes sure a user exists with exactly these roles and permissions in the organization, creating
194
+ * the user, organization and membership when they are missing. Used by authenticateAs() in browser
195
+ * tests, so a test can sign in as any identity without adding it to the seed. reset() removes it.
196
+ */
197
+ ensureIdentity(input: Identity): {
198
+ user: KindeUser;
199
+ organization: KindeOrganization | null;
200
+ };
201
+ removeMembership(userId: string, organizationCode: string): boolean;
202
+ role(idOrKey: string): SeedRole | undefined;
203
+ permission(idOrKey: string): SeedPermission | undefined;
204
+ ensureRole(key: string, extra?: Partial<Omit<SeedRole, "id" | "key">>): SeedRole;
205
+ ensurePermission(key: string, extra?: Partial<Omit<SeedPermission, "id" | "key">>): SeedPermission;
206
+ deleteRole(id: string): SeedRole | undefined;
207
+ deletePermission(id: string): SeedPermission | undefined;
208
+ }
209
+
287
210
  interface FailureRule {
288
211
  path: string;
289
212
  method?: string;
@@ -292,7 +215,10 @@ interface FailureRule {
292
215
  hang?: boolean;
293
216
  times?: number;
294
217
  retryAfter?: number;
218
+ /** Answer with a body your client cannot use. The status is 200 unless you set one. */
219
+ malformed?: MalformedKind;
295
220
  }
221
+ type MalformedKind = "invalid-json" | "empty" | "html" | "unexpected-json";
296
222
  interface ActiveFailure {
297
223
  id: string;
298
224
  path: string;
@@ -302,6 +228,7 @@ interface ActiveFailure {
302
228
  hang: boolean;
303
229
  remaining: number | null;
304
230
  retryAfter: number;
231
+ malformed: MalformedKind | null;
305
232
  hits: number;
306
233
  }
307
234
  declare class FailureInjector {
@@ -394,4 +321,4 @@ declare class WebhookDispatcher {
394
321
  private requireUser;
395
322
  }
396
323
 
397
- export { type AuthenticatedScenario as A, BILLING_EVENT_TYPES as B, type WebhookOptions as C, DEFAULT_AUTH_METHODS as D, type WebhookSource as E, FailureInjector as F, createKindeToken as G, getDefaultTestkit as H, INVALID_TOKEN_KINDS as I, principalFromClaims as J, type KindeOrganization as K, resolveSeed as L, type M2MTokenOptions as M, seedScenario as N, type SeedRole as O, type SeedPermission as P, type ResolvedSeed as R, type Scenario as S, type TestkitSeed as T, type UnauthenticatedScenario as U, WEBHOOK_EVENT_TYPES as W, type KindeUser as a, type KindeMembership as b, type KindeRole as c, type ActiveFailure as d, DEFAULT_CLIENT_ID as e, DEFAULT_ISSUER as f, DEFAULT_M2M_CLIENT_ID as g, DEFAULT_SCOPES as h, type Duration as i, type FailureRule as j, type IdTokenOptions as k, type InvalidTokenKind as l, type KindeApplication as m, type KindePrincipal as n, KindeTestkit as o, type KindeTestkitOptions as p, type KindeTokenOptions as q, type ScenarioTokenOverrides as r, type SendWebhookOptions as s, type TokenObserver as t, type WebhookAttempt as u, type WebhookDelivery as v, WebhookDispatcher as w, type WebhookEndpoint as x, type WebhookEndpointInput as y, type WebhookInvalidKind as z };
324
+ export { type ActiveFailure as A, BILLING_EVENT_TYPES as B, Directory as D, FailureInjector as F, type Identity as I, type ResolvedSeed as R, type SendWebhookOptions as S, type TestkitSeed as T, WEBHOOK_EVENT_TYPES as W, type FailureRule as a, type WebhookAttempt as b, type WebhookDelivery as c, WebhookDispatcher as d, type WebhookEndpoint as e, type WebhookEndpointInput as f, type WebhookInvalidKind as g, type WebhookOptions as h, type WebhookSource as i, resolveSeed as r, seedScenario as s };