@robelest/convex-auth 0.0.2 → 0.0.3-preview.1
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.
- package/dist/bin.cjs +1 -1
- package/dist/client/index.d.ts +33 -9
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +79 -13
- package/dist/client/index.js.map +1 -1
- package/dist/component/_generated/component.d.ts +48 -0
- package/dist/component/_generated/component.d.ts.map +1 -1
- package/dist/component/index.d.ts +10 -4
- package/dist/component/index.d.ts.map +1 -1
- package/dist/component/index.js +8 -3
- package/dist/component/index.js.map +1 -1
- package/dist/component/public.d.ts +163 -3
- package/dist/component/public.d.ts.map +1 -1
- package/dist/component/public.js +124 -0
- package/dist/component/public.js.map +1 -1
- package/dist/component/schema.d.ts +81 -2
- package/dist/component/schema.d.ts.map +1 -1
- package/dist/component/schema.js +45 -0
- package/dist/component/schema.js.map +1 -1
- package/dist/providers/anonymous.d.ts +3 -0
- package/dist/providers/anonymous.d.ts.map +1 -1
- package/dist/providers/anonymous.js +3 -0
- package/dist/providers/anonymous.js.map +1 -1
- package/dist/providers/credentials.d.ts +3 -0
- package/dist/providers/credentials.d.ts.map +1 -1
- package/dist/providers/credentials.js +3 -0
- package/dist/providers/credentials.js.map +1 -1
- package/dist/providers/email.d.ts +3 -0
- package/dist/providers/email.d.ts.map +1 -1
- package/dist/providers/email.js +3 -0
- package/dist/providers/email.js.map +1 -1
- package/dist/providers/passkey.d.ts +7 -1
- package/dist/providers/passkey.d.ts.map +1 -1
- package/dist/providers/passkey.js +7 -1
- package/dist/providers/passkey.js.map +1 -1
- package/dist/providers/password.d.ts +3 -0
- package/dist/providers/password.d.ts.map +1 -1
- package/dist/providers/password.js +3 -0
- package/dist/providers/password.js.map +1 -1
- package/dist/providers/phone.d.ts +3 -0
- package/dist/providers/phone.d.ts.map +1 -1
- package/dist/providers/phone.js +3 -0
- package/dist/providers/phone.js.map +1 -1
- package/dist/providers/totp.d.ts +8 -0
- package/dist/providers/totp.d.ts.map +1 -1
- package/dist/providers/totp.js +8 -0
- package/dist/providers/totp.js.map +1 -1
- package/dist/server/convex-auth.d.ts +185 -25
- package/dist/server/convex-auth.d.ts.map +1 -1
- package/dist/server/convex-auth.js +317 -58
- package/dist/server/convex-auth.js.map +1 -1
- package/dist/server/email-templates.d.ts +18 -0
- package/dist/server/email-templates.d.ts.map +1 -0
- package/dist/server/email-templates.js +74 -0
- package/dist/server/email-templates.js.map +1 -0
- package/dist/server/errors.d.ts +146 -0
- package/dist/server/errors.d.ts.map +1 -0
- package/dist/server/errors.js +176 -0
- package/dist/server/errors.js.map +1 -0
- package/dist/server/implementation/apiKey.d.ts +74 -0
- package/dist/server/implementation/apiKey.d.ts.map +1 -0
- package/dist/server/implementation/apiKey.js +139 -0
- package/dist/server/implementation/apiKey.js.map +1 -0
- package/dist/server/implementation/index.d.ts +151 -14
- package/dist/server/implementation/index.d.ts.map +1 -1
- package/dist/server/implementation/index.js +216 -24
- package/dist/server/implementation/index.js.map +1 -1
- package/dist/server/implementation/mutations/createAccountFromCredentials.d.ts.map +1 -1
- package/dist/server/implementation/mutations/createAccountFromCredentials.js +2 -1
- package/dist/server/implementation/mutations/createAccountFromCredentials.js.map +1 -1
- package/dist/server/implementation/mutations/createVerificationCode.d.ts +2 -2
- package/dist/server/implementation/mutations/index.d.ts +6 -6
- package/dist/server/implementation/mutations/modifyAccount.d.ts.map +1 -1
- package/dist/server/implementation/mutations/modifyAccount.js +2 -1
- package/dist/server/implementation/mutations/modifyAccount.js.map +1 -1
- package/dist/server/implementation/mutations/userOAuth.d.ts.map +1 -1
- package/dist/server/implementation/mutations/userOAuth.js +2 -1
- package/dist/server/implementation/mutations/userOAuth.js.map +1 -1
- package/dist/server/implementation/mutations/verifierSignature.d.ts.map +1 -1
- package/dist/server/implementation/mutations/verifierSignature.js +2 -1
- package/dist/server/implementation/mutations/verifierSignature.js.map +1 -1
- package/dist/server/implementation/passkey.d.ts.map +1 -1
- package/dist/server/implementation/passkey.js +28 -29
- package/dist/server/implementation/passkey.js.map +1 -1
- package/dist/server/implementation/provider.d.ts.map +1 -1
- package/dist/server/implementation/provider.js +5 -4
- package/dist/server/implementation/provider.js.map +1 -1
- package/dist/server/implementation/redirects.d.ts.map +1 -1
- package/dist/server/implementation/redirects.js +2 -1
- package/dist/server/implementation/redirects.js.map +1 -1
- package/dist/server/implementation/refreshTokens.d.ts.map +1 -1
- package/dist/server/implementation/refreshTokens.js +2 -1
- package/dist/server/implementation/refreshTokens.js.map +1 -1
- package/dist/server/implementation/signIn.d.ts.map +1 -1
- package/dist/server/implementation/signIn.js +8 -18
- package/dist/server/implementation/signIn.js.map +1 -1
- package/dist/server/implementation/totp.d.ts.map +1 -1
- package/dist/server/implementation/totp.js +16 -17
- package/dist/server/implementation/totp.js.map +1 -1
- package/dist/server/implementation/users.d.ts.map +1 -1
- package/dist/server/implementation/users.js +3 -2
- package/dist/server/implementation/users.js.map +1 -1
- package/dist/server/index.d.ts +157 -3
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +180 -17
- package/dist/server/index.js.map +1 -1
- package/dist/server/oauth/authorizationUrl.d.ts.map +1 -1
- package/dist/server/oauth/authorizationUrl.js +2 -1
- package/dist/server/oauth/authorizationUrl.js.map +1 -1
- package/dist/server/oauth/callback.d.ts.map +1 -1
- package/dist/server/oauth/callback.js +5 -4
- package/dist/server/oauth/callback.js.map +1 -1
- package/dist/server/oauth/checks.d.ts.map +1 -1
- package/dist/server/oauth/checks.js +2 -1
- package/dist/server/oauth/checks.js.map +1 -1
- package/dist/server/oauth/convexAuth.d.ts.map +1 -1
- package/dist/server/oauth/convexAuth.js +3 -2
- package/dist/server/oauth/convexAuth.js.map +1 -1
- package/dist/server/provider_utils.d.ts +2 -0
- package/dist/server/provider_utils.d.ts.map +1 -1
- package/dist/server/types.d.ts +240 -5
- package/dist/server/types.d.ts.map +1 -1
- package/dist/server/utils.d.ts.map +1 -1
- package/dist/server/utils.js +2 -1
- package/dist/server/utils.js.map +1 -1
- package/dist/server/version.d.ts +2 -0
- package/dist/server/version.d.ts.map +1 -0
- package/dist/server/version.js +3 -0
- package/dist/server/version.js.map +1 -0
- package/package.json +7 -2
- package/src/cli/index.ts +1 -1
- package/src/cli/utils.ts +248 -0
- package/src/client/index.ts +105 -15
- package/src/component/_generated/component.ts +61 -0
- package/src/component/index.ts +11 -2
- package/src/component/public.ts +142 -0
- package/src/component/schema.ts +52 -0
- package/src/providers/anonymous.ts +3 -0
- package/src/providers/credentials.ts +3 -0
- package/src/providers/email.ts +3 -0
- package/src/providers/passkey.ts +8 -1
- package/src/providers/password.ts +3 -0
- package/src/providers/phone.ts +3 -0
- package/src/providers/totp.ts +9 -0
- package/src/server/convex-auth.ts +385 -73
- package/src/server/email-templates.ts +77 -0
- package/src/server/errors.ts +269 -0
- package/src/server/implementation/apiKey.ts +186 -0
- package/src/server/implementation/index.ts +288 -28
- package/src/server/implementation/mutations/createAccountFromCredentials.ts +2 -1
- package/src/server/implementation/mutations/modifyAccount.ts +2 -3
- package/src/server/implementation/mutations/userOAuth.ts +2 -1
- package/src/server/implementation/mutations/verifierSignature.ts +2 -1
- package/src/server/implementation/passkey.ts +33 -35
- package/src/server/implementation/provider.ts +5 -8
- package/src/server/implementation/redirects.ts +2 -3
- package/src/server/implementation/refreshTokens.ts +2 -1
- package/src/server/implementation/signIn.ts +9 -18
- package/src/server/implementation/totp.ts +18 -21
- package/src/server/implementation/users.ts +4 -7
- package/src/server/index.ts +240 -37
- package/src/server/oauth/authorizationUrl.ts +2 -1
- package/src/server/oauth/callback.ts +5 -4
- package/src/server/oauth/checks.ts +3 -1
- package/src/server/oauth/convexAuth.ts +6 -3
- package/src/server/types.ts +254 -5
- package/src/server/utils.ts +3 -1
- package/src/server/version.ts +2 -0
- package/dist/server/portal.d.ts +0 -116
- package/dist/server/portal.d.ts.map +0 -1
- package/dist/server/portal.js +0 -294
- package/dist/server/portal.js.map +0 -1
- package/src/server/portal.ts +0 -375
package/dist/server/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Provider as AuthjsProviderConfig, CredentialsConfig, EmailConfig as AuthjsEmailConfig, OAuth2Config, OIDCConfig } from "@auth/core/providers";
|
|
2
|
-
import { Theme } from "@auth/core/types";
|
|
2
|
+
import { Awaitable, Theme } from "@auth/core/types";
|
|
3
3
|
import { AnyDataModel, FunctionReference, GenericActionCtx, GenericDataModel, GenericMutationCtx } from "convex/server";
|
|
4
4
|
import { GenericId, Value } from "convex/values";
|
|
5
5
|
import { CredentialsUserConfig } from "../providers/credentials.js";
|
|
@@ -69,6 +69,67 @@ export type ConvexAuthConfig = {
|
|
|
69
69
|
*/
|
|
70
70
|
maxFailedAttempsPerHour?: number;
|
|
71
71
|
};
|
|
72
|
+
/**
|
|
73
|
+
* API key configuration for programmatic access.
|
|
74
|
+
*
|
|
75
|
+
* Enables `auth.key.*` helpers for creating, verifying, and managing
|
|
76
|
+
* API keys with scoped permissions and optional per-key rate limiting.
|
|
77
|
+
*/
|
|
78
|
+
apiKeys?: ApiKeyConfig;
|
|
79
|
+
/**
|
|
80
|
+
* Email transport configuration.
|
|
81
|
+
*
|
|
82
|
+
* Required for magic link authentication and the admin portal.
|
|
83
|
+
* The library generates email content (subject, styled HTML); you
|
|
84
|
+
* provide the delivery mechanism — Resend, SendGrid, SES, Postmark,
|
|
85
|
+
* or any other provider.
|
|
86
|
+
*
|
|
87
|
+
* When configured, a magic link email provider (`id: "email"`) is
|
|
88
|
+
* auto-registered — no need to add a separate Auth.js email provider
|
|
89
|
+
* to `providers`.
|
|
90
|
+
*
|
|
91
|
+
* Works seamlessly with the `@convex-dev/resend` Convex component:
|
|
92
|
+
*
|
|
93
|
+
* ```ts
|
|
94
|
+
* import { Resend } from "@convex-dev/resend";
|
|
95
|
+
*
|
|
96
|
+
* const resend = new Resend(components.resend, { testMode: false });
|
|
97
|
+
*
|
|
98
|
+
* const auth = new Auth(components.auth, {
|
|
99
|
+
* providers: [google],
|
|
100
|
+
* email: {
|
|
101
|
+
* from: "My App <noreply@example.com>",
|
|
102
|
+
* send: (ctx, params) => resend.sendEmail(ctx, params),
|
|
103
|
+
* },
|
|
104
|
+
* });
|
|
105
|
+
* ```
|
|
106
|
+
*
|
|
107
|
+
* Or with any email API directly:
|
|
108
|
+
*
|
|
109
|
+
* ```ts
|
|
110
|
+
* email: {
|
|
111
|
+
* from: "My App <noreply@example.com>",
|
|
112
|
+
* send: async (_ctx, { from, to, subject, html }) => {
|
|
113
|
+
* await fetch("https://api.resend.com/emails", {
|
|
114
|
+
* method: "POST",
|
|
115
|
+
* headers: {
|
|
116
|
+
* Authorization: `Bearer ${process.env.AUTH_RESEND_KEY}`,
|
|
117
|
+
* "Content-Type": "application/json",
|
|
118
|
+
* },
|
|
119
|
+
* body: JSON.stringify({ from, to, subject, html }),
|
|
120
|
+
* });
|
|
121
|
+
* },
|
|
122
|
+
* },
|
|
123
|
+
* ```
|
|
124
|
+
*/
|
|
125
|
+
email?: EmailTransport;
|
|
126
|
+
/**
|
|
127
|
+
* Lifecycle callbacks for customizing sign-in behavior.
|
|
128
|
+
*
|
|
129
|
+
* Use `redirect` to control post-OAuth redirect URLs, and
|
|
130
|
+
* `createOrUpdateUser` or `afterUserCreatedOrUpdated` to
|
|
131
|
+
* customize account linking and user document creation.
|
|
132
|
+
*/
|
|
72
133
|
callbacks?: {
|
|
73
134
|
/**
|
|
74
135
|
* Control which URLs are allowed as a destination after OAuth sign-in
|
|
@@ -213,9 +274,11 @@ export type ConvexAuthConfig = {
|
|
|
213
274
|
};
|
|
214
275
|
};
|
|
215
276
|
/**
|
|
216
|
-
*
|
|
217
|
-
*
|
|
218
|
-
*
|
|
277
|
+
* Union of all supported auth provider config types.
|
|
278
|
+
*
|
|
279
|
+
* Includes Auth.js OAuth/OIDC providers, plus library-native providers:
|
|
280
|
+
* credentials, email, phone, passkey (WebAuthn), and TOTP (2FA).
|
|
281
|
+
* Each can be passed as a config object or a factory function.
|
|
219
282
|
*/
|
|
220
283
|
export type AuthProviderConfig = Exclude<AuthjsProviderConfig, CredentialsConfig | ((...args: any) => CredentialsConfig)> | ConvexCredentialsConfig | ((...args: any) => ConvexCredentialsConfig) | PhoneConfig | ((...args: any) => PhoneConfig) | PasskeyProviderConfig | ((...args: any) => PasskeyProviderConfig) | TotpProviderConfig | ((...args: any) => TotpProviderConfig);
|
|
221
284
|
/**
|
|
@@ -223,11 +286,27 @@ export type AuthProviderConfig = Exclude<AuthjsProviderConfig, CredentialsConfig
|
|
|
223
286
|
* to allow additional checks during token verification.
|
|
224
287
|
*/
|
|
225
288
|
export interface EmailConfig<DataModel extends GenericDataModel = GenericDataModel> extends AuthjsEmailConfig {
|
|
289
|
+
/**
|
|
290
|
+
* Send the verification token to the user.
|
|
291
|
+
*
|
|
292
|
+
* Overrides the Auth.js 1-arg signature to accept an optional
|
|
293
|
+
* Convex action context as the second argument. Library-native
|
|
294
|
+
* email providers use `ctx` to call `email.send(ctx, params)`.
|
|
295
|
+
*/
|
|
296
|
+
sendVerificationRequest: (params: {
|
|
297
|
+
identifier: string;
|
|
298
|
+
url: string;
|
|
299
|
+
expires: Date;
|
|
300
|
+
provider: AuthjsEmailConfig;
|
|
301
|
+
token: string;
|
|
302
|
+
theme: Theme;
|
|
303
|
+
request: Request;
|
|
304
|
+
}, ctx?: GenericActionCtx<AnyDataModel>) => Awaitable<void>;
|
|
226
305
|
/**
|
|
227
306
|
* Before the token is verified, check other
|
|
228
307
|
* provided parameters.
|
|
229
308
|
*
|
|
230
|
-
* Used to make sure
|
|
309
|
+
* Used to make sure that OTPs are accompanied
|
|
231
310
|
* with the correct email address.
|
|
232
311
|
*/
|
|
233
312
|
authorize?: (
|
|
@@ -347,10 +426,14 @@ export interface TotpProviderConfig {
|
|
|
347
426
|
period: number;
|
|
348
427
|
};
|
|
349
428
|
}
|
|
429
|
+
/** Credentials identifying a provider account (e.g. email + hashed password). */
|
|
350
430
|
export type AuthAccountCredentials = {
|
|
431
|
+
/** Provider-specific account identifier (e.g. email address). */
|
|
351
432
|
id: string;
|
|
433
|
+
/** Optional secret (e.g. hashed password). */
|
|
352
434
|
secret?: string;
|
|
353
435
|
};
|
|
436
|
+
/** Arguments for `auth.account.create()`. */
|
|
354
437
|
export type AuthCreateAccountArgs = {
|
|
355
438
|
provider: string;
|
|
356
439
|
account: AuthAccountCredentials;
|
|
@@ -363,10 +446,12 @@ export type AuthCreateAccountArgs = {
|
|
|
363
446
|
shouldLinkViaEmail?: boolean;
|
|
364
447
|
shouldLinkViaPhone?: boolean;
|
|
365
448
|
};
|
|
449
|
+
/** Arguments for `auth.account.get()`. */
|
|
366
450
|
export type AuthRetrieveAccountArgs = {
|
|
367
451
|
provider: string;
|
|
368
452
|
account: AuthAccountCredentials;
|
|
369
453
|
};
|
|
454
|
+
/** Arguments for `auth.account.updateCredentials()`. */
|
|
370
455
|
export type AuthUpdateAccountCredentialsArgs = {
|
|
371
456
|
provider: string;
|
|
372
457
|
account: {
|
|
@@ -374,18 +459,22 @@ export type AuthUpdateAccountCredentialsArgs = {
|
|
|
374
459
|
secret: string;
|
|
375
460
|
};
|
|
376
461
|
};
|
|
462
|
+
/** Arguments for `auth.session.invalidate()`. */
|
|
377
463
|
export type AuthInvalidateSessionsArgs = {
|
|
378
464
|
userId: GenericId<"user">;
|
|
379
465
|
except?: GenericId<"session">[];
|
|
380
466
|
};
|
|
467
|
+
/** Arguments for `auth.provider.signIn()`. */
|
|
381
468
|
export type AuthProviderSignInArgs = {
|
|
382
469
|
accountId?: GenericId<"account">;
|
|
383
470
|
params?: Record<string, Value | undefined>;
|
|
384
471
|
};
|
|
472
|
+
/** Return type of `auth.provider.signIn()` — user and session IDs, or `null` on failure. */
|
|
385
473
|
export type AuthProviderSignInResult = {
|
|
386
474
|
userId: GenericId<"user">;
|
|
387
475
|
sessionId: GenericId<"session">;
|
|
388
476
|
} | null;
|
|
477
|
+
/** Server-side auth helpers available on enriched action contexts. */
|
|
389
478
|
export type AuthServerHelpers = {
|
|
390
479
|
account: {
|
|
391
480
|
create: (ctx: GenericActionCtx<any>, args: AuthCreateAccountArgs) => Promise<{
|
|
@@ -431,8 +520,147 @@ export type ConvexAuthMaterializedConfig = {
|
|
|
431
520
|
* Materialized Auth.js provider config.
|
|
432
521
|
*/
|
|
433
522
|
export type AuthProviderMaterializedConfig = OIDCConfig<any> | OAuth2Config<any> | EmailConfig | PhoneConfig | ConvexCredentialsConfig | PasskeyProviderConfig | TotpProviderConfig;
|
|
523
|
+
/**
|
|
524
|
+
* Email delivery parameters passed to `EmailTransport.send`.
|
|
525
|
+
*/
|
|
526
|
+
export interface EmailMessage {
|
|
527
|
+
/** Sender address (from `email.from` in your Auth config). */
|
|
528
|
+
from: string;
|
|
529
|
+
/** Recipient email address. */
|
|
530
|
+
to: string;
|
|
531
|
+
/** Email subject line. */
|
|
532
|
+
subject: string;
|
|
533
|
+
/** HTML body content. */
|
|
534
|
+
html: string;
|
|
535
|
+
}
|
|
536
|
+
/**
|
|
537
|
+
* Email transport configuration for the Auth library.
|
|
538
|
+
*
|
|
539
|
+
* Provides a delivery mechanism for library-generated emails
|
|
540
|
+
* (magic links, portal admin sign-in). The library owns the
|
|
541
|
+
* email content; you provide the transport.
|
|
542
|
+
*/
|
|
543
|
+
export interface EmailTransport {
|
|
544
|
+
/** Sender address shown in the From field (e.g. "My App \<noreply@example.com\>"). */
|
|
545
|
+
from: string;
|
|
546
|
+
/**
|
|
547
|
+
* Deliver an email. Called by the library for magic links and portal emails.
|
|
548
|
+
*
|
|
549
|
+
* Receives the Convex action context as the first argument, enabling
|
|
550
|
+
* use with Convex components like `@convex-dev/resend`:
|
|
551
|
+
*
|
|
552
|
+
* ```ts
|
|
553
|
+
* send: (ctx, params) => resend.sendEmail(ctx, params)
|
|
554
|
+
* ```
|
|
555
|
+
*
|
|
556
|
+
* For plain HTTP email APIs, ignore the `ctx` parameter:
|
|
557
|
+
*
|
|
558
|
+
* ```ts
|
|
559
|
+
* send: async (_ctx, { from, to, subject, html }) => {
|
|
560
|
+
* await fetch("https://api.resend.com/emails", { ... });
|
|
561
|
+
* }
|
|
562
|
+
* ```
|
|
563
|
+
*/
|
|
564
|
+
send: (ctx: GenericActionCtx<any>, params: EmailMessage) => Promise<void>;
|
|
565
|
+
}
|
|
566
|
+
/**
|
|
567
|
+
* A single scope entry stored per API key.
|
|
568
|
+
* Uses a resource:action pattern for structured permissions.
|
|
569
|
+
*
|
|
570
|
+
* ```ts
|
|
571
|
+
* { resource: "users", actions: ["read", "list"] }
|
|
572
|
+
* ```
|
|
573
|
+
*/
|
|
574
|
+
export interface KeyScope {
|
|
575
|
+
resource: string;
|
|
576
|
+
actions: string[];
|
|
577
|
+
}
|
|
578
|
+
/**
|
|
579
|
+
* Result of scope verification. Provides a `.can()` helper
|
|
580
|
+
* for checking if a key has a specific permission.
|
|
581
|
+
*
|
|
582
|
+
* ```ts
|
|
583
|
+
* const result = await auth.key.verify(ctx, rawKey);
|
|
584
|
+
* if (result.scopes.can("users", "read")) {
|
|
585
|
+
* // authorized
|
|
586
|
+
* }
|
|
587
|
+
* ```
|
|
588
|
+
*/
|
|
589
|
+
export interface ScopeChecker {
|
|
590
|
+
/** Check if the key has permission for a given resource:action. */
|
|
591
|
+
can(resource: string, action: string): boolean;
|
|
592
|
+
/** The raw scope entries from the key. */
|
|
593
|
+
scopes: KeyScope[];
|
|
594
|
+
}
|
|
595
|
+
/**
|
|
596
|
+
* Configuration for API key support on the Auth class.
|
|
597
|
+
*
|
|
598
|
+
* ```ts
|
|
599
|
+
* const auth = new Auth(components.auth, {
|
|
600
|
+
* providers: [github],
|
|
601
|
+
* apiKeys: {
|
|
602
|
+
* scopes: {
|
|
603
|
+
* users: ["read", "list", "create", "delete"],
|
|
604
|
+
* messages: ["read", "write"],
|
|
605
|
+
* },
|
|
606
|
+
* defaultRateLimit: { maxRequests: 1000, windowMs: 3600000 },
|
|
607
|
+
* },
|
|
608
|
+
* });
|
|
609
|
+
* ```
|
|
610
|
+
*/
|
|
611
|
+
export interface ApiKeyConfig {
|
|
612
|
+
/**
|
|
613
|
+
* Define the available resource:action scopes for your API keys.
|
|
614
|
+
* Keys can only be created with scopes that are a subset of these.
|
|
615
|
+
*/
|
|
616
|
+
scopes?: Record<string, string[]>;
|
|
617
|
+
/**
|
|
618
|
+
* Default rate limit applied to new keys when not specified per-key.
|
|
619
|
+
* Uses a token-bucket algorithm.
|
|
620
|
+
*/
|
|
621
|
+
defaultRateLimit?: {
|
|
622
|
+
maxRequests: number;
|
|
623
|
+
windowMs: number;
|
|
624
|
+
};
|
|
625
|
+
/**
|
|
626
|
+
* Key prefix. Defaults to `"sk_live_"`.
|
|
627
|
+
*/
|
|
628
|
+
prefix?: string;
|
|
629
|
+
}
|
|
630
|
+
/**
|
|
631
|
+
* An API key record as returned by `auth.key.list()` and `auth.key.get()`.
|
|
632
|
+
* Never includes the raw key material — only the display prefix.
|
|
633
|
+
*/
|
|
634
|
+
export interface KeyRecord {
|
|
635
|
+
/** Document ID. */
|
|
636
|
+
_id: string;
|
|
637
|
+
/** Owner user ID. */
|
|
638
|
+
userId: string;
|
|
639
|
+
/** Display prefix (e.g. `"sk_live_abc1"`). Safe to show in UIs. */
|
|
640
|
+
prefix: string;
|
|
641
|
+
/** Human-readable name (e.g. "CI Pipeline"). */
|
|
642
|
+
name: string;
|
|
643
|
+
/** Resource:action permissions granted to this key. */
|
|
644
|
+
scopes: KeyScope[];
|
|
645
|
+
/** Per-key rate limit, if configured. */
|
|
646
|
+
rateLimit?: {
|
|
647
|
+
maxRequests: number;
|
|
648
|
+
windowMs: number;
|
|
649
|
+
};
|
|
650
|
+
/** Expiration timestamp (ms since epoch), or `undefined` for no expiry. */
|
|
651
|
+
expiresAt?: number;
|
|
652
|
+
/** Timestamp of last successful verification, or `undefined` if never used. */
|
|
653
|
+
lastUsedAt?: number;
|
|
654
|
+
/** Creation timestamp (ms since epoch). */
|
|
655
|
+
createdAt: number;
|
|
656
|
+
/** `true` when the key has been revoked (soft-deleted). */
|
|
657
|
+
revoked: boolean;
|
|
658
|
+
}
|
|
434
659
|
/**
|
|
435
660
|
* Component function references required by core auth runtime.
|
|
661
|
+
*
|
|
662
|
+
* @internal Consumers should not depend on this shape — it may change
|
|
663
|
+
* between minor versions. Pass `components.auth` directly to the `Auth` constructor.
|
|
436
664
|
*/
|
|
437
665
|
export type AuthComponentApi = {
|
|
438
666
|
public: {
|
|
@@ -489,6 +717,13 @@ export type AuthComponentApi = {
|
|
|
489
717
|
inviteList: FunctionReference<"query", "internal">;
|
|
490
718
|
inviteAccept: FunctionReference<"mutation", "internal">;
|
|
491
719
|
inviteRevoke: FunctionReference<"mutation", "internal">;
|
|
720
|
+
keyInsert: FunctionReference<"mutation", "internal">;
|
|
721
|
+
keyGetByHashedKey: FunctionReference<"query", "internal">;
|
|
722
|
+
keyGetById: FunctionReference<"query", "internal">;
|
|
723
|
+
keyList: FunctionReference<"query", "internal">;
|
|
724
|
+
keyListByUserId: FunctionReference<"query", "internal">;
|
|
725
|
+
keyPatch: FunctionReference<"mutation", "internal">;
|
|
726
|
+
keyDelete: FunctionReference<"mutation", "internal">;
|
|
492
727
|
passkeyInsert: FunctionReference<"mutation", "internal">;
|
|
493
728
|
passkeyGetByCredentialId: FunctionReference<"query", "internal">;
|
|
494
729
|
passkeyListByUserId: FunctionReference<"query", "internal">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/server/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,IAAI,oBAAoB,EAChC,iBAAiB,EACjB,WAAW,IAAI,iBAAiB,EAChC,YAAY,EACZ,UAAU,EACX,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,SAAS,E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BAAwB,EAAE,iBAAiB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;QACjE,mBAAmB,EAAE,iBAAiB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;QAC5D,oBAAoB,EAAE,iBAAiB,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;QAChE,iBAAiB,EAAE,iBAAiB,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;QAC7D,aAAa,EAAE,iBAAiB,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;QACzD,UAAU,EAAE,iBAAiB,CAAC,UAAU,EAAE,UAAU,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QAChE,uBAAuB,EAAE,iBAAiB,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QAC1E,gBAAgB,EAAE,iBAAiB,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QACnE,WAAW,EAAE,iBAAiB,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QAC9D,gBAAgB,EAAE,iBAAiB,CAAC,UAAU,EAAE,UAAU,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QACtE,kBAAkB,EAAE,iBAAiB,CAAC,UAAU,EAAE,UAAU,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QACxE,UAAU,EAAE,iBAAiB,CAAC,UAAU,EAAE,UAAU,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;KACjE,CAAC;CACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/server/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/server/utils.ts"],"names":[],"mappings":"AAEA,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,UAMtC;AAED,wBAAgB,WAAW,CAAC,IAAI,CAAC,EAAE,MAAM,WAGxC"}
|
package/dist/server/utils.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { throwAuthError } from "./errors.js";
|
|
1
2
|
export function requireEnv(name) {
|
|
2
3
|
const value = process.env[name];
|
|
3
4
|
if (value === undefined) {
|
|
4
|
-
|
|
5
|
+
throwAuthError("MISSING_ENV_VAR", `Missing environment variable \`${name}\``, { variable: name });
|
|
5
6
|
}
|
|
6
7
|
return value;
|
|
7
8
|
}
|
package/dist/server/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/server/utils.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAChC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/server/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAChC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,cAAc,CAAC,iBAAiB,EAAE,kCAAkC,IAAI,IAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IACpG,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,IAAa;IACvC,OAAO,8BAA8B,CAAC,IAAI,CAC1C,IAAI,IAAI,EAAE,CAAC,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/server/version.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,YAAY,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/server/version.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,MAAM,CAAC,MAAM,YAAY,GAAG,iBAAiB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@robelest/convex-auth",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3-preview.1",
|
|
4
4
|
"description": "Authentication for Convex",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"authentication",
|
|
@@ -23,11 +23,12 @@
|
|
|
23
23
|
"bin": "./dist/bin.cjs",
|
|
24
24
|
"sideEffects": false,
|
|
25
25
|
"scripts": {
|
|
26
|
+
"build:version": "node ../../scripts/generate-version.js",
|
|
26
27
|
"build:bin": "esbuild src/cli/index.ts --bundle --platform=node --format=cjs --outfile=dist/bin.cjs",
|
|
27
28
|
"build:server": "tsc --project tsconfig.server.json",
|
|
28
29
|
"build:client": "tsc --project tsconfig.client.json",
|
|
29
30
|
"build:component": "tsc --project tsconfig.component.json",
|
|
30
|
-
"build": "rm -rf dist && bun run build:bin && bun run build:server && bun run build:client && bun run build:component",
|
|
31
|
+
"build": "rm -rf dist && bun run build:version && bun run build:bin && bun run build:server && bun run build:client && bun run build:component",
|
|
31
32
|
"docs": "bun run --cwd ../../docs dev",
|
|
32
33
|
"lint": "tsc --project tsconfig.server.json --noEmit && tsc --project tsconfig.client.json --noEmit && tsc --project tsconfig.component.json --noEmit && bun run --cwd ../.. lint",
|
|
33
34
|
"spellcheck": "cspell \"docs/pages/**/*.md*\"",
|
|
@@ -66,6 +67,10 @@
|
|
|
66
67
|
"types": "./dist/component/convex.config.d.ts",
|
|
67
68
|
"default": "./dist/component/convex.config.js"
|
|
68
69
|
},
|
|
70
|
+
"./errors": {
|
|
71
|
+
"types": "./dist/server/errors.d.ts",
|
|
72
|
+
"import": "./dist/server/errors.js"
|
|
73
|
+
},
|
|
69
74
|
"./providers/*": {
|
|
70
75
|
"types": "./dist/providers/*.d.ts",
|
|
71
76
|
"import": "./dist/providers/*.js"
|
package/src/cli/index.ts
CHANGED
|
@@ -437,7 +437,7 @@ async function configureConvexConfig(config: ProjectConfig) {
|
|
|
437
437
|
logStep(config, "Configure convex config file");
|
|
438
438
|
const sourceTemplate = `\
|
|
439
439
|
import { defineApp } from "convex/server";
|
|
440
|
-
import auth from "@robelest/convex-auth/
|
|
440
|
+
import auth from "@robelest/convex-auth/convex.config";
|
|
441
441
|
|
|
442
442
|
const app = defineApp();
|
|
443
443
|
|