@codelitdev/oauth-server-kit 0.1.0-alpha.2 → 0.3.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/README.md CHANGED
@@ -50,6 +50,8 @@ application.
50
50
 
51
51
  - OAuth Dynamic Client Registration is disabled unless explicitly enabled.
52
52
  - Unauthenticated DCR requires a separate explicit opt-in.
53
+ - MCP client metadata documents (CIMD) are configured through the product's
54
+ Better Auth plugins; see the integration guide for the secure fetch transport.
53
55
  - Issuer and audience/resource are verified for every bearer token.
54
56
  - Invalid explicit bearer tokens fail closed.
55
57
  - Ordinary-login redirects are restricted to configured origins.
package/dist/mcp.d.mts CHANGED
@@ -4,7 +4,11 @@ import '@better-auth/oauth-provider/resource-client';
4
4
 
5
5
  interface BetterAuthMetadataApi {
6
6
  options: {
7
- baseURL?: string;
7
+ /**
8
+ * Better Auth 1.7 also accepts a dynamic base URL config; discovery
9
+ * metadata needs one static origin, so only a string is accepted.
10
+ */
11
+ baseURL?: unknown;
8
12
  basePath?: string;
9
13
  };
10
14
  api: {
package/dist/mcp.d.ts CHANGED
@@ -4,7 +4,11 @@ import '@better-auth/oauth-provider/resource-client';
4
4
 
5
5
  interface BetterAuthMetadataApi {
6
6
  options: {
7
- baseURL?: string;
7
+ /**
8
+ * Better Auth 1.7 also accepts a dynamic base URL config; discovery
9
+ * metadata needs one static origin, so only a string is accepted.
10
+ */
11
+ baseURL?: unknown;
8
12
  basePath?: string;
9
13
  };
10
14
  api: {
package/dist/mcp.js CHANGED
@@ -38,12 +38,16 @@ function normalizeOptions(options) {
38
38
  if (process.env.NODE_ENV === "production" && resource.protocol !== "https:") {
39
39
  throw new Error("resourceUrl must use https in production");
40
40
  }
41
- if (!options.auth.options.baseURL) {
41
+ const baseURL = options.auth.options.baseURL;
42
+ if (!baseURL) {
42
43
  throw new Error("auth.options.baseURL must be configured");
43
44
  }
45
+ if (typeof baseURL !== "string") {
46
+ throw new Error("auth.options.baseURL must be a static URL string");
47
+ }
44
48
  let authorizationServerBase;
45
49
  try {
46
- authorizationServerBase = new URL(options.auth.options.baseURL);
50
+ authorizationServerBase = new URL(baseURL);
47
51
  } catch (e) {
48
52
  throw new Error("auth.options.baseURL must be an absolute URL");
49
53
  }
package/dist/mcp.mjs CHANGED
@@ -18,12 +18,16 @@ function normalizeOptions(options) {
18
18
  if (process.env.NODE_ENV === "production" && resource.protocol !== "https:") {
19
19
  throw new Error("resourceUrl must use https in production");
20
20
  }
21
- if (!options.auth.options.baseURL) {
21
+ const baseURL = options.auth.options.baseURL;
22
+ if (!baseURL) {
22
23
  throw new Error("auth.options.baseURL must be configured");
23
24
  }
25
+ if (typeof baseURL !== "string") {
26
+ throw new Error("auth.options.baseURL must be a static URL string");
27
+ }
24
28
  let authorizationServerBase;
25
29
  try {
26
- authorizationServerBase = new URL(options.auth.options.baseURL);
30
+ authorizationServerBase = new URL(baseURL);
27
31
  } catch (e) {
28
32
  throw new Error("auth.options.baseURL must be an absolute URL");
29
33
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codelitdev/oauth-server-kit",
3
- "version": "0.1.0-alpha.2",
3
+ "version": "0.3.0",
4
4
  "description": "Lean Better Auth OAuth authentication framework for web, mobile, REST, and MCP surfaces.",
5
5
  "author": "CodeLit",
6
6
  "license": "MIT",