@absolutejs/auth 0.77.1 → 0.79.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/CHANGELOG.md +14 -0
- package/README.md +16 -0
- package/changelog.json +27 -0
- package/dist/apikeys/config.d.ts +1 -1
- package/dist/apikeys/tokenRoutes.d.ts +7 -0
- package/dist/cli/migrate.js +7 -7
- package/dist/cli/migrate.js.map +3 -3
- package/dist/index.js +610 -598
- package/dist/index.js.map +10 -9
- package/dist/linkedProviders/index.js +7 -7
- package/dist/linkedProviders/index.js.map +3 -3
- package/dist/server.js +610 -598
- package/dist/server.js.map +10 -9
- package/dist/types.d.ts +1 -1
- package/package.json +11 -7
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `@absolutejs/auth`.
|
|
4
|
+
|
|
5
|
+
This file is generated by `absolute-changelog` from the entries in
|
|
6
|
+
`changelog/`. Edit an entry, not this file — and add new ones under
|
|
7
|
+
`changelog/unreleased/`.
|
|
8
|
+
|
|
9
|
+
## 0.79.0 — 2026-09-10
|
|
10
|
+
|
|
11
|
+
### Breaking
|
|
12
|
+
|
|
13
|
+
- **Separate API credential token routes from OIDC and reject conflicting configuration** (`apiKeysRoutes`, `auth`, `createAuthApplications`, `AuthConfig`, `ApiKeysConfig`)
|
|
14
|
+
_Migration:_ Send client_credentials requests to /auth/api/token instead of /oauth2/token and update advertised enterprise token URLs. Keep authorization_code and refresh_token requests at /oauth2/token. Prefer auth({ oidc, apikeys }) for configuration validation. API-only consumers may explicitly keep tokenRoute: /oauth2/token if no OIDC handler uses that path.
|
package/README.md
CHANGED
|
@@ -392,3 +392,19 @@ using it has expired; duplicate key IDs fail closed.
|
|
|
392
392
|
## Note
|
|
393
393
|
|
|
394
394
|
This project uses Bun and is built for Elysia.
|
|
395
|
+
|
|
396
|
+
## OAuth and API credential token routes
|
|
397
|
+
|
|
398
|
+
As of 0.79.0, `apiKeysRoutes()` and `auth({ apikeys })` serve the
|
|
399
|
+
`client_credentials` grant at `/auth/api/token` by default. OIDC authorization
|
|
400
|
+
code and refresh grants continue to use `/oauth2/token`. This keeps separately
|
|
401
|
+
mounted plugins from replacing each other's token handler.
|
|
402
|
+
|
|
403
|
+
Update enterprise integrations and displayed token URLs to `/auth/api/token`.
|
|
404
|
+
API-only applications can retain the previous URL by explicitly setting
|
|
405
|
+
`apikeys.tokenRoute: '/oauth2/token'`, provided no OIDC handler uses that path.
|
|
406
|
+
|
|
407
|
+
Prefer configuring both features in `auth({ oidc, apikeys })`: conflicting token
|
|
408
|
+
paths are rejected during construction, including a trailing-slash alias.
|
|
409
|
+
When mounting standalone plugins with custom paths, the consumer must keep
|
|
410
|
+
the paths distinct; Elysia does not reject arbitrary duplicate routes.
|
package/changelog.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contract": 1,
|
|
3
|
+
"name": "@absolutejs/auth",
|
|
4
|
+
"releases": [
|
|
5
|
+
{
|
|
6
|
+
"changes": [
|
|
7
|
+
{
|
|
8
|
+
"kind": "breaking",
|
|
9
|
+
"migration": {
|
|
10
|
+
"instruction": "Send client_credentials requests to /auth/api/token instead of /oauth2/token and update advertised enterprise token URLs. Keep authorization_code and refresh_token requests at /oauth2/token. Prefer auth({ oidc, apikeys }) for configuration validation. API-only consumers may explicitly keep tokenRoute: /oauth2/token if no OIDC handler uses that path.",
|
|
11
|
+
"manual": true
|
|
12
|
+
},
|
|
13
|
+
"summary": "Separate API credential token routes from OIDC and reject conflicting configuration",
|
|
14
|
+
"symbols": [
|
|
15
|
+
"apiKeysRoutes",
|
|
16
|
+
"auth",
|
|
17
|
+
"createAuthApplications",
|
|
18
|
+
"AuthConfig",
|
|
19
|
+
"ApiKeysConfig"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"date": "2026-09-10",
|
|
24
|
+
"version": "0.79.0"
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
}
|
package/dist/apikeys/config.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export type ApiKeysConfig = {
|
|
|
13
13
|
/** Static API keys. Used by the exported `verifyApiKey` / `resolveApiPrincipal`
|
|
14
14
|
* helpers; the consumer wires its own management + guard routes. */
|
|
15
15
|
apiKeyStore?: ApiKeyStore;
|
|
16
|
-
/** Path of the client_credentials token endpoint (defaults to `/
|
|
16
|
+
/** Path of the client_credentials token endpoint (defaults to `/auth/api/token`). */
|
|
17
17
|
tokenRoute?: RouteString;
|
|
18
18
|
};
|
|
19
19
|
export type ClientCredentialsResult = {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { RouteString } from '../types';
|
|
2
|
+
import { type ApiKeysConfig } from './config';
|
|
3
|
+
/** Elysia replaces duplicate method/path registrations. Refuse that setup
|
|
4
|
+
* before composing the two independently configured token handlers. */
|
|
5
|
+
export declare const assertTokenRouteConfiguration: (apikeys: ApiKeysConfig | undefined, oidc: {
|
|
6
|
+
oidcRoute?: RouteString;
|
|
7
|
+
} | undefined) => void;
|
package/dist/cli/migrate.js
CHANGED
|
@@ -2664,7 +2664,7 @@ var linkedProviderBindingsTable = pgTable7("linked_provider_bindings", {
|
|
|
2664
2664
|
available_scopes: jsonb3("available_scopes").$type().notNull().default([]),
|
|
2665
2665
|
capabilities: jsonb3("capabilities").$type().default([]),
|
|
2666
2666
|
connector_provider: varchar7("connector_provider", { length: 64 }).notNull(),
|
|
2667
|
-
created_at: timestamp("created_at").notNull().defaultNow(),
|
|
2667
|
+
created_at: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
2668
2668
|
email: varchar7("email", { length: 320 }),
|
|
2669
2669
|
external_account_id: varchar7("external_account_id", {
|
|
2670
2670
|
length: 255
|
|
@@ -2677,18 +2677,18 @@ var linkedProviderBindingsTable = pgTable7("linked_provider_bindings", {
|
|
|
2677
2677
|
label: varchar7("label", { length: 255 }),
|
|
2678
2678
|
metadata: jsonb3("metadata").$type().default({}),
|
|
2679
2679
|
status: varchar7("status", { length: 64 }).$type().notNull(),
|
|
2680
|
-
updated_at: timestamp("updated_at").notNull().defaultNow(),
|
|
2680
|
+
updated_at: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow(),
|
|
2681
2681
|
username: varchar7("username", { length: 255 })
|
|
2682
2682
|
});
|
|
2683
2683
|
var linkedProviderGrantsTable = pgTable7("linked_provider_grants", {
|
|
2684
2684
|
access_token_ciphertext: text3("access_token_ciphertext"),
|
|
2685
2685
|
auth_provider_key: varchar7("auth_provider_key", { length: 64 }).notNull(),
|
|
2686
|
-
created_at: timestamp("created_at").notNull().defaultNow(),
|
|
2687
|
-
expires_at: timestamp("expires_at"),
|
|
2686
|
+
created_at: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
2687
|
+
expires_at: timestamp("expires_at", { withTimezone: true }),
|
|
2688
2688
|
granted_scopes: jsonb3("granted_scopes").$type().notNull().default([]),
|
|
2689
2689
|
id: varchar7("id", { length: 255 }).primaryKey(),
|
|
2690
2690
|
last_refresh_error: text3("last_refresh_error"),
|
|
2691
|
-
last_refreshed_at: timestamp("last_refreshed_at"),
|
|
2691
|
+
last_refreshed_at: timestamp("last_refreshed_at", { withTimezone: true }),
|
|
2692
2692
|
metadata: jsonb3("metadata").$type().default({}),
|
|
2693
2693
|
owner_ref: varchar7("owner_ref", { length: 255 }).notNull(),
|
|
2694
2694
|
provider_family: varchar7("provider_family", { length: 64 }).notNull(),
|
|
@@ -2696,7 +2696,7 @@ var linkedProviderGrantsTable = pgTable7("linked_provider_grants", {
|
|
|
2696
2696
|
refresh_token_ciphertext: text3("refresh_token_ciphertext"),
|
|
2697
2697
|
status: varchar7("status", { length: 64 }).$type().notNull(),
|
|
2698
2698
|
token_type: varchar7("token_type", { length: 64 }),
|
|
2699
|
-
updated_at: timestamp("updated_at").notNull().defaultNow()
|
|
2699
|
+
updated_at: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow()
|
|
2700
2700
|
});
|
|
2701
2701
|
|
|
2702
2702
|
// src/lockout/postgresLockoutStore.ts
|
|
@@ -3659,5 +3659,5 @@ var main = async () => {
|
|
|
3659
3659
|
};
|
|
3660
3660
|
await main();
|
|
3661
3661
|
|
|
3662
|
-
//# debugId=
|
|
3662
|
+
//# debugId=1171B72D10FC06DD64756E2164756E21
|
|
3663
3663
|
//# sourceMappingURL=migrate.js.map
|