@absolutejs/auth 0.62.0 → 0.64.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.
- package/dist/credentials/config.d.ts +11 -0
- package/dist/credentials/login.d.ts +1 -1
- package/dist/credentials/register.d.ts +1 -1
- package/dist/csrf.d.ts +9 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +107 -62
- package/dist/index.js.map +9 -8
- package/dist/routes/requireAuth.d.ts +43 -0
- package/dist/server.d.ts +1 -0
- package/dist/server.js +106 -62
- package/dist/server.js.map +10 -9
- package/package.json +1 -1
|
@@ -21,6 +21,10 @@ export type CredentialEmailMessage = {
|
|
|
21
21
|
export type CredentialsConfig<UserType> = {
|
|
22
22
|
checkBreachesOnLogin?: boolean;
|
|
23
23
|
credentialStore: CredentialStore;
|
|
24
|
+
/** When `trustedOrigins` is set, whether an untrusted Origin is REJECTED
|
|
25
|
+
* (default true) or merely reported via `onUntrustedOrigin` (false = a
|
|
26
|
+
* report-only rollout that never blocks). */
|
|
27
|
+
enforceTrustedOrigins?: boolean;
|
|
24
28
|
getUserByEmail: (email: string) => Promise<UserType | null | undefined> | UserType | null | undefined;
|
|
25
29
|
isMfaRequired?: (user: UserType, context?: {
|
|
26
30
|
headers: Record<string, string | undefined>;
|
|
@@ -56,6 +60,13 @@ export type CredentialsConfig<UserType> = {
|
|
|
56
60
|
user: UserType;
|
|
57
61
|
}) => void | Promise<void>;
|
|
58
62
|
onSendEmail: (message: CredentialEmailMessage) => void | Promise<void>;
|
|
63
|
+
/** Called on login/register when the request's Origin is not in
|
|
64
|
+
* `trustedOrigins`. Fires whether or not `enforceTrustedOrigins` blocks the
|
|
65
|
+
* request, so it can drive a report-only rollout (log/surface the Origin). */
|
|
66
|
+
onUntrustedOrigin?: (context: {
|
|
67
|
+
origin: string | null;
|
|
68
|
+
request: Request;
|
|
69
|
+
}) => void | Promise<void>;
|
|
59
70
|
passwordPolicy?: PasswordPolicy;
|
|
60
71
|
registerRoute?: RouteString;
|
|
61
72
|
/** When true, registration creates the account but NOT a session, and login is
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Elysia } from 'elysia';
|
|
2
2
|
import { type CredentialRouteProps } from './config';
|
|
3
|
-
export declare const credentialsLogin: <UserType>({ authSessionStore, checkBreachesOnLogin, cookieSecure, credentialStore, getUserByEmail, isMfaRequired, lockoutGuard, loginRoute, onCredentialsLoginError, onCredentialsLoginSuccess, passwordVerifier, rehashOnLogin, requireEmailVerification, sessionDurationMs, trustedOrigins }: CredentialRouteProps<UserType>) => Elysia<"", {
|
|
3
|
+
export declare const credentialsLogin: <UserType>({ authSessionStore, checkBreachesOnLogin, cookieSecure, credentialStore, enforceTrustedOrigins, getUserByEmail, isMfaRequired, lockoutGuard, loginRoute, onCredentialsLoginError, onCredentialsLoginSuccess, onUntrustedOrigin, passwordVerifier, rehashOnLogin, requireEmailVerification, sessionDurationMs, trustedOrigins }: CredentialRouteProps<UserType>) => Elysia<"", {
|
|
4
4
|
decorator: {};
|
|
5
5
|
store: {
|
|
6
6
|
session: import("..").SessionRecord<UserType>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Elysia } from 'elysia';
|
|
2
2
|
import { type CredentialRouteProps } from './config';
|
|
3
|
-
export declare const credentialsRegister: <UserType>({ authSessionStore, cookieSecure, credentialStore, onCreateCredentialUser, onCredentialsLoginSuccess, onExistingAccount, onRegistrationSuccess, onSendEmail, passwordPolicy, registerRoute, requireEmailVerification, revealRegistrationConflicts, sessionDurationMs, trustedOrigins, verificationTokenDurationMs }: CredentialRouteProps<UserType>) => Elysia<"", {
|
|
3
|
+
export declare const credentialsRegister: <UserType>({ authSessionStore, cookieSecure, credentialStore, enforceTrustedOrigins, onCreateCredentialUser, onCredentialsLoginSuccess, onExistingAccount, onRegistrationSuccess, onSendEmail, onUntrustedOrigin, passwordPolicy, registerRoute, requireEmailVerification, revealRegistrationConflicts, sessionDurationMs, trustedOrigins, verificationTokenDurationMs }: CredentialRouteProps<UserType>) => Elysia<"", {
|
|
4
4
|
decorator: {};
|
|
5
5
|
store: {
|
|
6
6
|
session: import("..").SessionRecord<UserType>;
|
package/dist/csrf.d.ts
CHANGED
|
@@ -1 +1,10 @@
|
|
|
1
1
|
export declare const isTrustedOrigin: (request: Request, trustedOrigins?: readonly string[]) => boolean;
|
|
2
|
+
export declare const resolveOriginAllowed: ({ enforce, onUntrustedOrigin, request, trustedOrigins }: {
|
|
3
|
+
enforce?: boolean;
|
|
4
|
+
onUntrustedOrigin?: (context: {
|
|
5
|
+
origin: string | null;
|
|
6
|
+
request: Request;
|
|
7
|
+
}) => void | Promise<void>;
|
|
8
|
+
request: Request;
|
|
9
|
+
trustedOrigins?: readonly string[];
|
|
10
|
+
}) => Promise<boolean>;
|
package/dist/index.d.ts
CHANGED
|
@@ -3454,6 +3454,7 @@ export { createOAuthAccountLinkedProviderCredentialResolver, type OAuthLinkedPro
|
|
|
3454
3454
|
export { createNeonLinkedProviderStores, createNeonOAuthLinkedProviderCredentialResolver } from './linkedProviders/neonStores';
|
|
3455
3455
|
export { createInMemoryLinkedProviderStores } from './linkedProviders/inMemoryStores';
|
|
3456
3456
|
export { protectRoutePlugin } from './routes/protectRoute';
|
|
3457
|
+
export { requireAuthPlugin } from './routes/requireAuth';
|
|
3457
3458
|
export { sessionRoutes } from './routes/sessions';
|
|
3458
3459
|
export { stepUpPlugin } from './routes/stepUp';
|
|
3459
3460
|
export * from './session/sessionsConfig';
|
package/dist/index.js
CHANGED
|
@@ -2982,7 +2982,7 @@ var createCustomOAuth2Client = (providerConfig, credentials) => buildOAuth2Clien
|
|
|
2982
2982
|
var createOAuth2Client = (providerName, config) => buildOAuth2Client(providers[providerName], config);
|
|
2983
2983
|
|
|
2984
2984
|
// src/index.ts
|
|
2985
|
-
import { Elysia as
|
|
2985
|
+
import { Elysia as Elysia46 } from "elysia";
|
|
2986
2986
|
|
|
2987
2987
|
// src/apikeys/routes.ts
|
|
2988
2988
|
import { Elysia, t } from "elysia";
|
|
@@ -5153,6 +5153,20 @@ var isTrustedOrigin = (request, trustedOrigins) => {
|
|
|
5153
5153
|
const origin = request.headers.get("origin");
|
|
5154
5154
|
return origin !== null && trustedOrigins.includes(origin);
|
|
5155
5155
|
};
|
|
5156
|
+
var resolveOriginAllowed = async ({
|
|
5157
|
+
enforce = true,
|
|
5158
|
+
onUntrustedOrigin,
|
|
5159
|
+
request,
|
|
5160
|
+
trustedOrigins
|
|
5161
|
+
}) => {
|
|
5162
|
+
if (isTrustedOrigin(request, trustedOrigins))
|
|
5163
|
+
return true;
|
|
5164
|
+
await onUntrustedOrigin?.({
|
|
5165
|
+
origin: request.headers.get("origin"),
|
|
5166
|
+
request
|
|
5167
|
+
});
|
|
5168
|
+
return enforce === false;
|
|
5169
|
+
};
|
|
5156
5170
|
|
|
5157
5171
|
// src/credentials/import.ts
|
|
5158
5172
|
init_crypto();
|
|
@@ -5349,12 +5363,14 @@ var credentialsLogin = ({
|
|
|
5349
5363
|
checkBreachesOnLogin,
|
|
5350
5364
|
cookieSecure,
|
|
5351
5365
|
credentialStore,
|
|
5366
|
+
enforceTrustedOrigins,
|
|
5352
5367
|
getUserByEmail,
|
|
5353
5368
|
isMfaRequired,
|
|
5354
5369
|
lockoutGuard,
|
|
5355
5370
|
loginRoute = "/auth/login",
|
|
5356
5371
|
onCredentialsLoginError,
|
|
5357
5372
|
onCredentialsLoginSuccess,
|
|
5373
|
+
onUntrustedOrigin,
|
|
5358
5374
|
passwordVerifier,
|
|
5359
5375
|
rehashOnLogin = false,
|
|
5360
5376
|
requireEmailVerification = false,
|
|
@@ -5367,7 +5383,12 @@ var credentialsLogin = ({
|
|
|
5367
5383
|
status,
|
|
5368
5384
|
store: { session, unregisteredSession }
|
|
5369
5385
|
}) => withSpan("auth.credentials.login", undefined, async (span) => {
|
|
5370
|
-
if (!
|
|
5386
|
+
if (!await resolveOriginAllowed({
|
|
5387
|
+
enforce: enforceTrustedOrigins,
|
|
5388
|
+
onUntrustedOrigin,
|
|
5389
|
+
request,
|
|
5390
|
+
trustedOrigins
|
|
5391
|
+
})) {
|
|
5371
5392
|
return status("Forbidden", "Request origin is not allowed");
|
|
5372
5393
|
}
|
|
5373
5394
|
const headerBag = {};
|
|
@@ -5525,11 +5546,13 @@ var credentialsRegister = ({
|
|
|
5525
5546
|
authSessionStore,
|
|
5526
5547
|
cookieSecure,
|
|
5527
5548
|
credentialStore,
|
|
5549
|
+
enforceTrustedOrigins,
|
|
5528
5550
|
onCreateCredentialUser,
|
|
5529
5551
|
onCredentialsLoginSuccess,
|
|
5530
5552
|
onExistingAccount,
|
|
5531
5553
|
onRegistrationSuccess,
|
|
5532
5554
|
onSendEmail,
|
|
5555
|
+
onUntrustedOrigin,
|
|
5533
5556
|
passwordPolicy,
|
|
5534
5557
|
registerRoute = "/auth/register",
|
|
5535
5558
|
requireEmailVerification = false,
|
|
@@ -5544,7 +5567,12 @@ var credentialsRegister = ({
|
|
|
5544
5567
|
status,
|
|
5545
5568
|
store: { session }
|
|
5546
5569
|
}) => withSpan("auth.credentials.register", undefined, async () => {
|
|
5547
|
-
if (!
|
|
5570
|
+
if (!await resolveOriginAllowed({
|
|
5571
|
+
enforce: enforceTrustedOrigins,
|
|
5572
|
+
onUntrustedOrigin,
|
|
5573
|
+
request,
|
|
5574
|
+
trustedOrigins
|
|
5575
|
+
})) {
|
|
5548
5576
|
return status("Forbidden", "Request origin is not allowed");
|
|
5549
5577
|
}
|
|
5550
5578
|
const normalizedEmail = email.trim().toLowerCase();
|
|
@@ -31532,6 +31560,21 @@ var createInMemoryLinkedProviderStores = (input = {}) => {
|
|
|
31532
31560
|
};
|
|
31533
31561
|
return { bindingStore, grantStore };
|
|
31534
31562
|
};
|
|
31563
|
+
// src/routes/requireAuth.ts
|
|
31564
|
+
import { Elysia as Elysia41, t as t33 } from "elysia";
|
|
31565
|
+
var requireAuthPlugin = ({
|
|
31566
|
+
authSessionStore
|
|
31567
|
+
} = {}) => new Elysia41({
|
|
31568
|
+
name: "@absolutejs/auth/require-auth",
|
|
31569
|
+
seed: pluginDependencySeed(authSessionStore)
|
|
31570
|
+
}).use(sessionStore()).guard({ cookie: t33.Cookie({ user_session_id: userSessionIdTypebox }) }).resolve(async ({ store: { session }, cookie: { user_session_id } }) => {
|
|
31571
|
+
const { user } = await getStatusFromSource({
|
|
31572
|
+
authSessionStore,
|
|
31573
|
+
session,
|
|
31574
|
+
user_session_id
|
|
31575
|
+
});
|
|
31576
|
+
return { user: user ?? null };
|
|
31577
|
+
}).onBeforeHandle(({ user, status }) => user === null ? status("Unauthorized", "User is not authenticated") : undefined).as("global");
|
|
31535
31578
|
// src/session/impersonation.ts
|
|
31536
31579
|
init_constants();
|
|
31537
31580
|
var DEFAULT_IMPERSONATION_TTL_MS = MILLISECONDS_IN_AN_HOUR;
|
|
@@ -32950,7 +32993,7 @@ var createInMemoryCredentialOfferStore = () => {
|
|
|
32950
32993
|
};
|
|
32951
32994
|
};
|
|
32952
32995
|
// src/oidc/vciRoutes.ts
|
|
32953
|
-
import { Elysia as
|
|
32996
|
+
import { Elysia as Elysia42, t as t34 } from "elysia";
|
|
32954
32997
|
var HTTP_OK4 = 200;
|
|
32955
32998
|
var HTTP_BAD_REQUEST4 = 400;
|
|
32956
32999
|
var HTTP_UNAUTHORIZED5 = 401;
|
|
@@ -32975,7 +33018,7 @@ var vciRoutes = ({
|
|
|
32975
33018
|
const credentialRoute = `${vciRoute}/credential`;
|
|
32976
33019
|
const nonceRoute = `${vciRoute}/nonce`;
|
|
32977
33020
|
const vciSigningKey = vciConfig.signingKey ?? signingKey;
|
|
32978
|
-
return new
|
|
33021
|
+
return new Elysia42().get("/.well-known/openid-credential-issuer", () => Response.json(buildIssuerMetadata({
|
|
32979
33022
|
config: vciConfig,
|
|
32980
33023
|
issuer: issuerUrl,
|
|
32981
33024
|
vciRoute
|
|
@@ -32998,11 +33041,11 @@ var vciRoutes = ({
|
|
|
32998
33041
|
return errorBody(result.error, HTTP_BAD_REQUEST4);
|
|
32999
33042
|
return Response.json({ credential: result.credential, format: result.format }, { status: HTTP_OK4 });
|
|
33000
33043
|
}, {
|
|
33001
|
-
body:
|
|
33002
|
-
format:
|
|
33003
|
-
proof:
|
|
33004
|
-
jwt:
|
|
33005
|
-
proof_type:
|
|
33044
|
+
body: t34.Object({
|
|
33045
|
+
format: t34.Optional(t34.Union([t34.Literal("vc+sd-jwt")])),
|
|
33046
|
+
proof: t34.Optional(t34.Object({
|
|
33047
|
+
jwt: t34.String(),
|
|
33048
|
+
proof_type: t34.Literal("jwt")
|
|
33006
33049
|
}))
|
|
33007
33050
|
})
|
|
33008
33051
|
}).post(nonceRoute, async () => {
|
|
@@ -33124,7 +33167,7 @@ var verifyStatusListJwt = async ({
|
|
|
33124
33167
|
};
|
|
33125
33168
|
};
|
|
33126
33169
|
// src/vc/statusListRoutes.ts
|
|
33127
|
-
import { Elysia as
|
|
33170
|
+
import { Elysia as Elysia43, t as t35 } from "elysia";
|
|
33128
33171
|
var HTTP_OK5 = 200;
|
|
33129
33172
|
var HTTP_NOT_FOUND = 404;
|
|
33130
33173
|
var DEFAULT_STATUS_ROUTE = "/vc/status";
|
|
@@ -33136,7 +33179,7 @@ var statusListRoutes = ({
|
|
|
33136
33179
|
ttlSeconds
|
|
33137
33180
|
}) => {
|
|
33138
33181
|
const listRoute = `${statusRoute}/:listId`;
|
|
33139
|
-
return new
|
|
33182
|
+
return new Elysia43().get(listRoute, async ({ params: { listId } }) => {
|
|
33140
33183
|
const bits = await getStatusList(listId);
|
|
33141
33184
|
if (bits === undefined) {
|
|
33142
33185
|
return new Response("Not found", { status: HTTP_NOT_FOUND });
|
|
@@ -33152,7 +33195,7 @@ var statusListRoutes = ({
|
|
|
33152
33195
|
headers: { "content-type": STATUS_LIST_SUB_TYP },
|
|
33153
33196
|
status: HTTP_OK5
|
|
33154
33197
|
});
|
|
33155
|
-
}, { params:
|
|
33198
|
+
}, { params: t35.Object({ listId: t35.String() }) });
|
|
33156
33199
|
};
|
|
33157
33200
|
// src/vc/openid4vp.ts
|
|
33158
33201
|
init_crypto();
|
|
@@ -33357,7 +33400,7 @@ var createInMemoryPresentationRequestStore = () => {
|
|
|
33357
33400
|
};
|
|
33358
33401
|
};
|
|
33359
33402
|
// src/vc/vpRoutes.ts
|
|
33360
|
-
import { Elysia as
|
|
33403
|
+
import { Elysia as Elysia44, t as t36 } from "elysia";
|
|
33361
33404
|
var HTTP_OK6 = 200;
|
|
33362
33405
|
var HTTP_BAD_REQUEST5 = 400;
|
|
33363
33406
|
var HTTP_NOT_FOUND2 = 404;
|
|
@@ -33376,7 +33419,7 @@ var vpRoutes = ({
|
|
|
33376
33419
|
const authorizeRoute = `${vpRoute}/authorize`;
|
|
33377
33420
|
const requestRoute = `${vpRoute}/request/:id`;
|
|
33378
33421
|
const responseRoute = `${vpRoute}/response`;
|
|
33379
|
-
return new
|
|
33422
|
+
return new Elysia44().post(authorizeRoute, async ({ body }) => {
|
|
33380
33423
|
const input = {
|
|
33381
33424
|
clientId: body.client_id ?? defaultClientId,
|
|
33382
33425
|
requestedClaims: body.requested_claims,
|
|
@@ -33394,10 +33437,10 @@ var vpRoutes = ({
|
|
|
33394
33437
|
requestId: result.request.requestId
|
|
33395
33438
|
}, { status: HTTP_OK6 });
|
|
33396
33439
|
}, {
|
|
33397
|
-
body:
|
|
33398
|
-
client_id:
|
|
33399
|
-
requested_claims:
|
|
33400
|
-
state:
|
|
33440
|
+
body: t36.Object({
|
|
33441
|
+
client_id: t36.Optional(t36.String()),
|
|
33442
|
+
requested_claims: t36.Array(t36.String()),
|
|
33443
|
+
state: t36.Optional(t36.String())
|
|
33401
33444
|
})
|
|
33402
33445
|
}).get(requestRoute, async ({ params: { id } }) => {
|
|
33403
33446
|
const stored = await vpConfig.requestStore.getRequest(id);
|
|
@@ -33423,7 +33466,7 @@ var vpRoutes = ({
|
|
|
33423
33466
|
},
|
|
33424
33467
|
status: HTTP_OK6
|
|
33425
33468
|
});
|
|
33426
|
-
}, { params:
|
|
33469
|
+
}, { params: t36.Object({ id: t36.String() }) }).post(responseRoute, async ({ body }) => {
|
|
33427
33470
|
const requestId = body.state;
|
|
33428
33471
|
if (requestId === undefined) {
|
|
33429
33472
|
return errorBody2("missing_state", HTTP_BAD_REQUEST5);
|
|
@@ -33444,10 +33487,10 @@ var vpRoutes = ({
|
|
|
33444
33487
|
verified: true
|
|
33445
33488
|
}, { status: HTTP_OK6 });
|
|
33446
33489
|
}, {
|
|
33447
|
-
body:
|
|
33448
|
-
presentation_submission:
|
|
33449
|
-
state:
|
|
33450
|
-
vp_token:
|
|
33490
|
+
body: t36.Object({
|
|
33491
|
+
presentation_submission: t36.Optional(t36.Unknown()),
|
|
33492
|
+
state: t36.Optional(t36.String()),
|
|
33493
|
+
vp_token: t36.String()
|
|
33451
33494
|
})
|
|
33452
33495
|
});
|
|
33453
33496
|
};
|
|
@@ -36803,7 +36846,7 @@ var blockMigrations = {
|
|
|
36803
36846
|
webhooks: initMigration("webhooks", [webhookDeliveriesTable])
|
|
36804
36847
|
};
|
|
36805
36848
|
// src/sso/samlIdpRoutes.ts
|
|
36806
|
-
import { Elysia as
|
|
36849
|
+
import { Elysia as Elysia45, t as t37 } from "elysia";
|
|
36807
36850
|
var HTTP_BAD_REQUEST6 = 400;
|
|
36808
36851
|
var HTTP_UNAUTHORIZED6 = 401;
|
|
36809
36852
|
var HTTP_FOUND2 = 302;
|
|
@@ -36913,19 +36956,19 @@ var samlIdpRoutes = ({
|
|
|
36913
36956
|
user: userSession.user
|
|
36914
36957
|
});
|
|
36915
36958
|
};
|
|
36916
|
-
return new
|
|
36959
|
+
return new Elysia45().use(sessionStore()).post(ssoIdpRoute, async ({ body, cookie: { user_session_id }, request, store }) => handleSpInitiated({
|
|
36917
36960
|
binding: "POST",
|
|
36918
36961
|
body,
|
|
36919
36962
|
inMemorySession: store.session,
|
|
36920
36963
|
request,
|
|
36921
36964
|
userSessionIdValue: user_session_id.value
|
|
36922
36965
|
}), {
|
|
36923
|
-
body:
|
|
36924
|
-
RelayState:
|
|
36925
|
-
SAMLRequest:
|
|
36966
|
+
body: t37.Object({
|
|
36967
|
+
RelayState: t37.Optional(t37.String()),
|
|
36968
|
+
SAMLRequest: t37.Optional(t37.String())
|
|
36926
36969
|
}),
|
|
36927
|
-
cookie:
|
|
36928
|
-
user_session_id:
|
|
36970
|
+
cookie: t37.Cookie({
|
|
36971
|
+
user_session_id: t37.Optional(userSessionIdTypebox)
|
|
36929
36972
|
})
|
|
36930
36973
|
}).get(ssoIdpRoute, async ({ cookie: { user_session_id }, query, request, store }) => handleSpInitiated({
|
|
36931
36974
|
binding: "Redirect",
|
|
@@ -36934,14 +36977,14 @@ var samlIdpRoutes = ({
|
|
|
36934
36977
|
request,
|
|
36935
36978
|
userSessionIdValue: user_session_id.value
|
|
36936
36979
|
}), {
|
|
36937
|
-
cookie:
|
|
36938
|
-
user_session_id:
|
|
36980
|
+
cookie: t37.Cookie({
|
|
36981
|
+
user_session_id: t37.Optional(userSessionIdTypebox)
|
|
36939
36982
|
}),
|
|
36940
|
-
query:
|
|
36941
|
-
RelayState:
|
|
36942
|
-
SAMLRequest:
|
|
36943
|
-
SigAlg:
|
|
36944
|
-
Signature:
|
|
36983
|
+
query: t37.Object({
|
|
36984
|
+
RelayState: t37.Optional(t37.String()),
|
|
36985
|
+
SAMLRequest: t37.Optional(t37.String()),
|
|
36986
|
+
SigAlg: t37.Optional(t37.String()),
|
|
36987
|
+
Signature: t37.Optional(t37.String())
|
|
36945
36988
|
})
|
|
36946
36989
|
}).get(idpInitiateRoute, async ({
|
|
36947
36990
|
cookie: { user_session_id },
|
|
@@ -36977,12 +37020,12 @@ var samlIdpRoutes = ({
|
|
|
36977
37020
|
user: userSession.user
|
|
36978
37021
|
});
|
|
36979
37022
|
}, {
|
|
36980
|
-
cookie:
|
|
36981
|
-
user_session_id:
|
|
37023
|
+
cookie: t37.Cookie({
|
|
37024
|
+
user_session_id: t37.Optional(userSessionIdTypebox)
|
|
36982
37025
|
}),
|
|
36983
|
-
query:
|
|
36984
|
-
RelayState:
|
|
36985
|
-
sp:
|
|
37026
|
+
query: t37.Object({
|
|
37027
|
+
RelayState: t37.Optional(t37.String()),
|
|
37028
|
+
sp: t37.Optional(t37.String())
|
|
36986
37029
|
})
|
|
36987
37030
|
}).get(idpMetadataRoute, async ({ request }) => xmlResponse(await idpAdapter.getIdpMetadata({
|
|
36988
37031
|
entityId: idpEntityId,
|
|
@@ -37431,7 +37474,7 @@ var buildAuthApplications = async (configuration) => {
|
|
|
37431
37474
|
const auditedOnRevocationSuccess = auditEmit ? composeRevocationAudit(onRevocationSuccess, auditEmit) : onRevocationSuccess;
|
|
37432
37475
|
const auditedOnSignOut = auditEmit ? composeSignOutAudit(onSignOut, auditEmit) : onSignOut;
|
|
37433
37476
|
const pluginSeed = pluginDependencySeed(configuration);
|
|
37434
|
-
const coreRoutes = new
|
|
37477
|
+
const coreRoutes = new Elysia46({
|
|
37435
37478
|
name: "@absolutejs/auth/core-routes",
|
|
37436
37479
|
seed: pluginSeed
|
|
37437
37480
|
}).use([
|
|
@@ -37488,7 +37531,7 @@ var buildAuthApplications = async (configuration) => {
|
|
|
37488
37531
|
profileRoute
|
|
37489
37532
|
})
|
|
37490
37533
|
]);
|
|
37491
|
-
const featureRoutes = new
|
|
37534
|
+
const featureRoutes = new Elysia46({
|
|
37492
37535
|
name: "@absolutejs/auth/feature-routes",
|
|
37493
37536
|
seed: pluginSeed
|
|
37494
37537
|
}).use([
|
|
@@ -37497,64 +37540,64 @@ var buildAuthApplications = async (configuration) => {
|
|
|
37497
37540
|
authSessionStore,
|
|
37498
37541
|
cookieSecure: resolvedCookieSecure,
|
|
37499
37542
|
lockoutGuard
|
|
37500
|
-
}) : new
|
|
37543
|
+
}) : new Elysia46,
|
|
37501
37544
|
auditedMfa ? mfaRoutes({
|
|
37502
37545
|
...auditedMfa,
|
|
37503
37546
|
authSessionStore,
|
|
37504
37547
|
cookieSecure: resolvedCookieSecure,
|
|
37505
37548
|
verificationProvider
|
|
37506
|
-
}) : new
|
|
37549
|
+
}) : new Elysia46,
|
|
37507
37550
|
passwordless ? passwordlessRoutes({
|
|
37508
37551
|
...passwordless,
|
|
37509
37552
|
authSessionStore,
|
|
37510
37553
|
cookieSecure: resolvedCookieSecure,
|
|
37511
37554
|
emit: auditEmit
|
|
37512
|
-
}) : new
|
|
37513
|
-
sessions ? sessionRoutes({ ...sessions, authSessionStore }) : new
|
|
37555
|
+
}) : new Elysia46,
|
|
37556
|
+
sessions ? sessionRoutes({ ...sessions, authSessionStore }) : new Elysia46,
|
|
37514
37557
|
sso ? oidcSsoRoutes({
|
|
37515
37558
|
...sso,
|
|
37516
37559
|
authSessionStore,
|
|
37517
37560
|
cookieSecure: resolvedCookieSecure
|
|
37518
|
-
}) : new
|
|
37561
|
+
}) : new Elysia46,
|
|
37519
37562
|
sso && sso.samlAdapter ? samlSsoRoutes({
|
|
37520
37563
|
...sso,
|
|
37521
37564
|
authSessionStore,
|
|
37522
37565
|
cookieSecure: resolvedCookieSecure,
|
|
37523
37566
|
samlAdapter: sso.samlAdapter
|
|
37524
|
-
}) : new
|
|
37567
|
+
}) : new Elysia46,
|
|
37525
37568
|
sso && sso.getOrganizationByEmailDomain ? ssoDiscoveryRoute({
|
|
37526
37569
|
getOrganizationByEmailDomain: sso.getOrganizationByEmailDomain,
|
|
37527
37570
|
ssoConnectionStore: sso.ssoConnectionStore,
|
|
37528
37571
|
ssoRoute: sso.ssoRoute
|
|
37529
|
-
}) : new
|
|
37530
|
-
scim ? scimRoutes(scim) : new
|
|
37531
|
-
apikeys ? apiKeysRoutes(apikeys) : new
|
|
37572
|
+
}) : new Elysia46,
|
|
37573
|
+
scim ? scimRoutes(scim) : new Elysia46,
|
|
37574
|
+
apikeys ? apiKeysRoutes(apikeys) : new Elysia46,
|
|
37532
37575
|
oidcConfig ? oidcProviderRoutes({
|
|
37533
37576
|
...oidcConfig,
|
|
37534
37577
|
authSessionStore
|
|
37535
|
-
}) : new
|
|
37578
|
+
}) : new Elysia46,
|
|
37536
37579
|
organizations ? organizationRoutes({
|
|
37537
37580
|
...organizations,
|
|
37538
37581
|
authSessionStore,
|
|
37539
37582
|
emit: auditEmit
|
|
37540
|
-
}) : new
|
|
37583
|
+
}) : new Elysia46,
|
|
37541
37584
|
roles ? roleRoutes({
|
|
37542
37585
|
...roles,
|
|
37543
37586
|
authSessionStore,
|
|
37544
37587
|
emit: auditEmit
|
|
37545
|
-
}) : new
|
|
37546
|
-
portal ? portalRoutes({ ...portal, emit: auditEmit }) : new
|
|
37588
|
+
}) : new Elysia46,
|
|
37589
|
+
portal ? portalRoutes({ ...portal, emit: auditEmit }) : new Elysia46,
|
|
37547
37590
|
webauthn ? webauthnRoutes({
|
|
37548
37591
|
...webauthn,
|
|
37549
37592
|
authSessionStore,
|
|
37550
37593
|
cookieSecure: resolvedCookieSecure,
|
|
37551
37594
|
emit: auditEmit
|
|
37552
|
-
}) : new
|
|
37595
|
+
}) : new Elysia46,
|
|
37553
37596
|
compliance ? complianceRoutes({
|
|
37554
37597
|
...compliance,
|
|
37555
37598
|
authSessionStore,
|
|
37556
37599
|
emit: auditEmit
|
|
37557
|
-
}) : new
|
|
37600
|
+
}) : new Elysia46,
|
|
37558
37601
|
createConfiguredAuthHtmxRoutes({ authSessionStore, config: htmx }),
|
|
37559
37602
|
agentAuthRoutes(resolvedAgentAuth)
|
|
37560
37603
|
]);
|
|
@@ -37569,7 +37612,7 @@ var buildAuthApplications = async (configuration) => {
|
|
|
37569
37612
|
};
|
|
37570
37613
|
var auth = async (configuration) => {
|
|
37571
37614
|
const { authContext, coreRoutes, featureRoutes } = await buildAuthApplications(configuration);
|
|
37572
|
-
const application = new
|
|
37615
|
+
const application = new Elysia46({
|
|
37573
37616
|
name: "@absolutejs/auth",
|
|
37574
37617
|
seed: pluginDependencySeed(configuration)
|
|
37575
37618
|
});
|
|
@@ -37664,6 +37707,7 @@ export {
|
|
|
37664
37707
|
resolveProviderClientConfiguration,
|
|
37665
37708
|
resolvePostLogoutRedirect,
|
|
37666
37709
|
resolvePermissions,
|
|
37710
|
+
resolveOriginAllowed,
|
|
37667
37711
|
resolveOAuthTokenExpiresAt,
|
|
37668
37712
|
resolveOAuthAuthorization,
|
|
37669
37713
|
resolveCookieSecure,
|
|
@@ -37672,6 +37716,7 @@ export {
|
|
|
37672
37716
|
resolveAuthHtmxRenderers,
|
|
37673
37717
|
resolveApiPrincipal,
|
|
37674
37718
|
resolveAgentPrincipal,
|
|
37719
|
+
requireAuthPlugin,
|
|
37675
37720
|
removeFromSessionRing,
|
|
37676
37721
|
rehashCredentialPassword,
|
|
37677
37722
|
registerClient,
|
|
@@ -38084,5 +38129,5 @@ export {
|
|
|
38084
38129
|
AGENT_CLAIM_GRANT_TYPE
|
|
38085
38130
|
};
|
|
38086
38131
|
|
|
38087
|
-
//# debugId=
|
|
38132
|
+
//# debugId=9C794F23428AA07964756E2164756E21
|
|
38088
38133
|
//# sourceMappingURL=index.js.map
|