chenhunghan commited on
Commit
fd4175d
·
unverified ·
1 Parent(s): 611db59

fix: change to x-scim-api-token

Browse files

Signed-off-by: Hung-Han (Henry) Chen <[email protected]>

AGENTS.md CHANGED
@@ -50,7 +50,7 @@ Creates a SCIM user resource by sending a POST request to the SCIM provider's `/
50
 
51
  **Required Headers**:
52
 
53
- - `x-scim-api-key`: Bearer token for SCIM API authentication
54
  - `x-scim-base-url`: Base URL of the SCIM provider
55
 
56
  **Parameters**: Full SCIM User resource including:
@@ -142,7 +142,7 @@ Required for SCIM operations:
142
 
143
  - Headers passed per-request (no env vars needed for auth)
144
  - SCIM credentials provided via HTTP headers:
145
- - `x-scim-api-key`: API token/bearer token
146
  - `x-scim-base-url`: SCIM provider base URL
147
 
148
  ## Development Workflow
 
50
 
51
  **Required Headers**:
52
 
53
+ - `x-scim-api-token`: Bearer token for SCIM API authentication
54
  - `x-scim-base-url`: Base URL of the SCIM provider
55
 
56
  **Parameters**: Full SCIM User resource including:
 
142
 
143
  - Headers passed per-request (no env vars needed for auth)
144
  - SCIM credentials provided via HTTP headers:
145
+ - `x-scim-api-token`: API token/bearer token
146
  - `x-scim-base-url`: SCIM provider base URL
147
 
148
  ## Development Workflow
README.md CHANGED
@@ -19,7 +19,7 @@ On Alpic
19
  ```toml
20
  [mcp_servers.scim]
21
  command = "npx"
22
- args = ["-y", "mcp-remote@latest", "https://scim-mcp-d8a54d7b.alpic.live/", "--header", "x-scim-api-key:${SCIM_AUTH_TOKEN}", "--header", "x-scim-base-url:https://service.provider.scim.base.url"]
23
  ```
24
 
25
  ## Development
 
19
  ```toml
20
  [mcp_servers.scim]
21
  command = "npx"
22
+ args = ["-y", "mcp-remote@latest", "https://scim-mcp-d8a54d7b.alpic.live/", "--header", "x-scim-api-token:${SCIM_AUTH_TOKEN}", "--header", "x-scim-base-url:https://service.provider.scim.base.url"]
23
  ```
24
 
25
  ## Development
src/resources/(groups)/[groupId]/index.ts CHANGED
@@ -36,7 +36,7 @@ export default async function handler({
36
  const baseUrl = getScimBaseUrl(requestHeaders);
37
 
38
  if (!apiToken) {
39
- throw new Error("Missing required headers: x-scim-api-key");
40
  }
41
 
42
  if (!baseUrl) {
 
36
  const baseUrl = getScimBaseUrl(requestHeaders);
37
 
38
  if (!apiToken) {
39
+ throw new Error("Missing required headers: x-scim-api-token");
40
  }
41
 
42
  if (!baseUrl) {
src/resources/(groups)/index.ts CHANGED
@@ -41,7 +41,7 @@ export default async function handler({
41
  const baseUrl = getScimBaseUrl(requestHeaders);
42
 
43
  if (!apiToken) {
44
- throw new Error("Missing required headers: x-scim-api-key");
45
  }
46
 
47
  if (!baseUrl) {
 
41
  const baseUrl = getScimBaseUrl(requestHeaders);
42
 
43
  if (!apiToken) {
44
+ throw new Error("Missing required headers: x-scim-api-token");
45
  }
46
 
47
  if (!baseUrl) {
src/resources/(users)/[userId]/index.ts CHANGED
@@ -36,7 +36,7 @@ export default async function handler({
36
  const baseUrl = getScimBaseUrl(requestHeaders);
37
 
38
  if (!apiToken) {
39
- throw new Error("Missing required headers: x-scim-api-key");
40
  }
41
 
42
  if (!baseUrl) {
 
36
  const baseUrl = getScimBaseUrl(requestHeaders);
37
 
38
  if (!apiToken) {
39
+ throw new Error("Missing required headers: x-scim-api-token");
40
  }
41
 
42
  if (!baseUrl) {
src/resources/(users)/index.ts CHANGED
@@ -41,7 +41,7 @@ export default async function handler({
41
  const baseUrl = getScimBaseUrl(requestHeaders);
42
 
43
  if (!apiToken) {
44
- throw new Error("Missing required headers: x-scim-api-key");
45
  }
46
 
47
  if (!baseUrl) {
 
41
  const baseUrl = getScimBaseUrl(requestHeaders);
42
 
43
  if (!apiToken) {
44
+ throw new Error("Missing required headers: x-scim-api-token");
45
  }
46
 
47
  if (!baseUrl) {
src/tools/addUserToGroup.ts CHANGED
@@ -30,7 +30,7 @@ export default async function addUserToGroup(
30
  const baseUrl = getScimBaseUrl(requestHeaders);
31
 
32
  if (!apiToken) {
33
- throw new Error("Missing required headers: x-scim-api-key");
34
  }
35
 
36
  if (!baseUrl) {
 
30
  const baseUrl = getScimBaseUrl(requestHeaders);
31
 
32
  if (!apiToken) {
33
+ throw new Error("Missing required headers: x-scim-api-token");
34
  }
35
 
36
  if (!baseUrl) {
src/tools/createGroup.ts CHANGED
@@ -36,7 +36,7 @@ export default async function createGroup(
36
  const baseUrl = getScimBaseUrl(requestHeaders);
37
 
38
  if (!apiToken) {
39
- throw new Error("Missing required headers: x-scim-api-key");
40
  }
41
 
42
  if (!baseUrl) {
 
36
  const baseUrl = getScimBaseUrl(requestHeaders);
37
 
38
  if (!apiToken) {
39
+ throw new Error("Missing required headers: x-scim-api-token");
40
  }
41
 
42
  if (!baseUrl) {
src/tools/createUser.ts CHANGED
@@ -36,7 +36,7 @@ export default async function createUser(
36
  const baseUrl = getScimBaseUrl(requestHeaders);
37
 
38
  if (!apiToken) {
39
- throw new Error("Missing required headers: x-scim-api-key");
40
  }
41
 
42
  if (!baseUrl) {
 
36
  const baseUrl = getScimBaseUrl(requestHeaders);
37
 
38
  if (!apiToken) {
39
+ throw new Error("Missing required headers: x-scim-api-token");
40
  }
41
 
42
  if (!baseUrl) {
src/tools/deleteGroup.ts CHANGED
@@ -28,7 +28,7 @@ export default async function deleteGroup(
28
  const baseUrl = getScimBaseUrl(requestHeaders);
29
 
30
  if (!apiToken) {
31
- throw new Error("Missing required headers: x-scim-api-key");
32
  }
33
 
34
  if (!baseUrl) {
 
28
  const baseUrl = getScimBaseUrl(requestHeaders);
29
 
30
  if (!apiToken) {
31
+ throw new Error("Missing required headers: x-scim-api-token");
32
  }
33
 
34
  if (!baseUrl) {
src/tools/deleteUser.ts CHANGED
@@ -28,7 +28,7 @@ export default async function deleteUser(
28
  const baseUrl = getScimBaseUrl(requestHeaders);
29
 
30
  if (!apiToken) {
31
- throw new Error("Missing required headers: x-scim-api-key");
32
  }
33
 
34
  if (!baseUrl) {
 
28
  const baseUrl = getScimBaseUrl(requestHeaders);
29
 
30
  if (!apiToken) {
31
+ throw new Error("Missing required headers: x-scim-api-token");
32
  }
33
 
34
  if (!baseUrl) {
src/tools/patchGroup.ts CHANGED
@@ -31,7 +31,7 @@ export default async function patchGroup(
31
  const baseUrl = getScimBaseUrl(requestHeaders);
32
 
33
  if (!apiToken) {
34
- throw new Error("Missing required headers: x-scim-api-key");
35
  }
36
 
37
  if (!baseUrl) {
 
31
  const baseUrl = getScimBaseUrl(requestHeaders);
32
 
33
  if (!apiToken) {
34
+ throw new Error("Missing required headers: x-scim-api-token");
35
  }
36
 
37
  if (!baseUrl) {
src/tools/patchUser.ts CHANGED
@@ -31,7 +31,7 @@ export default async function patchUser(
31
  const baseUrl = getScimBaseUrl(requestHeaders);
32
 
33
  if (!apiToken) {
34
- throw new Error("Missing required headers: x-scim-api-key");
35
  }
36
 
37
  if (!baseUrl) {
 
31
  const baseUrl = getScimBaseUrl(requestHeaders);
32
 
33
  if (!apiToken) {
34
+ throw new Error("Missing required headers: x-scim-api-token");
35
  }
36
 
37
  if (!baseUrl) {
src/tools/removeUserFromGroup.ts CHANGED
@@ -30,7 +30,7 @@ export default async function removeUserFromGroup(
30
  const baseUrl = getScimBaseUrl(requestHeaders);
31
 
32
  if (!apiToken) {
33
- throw new Error("Missing required headers: x-scim-api-key");
34
  }
35
 
36
  if (!baseUrl) {
 
30
  const baseUrl = getScimBaseUrl(requestHeaders);
31
 
32
  if (!apiToken) {
33
+ throw new Error("Missing required headers: x-scim-api-token");
34
  }
35
 
36
  if (!baseUrl) {
src/tools/replaceGroup.ts CHANGED
@@ -31,7 +31,7 @@ export default async function replaceGroup(
31
  const baseUrl = getScimBaseUrl(requestHeaders);
32
 
33
  if (!apiToken) {
34
- throw new Error("Missing required headers: x-scim-api-key");
35
  }
36
 
37
  if (!baseUrl) {
 
31
  const baseUrl = getScimBaseUrl(requestHeaders);
32
 
33
  if (!apiToken) {
34
+ throw new Error("Missing required headers: x-scim-api-token");
35
  }
36
 
37
  if (!baseUrl) {
src/tools/replaceUser.ts CHANGED
@@ -31,7 +31,7 @@ export default async function replaceUser(
31
  const baseUrl = getScimBaseUrl(requestHeaders);
32
 
33
  if (!apiToken) {
34
- throw new Error("Missing required headers: x-scim-api-key");
35
  }
36
 
37
  if (!baseUrl) {
 
31
  const baseUrl = getScimBaseUrl(requestHeaders);
32
 
33
  if (!apiToken) {
34
+ throw new Error("Missing required headers: x-scim-api-token");
35
  }
36
 
37
  if (!baseUrl) {
src/utils/getSCIMBaseUrl.ts CHANGED
@@ -6,7 +6,7 @@ export function getScimBaseUrl(headers: Headers): string {
6
  if (process.env.SCIM_API_BASE_URL) {
7
  baseUrl = process.env.SCIM_API_BASE_URL;
8
  }
9
- const baseUrlFromHeader = headers["x-scim-base-url"] || headers["X-SCIM-BASE-URL"];
10
  if (typeof baseUrlFromHeader === "string") {
11
  baseUrl = baseUrlFromHeader.trim();
12
  }
 
6
  if (process.env.SCIM_API_BASE_URL) {
7
  baseUrl = process.env.SCIM_API_BASE_URL;
8
  }
9
+ const baseUrlFromHeader = headers["x-scim-base-url"];
10
  if (typeof baseUrlFromHeader === "string") {
11
  baseUrl = baseUrlFromHeader.trim();
12
  }
src/utils/getSCIMToken.ts CHANGED
@@ -8,7 +8,7 @@ export function getScimToken(headers: Headers): string {
8
  if (process.env.SCIM_API_TOKEN) {
9
  token = process.env.SCIM_API_TOKEN;
10
  }
11
- const tokenFromHeader = headers["x-scim-api-key"] || headers["X-SCIM-API-KEY"];
12
  if (typeof tokenFromHeader === "string") {
13
  token = tokenFromHeader.trim();
14
  }
 
8
  if (process.env.SCIM_API_TOKEN) {
9
  token = process.env.SCIM_API_TOKEN;
10
  }
11
+ const tokenFromHeader = headers["x-scim-api-token"];
12
  if (typeof tokenFromHeader === "string") {
13
  token = tokenFromHeader.trim();
14
  }