@absolutejs/auth 0.56.0 → 0.56.2
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/README.md +2 -0
- package/dist/cli/migrate.js +39 -13
- package/dist/cli/migrate.js.map +4 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.js +71 -15
- package/dist/index.js.map +6 -6
- package/dist/oidc/config.d.ts +2 -1
- package/dist/oidc/index.d.ts +11 -0
- package/dist/oidc/index.js +11437 -0
- package/dist/oidc/index.js.map +108 -0
- package/dist/oidc/postgresStores.d.ts +30 -0
- package/dist/oidc/routes.d.ts +1 -0
- package/dist/oidc/types.d.ts +2 -0
- package/dist/server.js +71 -15
- package/dist/server.js.map +6 -6
- package/package.json +10 -2
package/README.md
CHANGED
|
@@ -4,6 +4,8 @@ Server applications should import the primary authentication contract from
|
|
|
4
4
|
`@absolutejs/auth/server`. This declaration-stable entry point exposes `auth`,
|
|
5
5
|
session types, route protection, provider configuration, and the other core
|
|
6
6
|
server utilities without loading declarations for every optional Auth feature.
|
|
7
|
+
OIDC provider integrations should likewise import signing keys, token
|
|
8
|
+
verification, provider stores, and provider types from `@absolutejs/auth/oidc`.
|
|
7
9
|
The root entry point remains available for applications that need the complete
|
|
8
10
|
feature export surface. `auth()` exposes the complete reusable request context
|
|
9
11
|
(`protectRoute`, `requireRecentAuth`, optional `protectPermission`, and
|
package/dist/cli/migrate.js
CHANGED
|
@@ -2617,6 +2617,16 @@ import {
|
|
|
2617
2617
|
} from "drizzle-orm/pg-core";
|
|
2618
2618
|
var URL_LENGTH = 2048;
|
|
2619
2619
|
var ID_LENGTH8 = 255;
|
|
2620
|
+
var BACKCHANNEL_AUTH_STATUSES = new Set([
|
|
2621
|
+
"approved",
|
|
2622
|
+
"denied",
|
|
2623
|
+
"pending"
|
|
2624
|
+
]);
|
|
2625
|
+
var DEVICE_AUTHORIZATION_STATUSES = new Set([
|
|
2626
|
+
"approved",
|
|
2627
|
+
"denied",
|
|
2628
|
+
"pending"
|
|
2629
|
+
]);
|
|
2620
2630
|
var oauthBackchannelAuthRequestsTable = pgTable10("auth_oauth_backchannel_auth_requests", {
|
|
2621
2631
|
auth_req_id: varchar10("auth_req_id", { length: ID_LENGTH8 }).primaryKey(),
|
|
2622
2632
|
binding_message: text5("binding_message"),
|
|
@@ -2661,6 +2671,7 @@ var oauthClientsTable = pgTable10("auth_oauth_clients", {
|
|
|
2661
2671
|
});
|
|
2662
2672
|
var oauthCodesTable = pgTable10("auth_oauth_codes", {
|
|
2663
2673
|
acr: varchar10("acr", { length: ID_LENGTH8 }),
|
|
2674
|
+
audience: varchar10("audience", { length: URL_LENGTH }),
|
|
2664
2675
|
claims_json: jsonb5("claims_json").$type(),
|
|
2665
2676
|
client_id: varchar10("client_id", { length: ID_LENGTH8 }).notNull(),
|
|
2666
2677
|
code_challenge: varchar10("code_challenge", { length: ID_LENGTH8 }).notNull(),
|
|
@@ -2713,6 +2724,7 @@ var oauthPushedAuthorizationRequestsTable = pgTable10("auth_oauth_pushed_authori
|
|
|
2713
2724
|
});
|
|
2714
2725
|
var oauthRefreshTokensTable = pgTable10("auth_oauth_refresh_tokens", {
|
|
2715
2726
|
acr: varchar10("acr", { length: ID_LENGTH8 }),
|
|
2727
|
+
audience: varchar10("audience", { length: URL_LENGTH }),
|
|
2716
2728
|
claims_json: jsonb5("claims_json").$type(),
|
|
2717
2729
|
client_id: varchar10("client_id", { length: ID_LENGTH8 }).notNull(),
|
|
2718
2730
|
created_at_ms: bigint8("created_at_ms", { mode: "number" }).notNull(),
|
|
@@ -3118,6 +3130,14 @@ var mfaTotpLockoutMigration = {
|
|
|
3118
3130
|
id: "0003_totp_lockout",
|
|
3119
3131
|
sql: 'ALTER TABLE "auth_mfa_enrollments" ADD COLUMN IF NOT EXISTS "totp_failed_attempts" smallint NOT NULL DEFAULT 0;'
|
|
3120
3132
|
};
|
|
3133
|
+
var oidcResourceAudienceMigration = {
|
|
3134
|
+
id: "0002_resource_audience",
|
|
3135
|
+
sql: [
|
|
3136
|
+
'ALTER TABLE "auth_oauth_codes" ADD COLUMN IF NOT EXISTS "audience" varchar(2048);',
|
|
3137
|
+
'ALTER TABLE "auth_oauth_refresh_tokens" ADD COLUMN IF NOT EXISTS "audience" varchar(2048);'
|
|
3138
|
+
].join(`
|
|
3139
|
+
`)
|
|
3140
|
+
};
|
|
3121
3141
|
var blockMigrations = {
|
|
3122
3142
|
adaptive: initMigration("adaptive", [knownDevicesTable, loginHistoryTable]),
|
|
3123
3143
|
agents: {
|
|
@@ -3159,18 +3179,24 @@ var blockMigrations = {
|
|
|
3159
3179
|
mfaTotpLockoutMigration
|
|
3160
3180
|
]
|
|
3161
3181
|
},
|
|
3162
|
-
oidc:
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3182
|
+
oidc: {
|
|
3183
|
+
block: "oidc",
|
|
3184
|
+
migrations: [
|
|
3185
|
+
...initMigration("oidc", [
|
|
3186
|
+
oauthBackchannelAuthRequestsTable,
|
|
3187
|
+
oauthClientAssertionJtisTable,
|
|
3188
|
+
oauthClientRegistrationTokensTable,
|
|
3189
|
+
oauthClientsTable,
|
|
3190
|
+
oauthCodesTable,
|
|
3191
|
+
oauthDeviceAuthorizationsTable,
|
|
3192
|
+
oauthInitialAccessTokensTable,
|
|
3193
|
+
oauthLogoutDeliveriesTable,
|
|
3194
|
+
oauthPushedAuthorizationRequestsTable,
|
|
3195
|
+
oauthRefreshTokensTable
|
|
3196
|
+
]).migrations,
|
|
3197
|
+
oidcResourceAudienceMigration
|
|
3198
|
+
]
|
|
3199
|
+
},
|
|
3174
3200
|
organizations: initMigration("organizations", [
|
|
3175
3201
|
organizationsTable,
|
|
3176
3202
|
organizationMembershipsTable,
|
|
@@ -3362,5 +3388,5 @@ var main = async () => {
|
|
|
3362
3388
|
};
|
|
3363
3389
|
await main();
|
|
3364
3390
|
|
|
3365
|
-
//# debugId=
|
|
3391
|
+
//# debugId=8A2517B7159F359864756E2164756E21
|
|
3366
3392
|
//# sourceMappingURL=migrate.js.map
|