@better-auth/cimd 1.7.0-rc.0 → 1.7.0-rc.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/dist/index.d.mts +1 -3
- package/dist/index.mjs +7 -7
- package/package.json +8 -8
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { ClientDiscovery, SchemaClient, Scope } from "@better-auth/oauth-provider";
|
|
2
|
-
import * as better_auth0 from "better-auth";
|
|
3
2
|
import { GenericEndpointContext } from "@better-auth/core";
|
|
4
|
-
|
|
5
3
|
//#region src/types.d.ts
|
|
6
4
|
/**
|
|
7
5
|
* Options for the Client ID Metadata Document plugin.
|
|
@@ -160,7 +158,7 @@ declare function cimdClientDiscovery(options?: CimdOptions): ClientDiscovery;
|
|
|
160
158
|
declare const cimd: (options?: CimdOptions) => {
|
|
161
159
|
id: "cimd";
|
|
162
160
|
version: string;
|
|
163
|
-
init(ctx:
|
|
161
|
+
init(ctx: import("better-auth").AuthContext): void;
|
|
164
162
|
};
|
|
165
163
|
//#endregion
|
|
166
164
|
export { type CimdOptions, type ClientIdMetadataDocumentResult, type ClientIdUrlOptions, cimd, cimdClientDiscovery, createCimdResolver, isUrlClientId, validateCimdMetadata, validateClientIdUrl };
|
package/dist/index.mjs
CHANGED
|
@@ -5,14 +5,14 @@ import { APIError } from "better-call";
|
|
|
5
5
|
import { isLoopbackHost, isPublicRoutableHost } from "@better-auth/core/utils/host";
|
|
6
6
|
//#region src/validate-metadata-document.ts
|
|
7
7
|
const DOT_SEGMENT_RE = /\/(?:\.|%2e)(?:\.|%2e)?(?:\/|$|#|\?)/i;
|
|
8
|
-
const PROHIBITED_FIELDS = new Set(["client_secret", "client_secret_expires_at"]);
|
|
9
|
-
const SYMMETRIC_AUTH_METHODS = new Set([
|
|
8
|
+
const PROHIBITED_FIELDS = /* @__PURE__ */ new Set(["client_secret", "client_secret_expires_at"]);
|
|
9
|
+
const SYMMETRIC_AUTH_METHODS = /* @__PURE__ */ new Set([
|
|
10
10
|
"client_secret_post",
|
|
11
11
|
"client_secret_basic",
|
|
12
12
|
"client_secret_jwt"
|
|
13
13
|
]);
|
|
14
|
-
const ALLOWED_GRANT_TYPES = new Set(["authorization_code", "refresh_token"]);
|
|
15
|
-
const ALLOWED_RESPONSE_TYPES = new Set(["code"]);
|
|
14
|
+
const ALLOWED_GRANT_TYPES = /* @__PURE__ */ new Set(["authorization_code", "refresh_token"]);
|
|
15
|
+
const ALLOWED_RESPONSE_TYPES = /* @__PURE__ */ new Set(["code"]);
|
|
16
16
|
/**
|
|
17
17
|
* Detect a URL-formatted client_id (Client ID Metadata Document pattern).
|
|
18
18
|
*
|
|
@@ -98,7 +98,7 @@ function validateCimdMetadata(fetchUrl, raw, originBoundFields) {
|
|
|
98
98
|
valid: false,
|
|
99
99
|
error: `metadata document MUST NOT contain "${field}"`
|
|
100
100
|
};
|
|
101
|
-
const ALLOWED_AUTH_METHODS = new Set(["none", "private_key_jwt"]);
|
|
101
|
+
const ALLOWED_AUTH_METHODS = /* @__PURE__ */ new Set(["none", "private_key_jwt"]);
|
|
102
102
|
if (doc.token_endpoint_auth_method !== void 0 && typeof doc.token_endpoint_auth_method !== "string") return {
|
|
103
103
|
valid: false,
|
|
104
104
|
error: "token_endpoint_auth_method must be a string"
|
|
@@ -263,7 +263,7 @@ async function readBodyWithLimit(response, max) {
|
|
|
263
263
|
* document MUST NOT be able to weaken the server's PKCE policy or escalate
|
|
264
264
|
* admin-only flags.
|
|
265
265
|
*/
|
|
266
|
-
const ALLOWED_METADATA_FIELDS = new Set([
|
|
266
|
+
const ALLOWED_METADATA_FIELDS = /* @__PURE__ */ new Set([
|
|
267
267
|
"client_id",
|
|
268
268
|
"redirect_uris",
|
|
269
269
|
"token_endpoint_auth_method",
|
|
@@ -516,7 +516,7 @@ function createCimdResolver(cimdOptions = {}) {
|
|
|
516
516
|
}
|
|
517
517
|
//#endregion
|
|
518
518
|
//#region src/version.ts
|
|
519
|
-
const PACKAGE_VERSION = "1.7.0-rc.
|
|
519
|
+
const PACKAGE_VERSION = "1.7.0-rc.2";
|
|
520
520
|
//#endregion
|
|
521
521
|
//#region src/index.ts
|
|
522
522
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@better-auth/cimd",
|
|
3
|
-
"version": "1.7.0-rc.
|
|
3
|
+
"version": "1.7.0-rc.2",
|
|
4
4
|
"description": "Client ID Metadata Document plugin for Better Auth",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -47,16 +47,16 @@
|
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"listhen": "^1.9.0",
|
|
50
|
-
"tsdown": "0.
|
|
51
|
-
"@better-auth/core": "1.7.0-rc.
|
|
52
|
-
"@better-auth/oauth-provider": "1.7.0-rc.
|
|
53
|
-
"better-auth": "1.7.0-rc.
|
|
50
|
+
"tsdown": "0.22.7",
|
|
51
|
+
"@better-auth/core": "1.7.0-rc.2",
|
|
52
|
+
"@better-auth/oauth-provider": "1.7.0-rc.2",
|
|
53
|
+
"better-auth": "1.7.0-rc.2"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"better-call": "1.3.7",
|
|
57
|
-
"@better-auth/core": "^1.7.0-rc.
|
|
58
|
-
"@better-auth/oauth-provider": "^1.7.0-rc.
|
|
59
|
-
"better-auth": "^1.7.0-rc.
|
|
57
|
+
"@better-auth/core": "^1.7.0-rc.2",
|
|
58
|
+
"@better-auth/oauth-provider": "^1.7.0-rc.2",
|
|
59
|
+
"better-auth": "^1.7.0-rc.2"
|
|
60
60
|
},
|
|
61
61
|
"scripts": {
|
|
62
62
|
"build": "tsdown",
|