@absolutejs/auth 0.78.0 → 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 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
+ }
@@ -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 `/oauth2/token`). */
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;