@didit-protocol/mcp-server 5.1.54 → 5.1.63
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 +14 -4
- package/dist/accept.d.ts +54 -0
- package/dist/accept.d.ts.map +1 -0
- package/dist/accept.js +98 -0
- package/dist/accept.js.map +1 -0
- package/dist/audit-log.d.ts.map +1 -1
- package/dist/audit-log.js +13 -4
- package/dist/audit-log.js.map +1 -1
- package/dist/auth/refusal-log.d.ts +62 -0
- package/dist/auth/refusal-log.d.ts.map +1 -0
- package/dist/auth/refusal-log.js +131 -0
- package/dist/auth/refusal-log.js.map +1 -0
- package/dist/chatgpt-app.d.ts +1 -0
- package/dist/chatgpt-app.d.ts.map +1 -1
- package/dist/chatgpt-app.js +4 -0
- package/dist/chatgpt-app.js.map +1 -1
- package/dist/config.d.ts +17 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +62 -9
- package/dist/config.js.map +1 -1
- package/dist/connect-page.d.ts +10 -0
- package/dist/connect-page.d.ts.map +1 -0
- package/dist/connect-page.js +8 -0
- package/dist/connect-page.js.map +1 -0
- package/dist/connection-timeouts.d.ts +30 -0
- package/dist/connection-timeouts.d.ts.map +1 -0
- package/dist/connection-timeouts.js +52 -0
- package/dist/connection-timeouts.js.map +1 -0
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +95 -7
- package/dist/http.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +209 -3242
- package/dist/index.js.map +1 -1
- package/dist/permissions.d.ts.map +1 -1
- package/dist/permissions.js +3 -153
- package/dist/permissions.js.map +1 -1
- package/dist/release-version.d.ts +45 -0
- package/dist/release-version.d.ts.map +1 -0
- package/dist/release-version.js +90 -0
- package/dist/release-version.js.map +1 -0
- package/dist/schema/feature-config-schema.json +43 -4
- package/dist/security.d.ts.map +1 -1
- package/dist/security.js +41 -2
- package/dist/security.js.map +1 -1
- package/dist/tools/billing.d.ts +2 -0
- package/dist/tools/billing.d.ts.map +1 -1
- package/dist/tools/billing.js +124 -1
- package/dist/tools/billing.js.map +1 -1
- package/dist/tools/blocklist.d.ts +2 -0
- package/dist/tools/blocklist.d.ts.map +1 -1
- package/dist/tools/blocklist.js +94 -0
- package/dist/tools/blocklist.js.map +1 -1
- package/dist/tools/businesses.d.ts +2 -0
- package/dist/tools/businesses.d.ts.map +1 -1
- package/dist/tools/businesses.js +129 -0
- package/dist/tools/businesses.js.map +1 -1
- package/dist/tools/cases.d.ts +2 -0
- package/dist/tools/cases.d.ts.map +1 -1
- package/dist/tools/cases.js +131 -0
- package/dist/tools/cases.js.map +1 -1
- package/dist/tools/customization.d.ts +2 -0
- package/dist/tools/customization.d.ts.map +1 -1
- package/dist/tools/customization.js +43 -0
- package/dist/tools/customization.js.map +1 -1
- package/dist/tools/feature-config.d.ts +45 -0
- package/dist/tools/feature-config.d.ts.map +1 -1
- package/dist/tools/feature-config.js +100 -9
- package/dist/tools/feature-config.js.map +1 -1
- package/dist/tools/lists.d.ts +2 -0
- package/dist/tools/lists.d.ts.map +1 -1
- package/dist/tools/lists.js +193 -0
- package/dist/tools/lists.js.map +1 -1
- package/dist/tools/members.d.ts +2 -0
- package/dist/tools/members.d.ts.map +1 -1
- package/dist/tools/members.js +141 -0
- package/dist/tools/members.js.map +1 -1
- package/dist/tools/observability.d.ts +2 -0
- package/dist/tools/observability.d.ts.map +1 -1
- package/dist/tools/observability.js +77 -0
- package/dist/tools/observability.js.map +1 -1
- package/dist/tools/questionnaires.d.ts +2 -0
- package/dist/tools/questionnaires.d.ts.map +1 -1
- package/dist/tools/questionnaires.js +171 -0
- package/dist/tools/questionnaires.js.map +1 -1
- package/dist/tools/registered.d.ts +5 -0
- package/dist/tools/registered.d.ts.map +1 -0
- package/dist/tools/registered.js +30 -0
- package/dist/tools/registered.js.map +1 -0
- package/dist/tools/registry.d.ts +47 -0
- package/dist/tools/registry.d.ts.map +1 -0
- package/dist/tools/registry.js +40 -0
- package/dist/tools/registry.js.map +1 -0
- package/dist/tools/reports.d.ts +2 -0
- package/dist/tools/reports.d.ts.map +1 -1
- package/dist/tools/reports.js +65 -0
- package/dist/tools/reports.js.map +1 -1
- package/dist/tools/search.d.ts +2 -0
- package/dist/tools/search.d.ts.map +1 -1
- package/dist/tools/search.js +133 -3
- package/dist/tools/search.js.map +1 -1
- package/dist/tools/sessions.d.ts +3 -0
- package/dist/tools/sessions.d.ts.map +1 -1
- package/dist/tools/sessions.js +715 -8
- package/dist/tools/sessions.js.map +1 -1
- package/dist/tools/settings.d.ts +19 -0
- package/dist/tools/settings.d.ts.map +1 -1
- package/dist/tools/settings.js +93 -5
- package/dist/tools/settings.js.map +1 -1
- package/dist/tools/shared-schema.d.ts +27 -0
- package/dist/tools/shared-schema.d.ts.map +1 -0
- package/dist/tools/shared-schema.js +68 -0
- package/dist/tools/shared-schema.js.map +1 -0
- package/dist/tools/standalone.d.ts +6 -0
- package/dist/tools/standalone.d.ts.map +1 -1
- package/dist/tools/standalone.js +366 -0
- package/dist/tools/standalone.js.map +1 -1
- package/dist/tools/transactions.d.ts +3 -0
- package/dist/tools/transactions.d.ts.map +1 -1
- package/dist/tools/transactions.js +512 -0
- package/dist/tools/transactions.js.map +1 -1
- package/dist/tools/users.d.ts +2 -0
- package/dist/tools/users.d.ts.map +1 -1
- package/dist/tools/users.js +137 -0
- package/dist/tools/users.js.map +1 -1
- package/dist/tools/webhooks.d.ts +2 -0
- package/dist/tools/webhooks.d.ts.map +1 -1
- package/dist/tools/webhooks.js +98 -0
- package/dist/tools/webhooks.js.map +1 -1
- package/dist/tools/workflow-graph.d.ts +1 -0
- package/dist/tools/workflow-graph.d.ts.map +1 -1
- package/dist/tools/workflow-graph.js +107 -39
- package/dist/tools/workflow-graph.js.map +1 -1
- package/dist/tools/workflows.d.ts +3 -0
- package/dist/tools/workflows.d.ts.map +1 -0
- package/dist/tools/workflows.js +440 -0
- package/dist/tools/workflows.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -55,6 +55,9 @@ No install, no API key — point your client at the hosted URL and sign in via t
|
|
|
55
55
|
https://mcp.didit.me/mcp
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
+
Opening [mcp.didit.me](https://mcp.didit.me/) in a browser shows the same links as one-step buttons for each client.
|
|
59
|
+
A client that was given the address without the path, `https://mcp.didit.me`, reaches the same server: the bare address answers MCP requests exactly as `/mcp` does.
|
|
60
|
+
|
|
58
61
|
| Client | Install |
|
|
59
62
|
|---|---|
|
|
60
63
|
| **Claude** (web, Desktop) | [Add Didit to Claude](https://claude.ai/customize/connectors?modal=add-custom-connector&connectorName=Didit&connectorUrl=https://mcp.didit.me/mcp) |
|
|
@@ -331,6 +334,9 @@ node dist/http.js # hosted HTTP/OAuth
|
|
|
331
334
|
DIDIT_ACCESS_TOKEN=<user-access-token> node dist/index.js # stdio (headless)
|
|
332
335
|
```
|
|
333
336
|
|
|
337
|
+
Behind a load balancer, the server has to keep an idle connection open for longer than the balancer does, or the balancer answers `502` for requests it sent down a connection the server was closing.
|
|
338
|
+
The server keeps one for 65 seconds, which fits a balancer that closes idle connections after 60; set `MCP_KEEP_ALIVE_TIMEOUT_MS` above your balancer's idle timeout when that one is longer.
|
|
339
|
+
|
|
334
340
|
All Didit base URLs and OAuth endpoints are environment variables with public defaults (`verification.didit.me`, `apx.didit.me`, `business.didit.me`) — override them for a private deployment. See [`ARCHITECTURE.md`](ARCHITECTURE.md) and [`.env.example`](.env.example) for the full reference.
|
|
335
341
|
|
|
336
342
|
## Workflow feature configuration
|
|
@@ -344,7 +350,7 @@ A key that is not listed here is not part of the contract and is dropped silentl
|
|
|
344
350
|
|
|
345
351
|
<!-- BEGIN GENERATED FEATURE CONFIG REFERENCE -->
|
|
346
352
|
|
|
347
|
-
_Generated from `schema/feature-config-schema.json` (contract `sha256:
|
|
353
|
+
_Generated from `schema/feature-config-schema.json` (contract `sha256:3df917c2503102db29867d1aabd2f78d78b440163e47b4044fc85aaf0c7de26a`, schema version 1), which is a copy of the artifact `service-didit-verification` generates from its feature-config serializers. Do not edit by hand — run `npm run schema:readme`._
|
|
348
354
|
|
|
349
355
|
### AGE_ESTIMATION
|
|
350
356
|
|
|
@@ -377,7 +383,7 @@ Configuration for Age Estimation feature.
|
|
|
377
383
|
| `face_quality_decline_threshold` | integer \| null | integer >=0 <=100 | |
|
|
378
384
|
| `face_quality_review_threshold` | integer \| null | integer >=0 <=100 | |
|
|
379
385
|
| `face_search_enabled` | boolean \| null | boolean | Run the 1:N Face Search on the selfie: match it against previously verified users, the face blocklist and allowlist, and store its biometric template for later matching. On by default. Off skips the search, keeps no face template, and leaves the duplicate-face actions with nothing to act on. |
|
|
380
|
-
| `frame_injection_action` | string \| null | 'NO_ACTION'\|'REVIEW'\|'DECLINE' | Verdict when injected
|
|
386
|
+
| `frame_injection_action` | string \| null | 'NO_ACTION'\|'REVIEW'\|'DECLINE' | Verdict when the camera that captured the selfie shows signs of injected frames (FRAME_INJECTION_SUSPECTED, and INJECTION_ATTACK_DETECTED when the injection is proven). Defaults to NO_ACTION. |
|
|
381
387
|
| `minimum_age_threshold` | integer \| null | integer >=1 <=100 | |
|
|
382
388
|
| `screen_capture_action` | string \| null | 'NO_ACTION'\|'REVIEW'\|'DECLINE' | Verdict when the selfie is a photo of a screen. |
|
|
383
389
|
| `status_rules` | array | array | |
|
|
@@ -556,6 +562,7 @@ Configuration for Face Match feature.
|
|
|
556
562
|
| --- | --- | --- | --- |
|
|
557
563
|
| `face_match_eyes_covered_action` | string | 'NO_ACTION'\|'REVIEW'\|'DECLINE' | Verdict when calibrated evidence says the eyes region is covered in the selfie. NO_ACTION records evidence without changing Face Match; REVIEW sends Face Match to review; DECLINE declines it. The signal remains shadow-only until the region reports calibrated=true. |
|
|
558
564
|
| `face_match_face_covered_action` | string | 'NO_ACTION'\|'REVIEW'\|'DECLINE' | Verdict when calibrated evidence says the face region is covered in the selfie. NO_ACTION records evidence without changing Face Match; REVIEW sends Face Match to review; DECLINE declines it. The signal remains shadow-only until the region reports calibrated=true. |
|
|
565
|
+
| `face_match_frame_injection_action` | string \| null | 'NO_ACTION'\|'REVIEW'\|'DECLINE' | Verdict when the camera that captured this step's selfie shows signs of injected frames (FRAME_INJECTION_SUSPECTED, and INJECTION_ATTACK_DETECTED when the injection is proven). It applies when the Face Match step captures the selfie itself; a selfie taken by a Liveness step follows that step's frame_injection_action. Defaults to NO_ACTION. |
|
|
559
566
|
| `face_match_max_attempts` | integer \| null | integer >=1 <=3 | |
|
|
560
567
|
| `face_match_mouth_covered_action` | string | 'NO_ACTION'\|'REVIEW'\|'DECLINE' | Verdict when calibrated evidence says the mouth region is covered in the selfie. NO_ACTION records evidence without changing Face Match; REVIEW sends Face Match to review; DECLINE declines it. The signal remains shadow-only until the region reports calibrated=true. |
|
|
561
568
|
| `face_match_not_computed_action` | string \| null | 'REVIEW'\|'DECLINE' | Verdict when no face-match score could be produced (missing portrait or selfie). |
|
|
@@ -666,8 +673,10 @@ Configuration for Device & IP Analysis feature.
|
|
|
666
673
|
| Key | Type | Accepts | Meaning |
|
|
667
674
|
| --- | --- | --- | --- |
|
|
668
675
|
| `kyb_corporate_ubo_verification_workflow` | uuid \| null | uuid | |
|
|
676
|
+
| `kyb_key_people_allow_listed_company_declaration` | boolean \| null | boolean | Let the company declare it is listed on a stock exchange, or owned by a listed company, instead of naming a beneficial owner. It must still name at least one director or other senior managing official. Off by default: without it a beneficial owner is required. |
|
|
669
677
|
| `kyb_key_people_company_fields` | json \| null | [{"key": "<field key>", "label": "<label>", "type": "text"\|"number"\|"date"\|"phone"\|"email", "required": true\|false, "custom": true\|false}] | Which company details are collected for a CORPORATE key person. Same list-of-descriptors shape and same rules as `kyb_key_people_person_fields`. |
|
|
670
678
|
| `kyb_key_people_document_mismatch_action` | string \| null | 'NO_ACTION'\|'REVIEW'\|'DECLINE' | Verdict when a key person's document disagrees with the details declared for them. |
|
|
679
|
+
| `kyb_key_people_listed_company_action` | string \| null | 'NO_ACTION'\|'REVIEW'\|'DECLINE' | Verdict when the company makes the listed-company declaration (`KYB_LISTED_COMPANY_DECLARED`). REVIEW (the default) sends the session to an analyst to confirm the listing, NO_ACTION leaves the Key People outcome unchanged, DECLINE declines it. Only applies while `kyb_key_people_allow_listed_company_declaration` is on. |
|
|
671
680
|
| `kyb_key_people_ownership_required` | boolean \| null | boolean | |
|
|
672
681
|
| `kyb_key_people_person_fields` | json \| null | [{"key": "<field key>", "label": "<label>", "type": "text"\|"number"\|"date"\|"phone"\|"email", "required": true\|false, "custom": true\|false}] | Which personal details are collected for an individual key person, as an ORDERED LIST of field descriptors (not a map). `key` is required and non-empty; `type` must be one of text, number, date, phone or email; `custom` marks a field the customer added rather than one of the built-ins. |
|
|
673
682
|
| `kyb_key_people_prefill_from_registry` | boolean \| null | boolean | Pre-fill the key-people list from the company registry result, so the customer confirms and corrects rather than typing every officer and shareholder in. |
|
|
@@ -730,7 +739,7 @@ Configuration for Liveness feature.
|
|
|
730
739
|
| `face_quality_decline_threshold` | integer \| null | integer >=0 <=100 | |
|
|
731
740
|
| `face_quality_review_threshold` | integer \| null | integer >=0 <=100 | |
|
|
732
741
|
| `face_search_enabled` | boolean \| null | boolean | Run the 1:N Face Search on the selfie: match it against previously verified users, the face blocklist and allowlist, and store its biometric template for later matching. On by default. Off skips the search, keeps no face template, and leaves the duplicate-face actions with nothing to act on. |
|
|
733
|
-
| `frame_injection_action` | string \| null | 'NO_ACTION'\|'REVIEW'\|'DECLINE' | Verdict when injected
|
|
742
|
+
| `frame_injection_action` | string \| null | 'NO_ACTION'\|'REVIEW'\|'DECLINE' | Verdict when the camera that captured the selfie shows signs of injected frames (FRAME_INJECTION_SUSPECTED, and INJECTION_ATTACK_DETECTED when the injection is proven). Defaults to NO_ACTION. |
|
|
734
743
|
| `race_map_similarity_thresholds` | json | {"<race>": {"possible": 0-100, "high": 0-100}} | Per-demographic overrides of the face-similarity bands used against the allow-list and duplicate-face sets, so match rates stay even across groups. `possible` is the lower band (defaults to 62) and `high` the upper (68); a group with no entry uses those defaults. |
|
|
735
744
|
| `screen_capture_action` | string \| null | 'NO_ACTION'\|'REVIEW'\|'DECLINE' | Verdict when the selfie is a photo of a screen. |
|
|
736
745
|
| `status_rules` | array | array | |
|
|
@@ -787,7 +796,8 @@ Configuration for OCR/ID Verification feature.
|
|
|
787
796
|
| `expected_details_mismatch_action` | string \| null | 'NO_ACTION'\|'REVIEW'\|'DECLINE' | Verdict when the extracted identity contradicts the `expected_details` sent with the session. |
|
|
788
797
|
| `expiration_date_not_detected_action` | string \| null | 'NO_ACTION'\|'REVIEW'\|'DECLINE' | Verdict when no expiry date could be read from the document. |
|
|
789
798
|
| `id_document_quality_threshold` | integer \| null | integer >=0 <=100 | |
|
|
790
|
-
| `
|
|
799
|
+
| `id_verification_frame_injection_action` | string \| null | 'NO_ACTION'\|'REVIEW'\|'DECLINE' | Verdict when the camera that captured the document (or the ID-lookup selfie) shows signs of injected frames (FRAME_INJECTION_SUSPECTED). It covers every capture-integrity signal the client reports, including ones a genuine person can produce (a camera the browser does not list, replaced capture functions, an emulator, an external camera), so it defaults to NO_ACTION and the risk is logged as information. Set DECLINE or REVIEW to act on any sign of injection; the proven cases keep id_verification_injection_attack_action. |
|
|
800
|
+
| `id_verification_injection_attack_action` | string \| null | 'NO_ACTION'\|'REVIEW'\|'DECLINE' | Verdict when the document (or the ID-lookup selfie) was injected rather than captured by the device's own camera (INJECTION_ATTACK_DETECTED): a software virtual camera, a camera feed generated by the page or by browser automation, a hooked camera, or an instrumentation tool attached to the app. Defaults to DECLINE: each of these proves the frames did not come from the device's own camera. Heuristic capture signals (FRAME_INJECTION_SUSPECTED and the others) are not covered here: id_verification_frame_injection_action decides those. |
|
|
791
801
|
| `id_verification_max_retry_attempts` | integer \| null | integer >=2 <=5 | |
|
|
792
802
|
| `id_verification_name_match_score_threshold` | integer \| null | integer >=0 <=100 | |
|
|
793
803
|
| `image_capture_methods_allowed` | array \| null | ["CAMERA_SCAN" \| "UPLOAD", ...] | Capture methods the end user may use for the document photo. Declared as a list of free strings, so the vocabulary is not in the field itself: CAMERA_SCAN (live capture) and UPLOAD (pick an existing file). An empty list falls back to the account default. |
|
package/dist/accept.d.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a request's `Accept` header says, for the two places the hosted endpoint chooses between
|
|
3
|
+
* answers: an event stream or plain JSON on POST, and the page a person reads or the protocol's
|
|
4
|
+
* 405 on GET.
|
|
5
|
+
*
|
|
6
|
+
* Why: both choices used to be made by looking for a substring. The streamable-HTTP
|
|
7
|
+
* transport refuses a POST whose Accept does not name *both* `application/json` and
|
|
8
|
+
* `text/event-stream` (406), and the connect page answered any GET whose Accept merely mentioned
|
|
9
|
+
* `text/html`, redirecting a client that had asked for JSON to an HTML page. A connector that names
|
|
10
|
+
* only JSON therefore saw a refusal, or a page, at the step that adds the server — the step a
|
|
11
|
+
* connector reports as "could not verify the server" / "could not add the connector" — while a
|
|
12
|
+
* browser and the dual-Accept clients saw what they always see. These helpers read the header as
|
|
13
|
+
* the media ranges it is (RFC 9110 12.5.1), so each answer follows what the caller asked for.
|
|
14
|
+
*/
|
|
15
|
+
export interface MediaRange {
|
|
16
|
+
type: string;
|
|
17
|
+
subtype: string;
|
|
18
|
+
/** 0 when the caller explicitly refused the range (`q=0`), 1 when it named no quality. */
|
|
19
|
+
q: number;
|
|
20
|
+
}
|
|
21
|
+
/** The header's media ranges, lower-cased, each with its q-value. Anything malformed is dropped. */
|
|
22
|
+
export declare function mediaRangesOf(accept: unknown): MediaRange[];
|
|
23
|
+
/** True when the caller names this media type itself and accepts it — a wildcard does not count. */
|
|
24
|
+
export declare function namesMediaType(accept: unknown, mediaType: string): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* True when the caller accepts this media type, whether it names it or covers it with a wildcard.
|
|
27
|
+
*
|
|
28
|
+
* The most specific range that covers the type decides (RFC 9110 12.5.1): the type itself, then the
|
|
29
|
+
* wildcard for its own type, then the wildcard for everything. So a caller that accepts every
|
|
30
|
+
* `application` type and refuses `application/json;q=0` by name does not get JSON, wherever the
|
|
31
|
+
* refusal stands in the header.
|
|
32
|
+
*/
|
|
33
|
+
export declare function acceptsMediaType(accept: unknown, mediaType: string): boolean;
|
|
34
|
+
/** The transport's two answer shapes: an event stream, or one plain JSON body. */
|
|
35
|
+
export type AnswerFormat = "event-stream" | "json";
|
|
36
|
+
/**
|
|
37
|
+
* The shape to answer in: an event stream when the caller named one, which is exactly the stream every
|
|
38
|
+
* client gets today; otherwise JSON when the caller accepts it, including through a wildcard; and
|
|
39
|
+
* undefined when it accepts neither, where the transport's own 406 is the right answer.
|
|
40
|
+
*/
|
|
41
|
+
export declare function answerFormatFor(accept: unknown): AnswerFormat | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* The page that says how to connect is for a browser: a GET that names `text/html` and names neither
|
|
44
|
+
* MCP media type. A client that lists HTML among the types it can take still gets the protocol's
|
|
45
|
+
* answer, so no MCP client is ever handed the page.
|
|
46
|
+
*/
|
|
47
|
+
export declare function isBrowserNavigation(accept: unknown): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* A GET that names an MCP media type comes from a client reaching for the server. At the server's
|
|
50
|
+
* bare address, where the page is the default answer (a crawler and `curl` name no type at all), this
|
|
51
|
+
* is what tells a client from everyone else.
|
|
52
|
+
*/
|
|
53
|
+
export declare function namesMcpMediaType(accept: unknown): boolean;
|
|
54
|
+
//# sourceMappingURL=accept.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accept.d.ts","sourceRoot":"","sources":["../src/accept.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,0FAA0F;IAC1F,CAAC,EAAE,MAAM,CAAC;CACX;AAID,oGAAoG;AACpG,wBAAgB,aAAa,CAAC,MAAM,EAAE,OAAO,GAAG,UAAU,EAAE,CAe3D;AAED,oGAAoG;AACpG,wBAAgB,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAI1E;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAc5E;AAED,kFAAkF;AAClF,MAAM,MAAM,YAAY,GAAG,cAAc,GAAG,MAAM,CAAC;AAEnD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,OAAO,GAAG,YAAY,GAAG,SAAS,CAKzE;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAE5D;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAE1D"}
|
package/dist/accept.js
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* What a request's `Accept` header says, for the two places the hosted endpoint chooses between
|
|
4
|
+
* answers: an event stream or plain JSON on POST, and the page a person reads or the protocol's
|
|
5
|
+
* 405 on GET.
|
|
6
|
+
*
|
|
7
|
+
* Why: both choices used to be made by looking for a substring. The streamable-HTTP
|
|
8
|
+
* transport refuses a POST whose Accept does not name *both* `application/json` and
|
|
9
|
+
* `text/event-stream` (406), and the connect page answered any GET whose Accept merely mentioned
|
|
10
|
+
* `text/html`, redirecting a client that had asked for JSON to an HTML page. A connector that names
|
|
11
|
+
* only JSON therefore saw a refusal, or a page, at the step that adds the server — the step a
|
|
12
|
+
* connector reports as "could not verify the server" / "could not add the connector" — while a
|
|
13
|
+
* browser and the dual-Accept clients saw what they always see. These helpers read the header as
|
|
14
|
+
* the media ranges it is (RFC 9110 12.5.1), so each answer follows what the caller asked for.
|
|
15
|
+
*/
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.mediaRangesOf = mediaRangesOf;
|
|
18
|
+
exports.namesMediaType = namesMediaType;
|
|
19
|
+
exports.acceptsMediaType = acceptsMediaType;
|
|
20
|
+
exports.answerFormatFor = answerFormatFor;
|
|
21
|
+
exports.isBrowserNavigation = isBrowserNavigation;
|
|
22
|
+
exports.namesMcpMediaType = namesMcpMediaType;
|
|
23
|
+
const WILDCARD = "*";
|
|
24
|
+
/** The header's media ranges, lower-cased, each with its q-value. Anything malformed is dropped. */
|
|
25
|
+
function mediaRangesOf(accept) {
|
|
26
|
+
if (typeof accept !== "string")
|
|
27
|
+
return [];
|
|
28
|
+
return accept
|
|
29
|
+
.split(",")
|
|
30
|
+
.map((part) => {
|
|
31
|
+
const [range, ...params] = part.split(";").map((piece) => piece.trim().toLowerCase());
|
|
32
|
+
const [type, subtype] = (range ?? "").split("/");
|
|
33
|
+
if (!type || !subtype)
|
|
34
|
+
return undefined;
|
|
35
|
+
const quality = params.find((param) => param.startsWith("q="));
|
|
36
|
+
const q = quality === undefined ? 1 : Number(quality.slice(2));
|
|
37
|
+
return { type, subtype, q: Number.isFinite(q) ? q : 0 };
|
|
38
|
+
})
|
|
39
|
+
.filter((range) => range !== undefined);
|
|
40
|
+
}
|
|
41
|
+
/** True when the caller names this media type itself and accepts it — a wildcard does not count. */
|
|
42
|
+
function namesMediaType(accept, mediaType) {
|
|
43
|
+
const [type, subtype] = mediaType.toLowerCase().split("/");
|
|
44
|
+
return mediaRangesOf(accept).some((range) => range.type === type && range.subtype === subtype && range.q > 0);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* True when the caller accepts this media type, whether it names it or covers it with a wildcard.
|
|
48
|
+
*
|
|
49
|
+
* The most specific range that covers the type decides (RFC 9110 12.5.1): the type itself, then the
|
|
50
|
+
* wildcard for its own type, then the wildcard for everything. So a caller that accepts every
|
|
51
|
+
* `application` type and refuses `application/json;q=0` by name does not get JSON, wherever the
|
|
52
|
+
* refusal stands in the header.
|
|
53
|
+
*/
|
|
54
|
+
function acceptsMediaType(accept, mediaType) {
|
|
55
|
+
const [type, subtype] = mediaType.toLowerCase().split("/");
|
|
56
|
+
const specificity = (range) => {
|
|
57
|
+
if (range.type === type && range.subtype === subtype)
|
|
58
|
+
return 3;
|
|
59
|
+
if (range.type === type && range.subtype === WILDCARD)
|
|
60
|
+
return 2;
|
|
61
|
+
return range.type === WILDCARD && range.subtype === WILDCARD ? 1 : 0;
|
|
62
|
+
};
|
|
63
|
+
let decisive;
|
|
64
|
+
for (const range of mediaRangesOf(accept)) {
|
|
65
|
+
if (specificity(range) > (decisive ? specificity(decisive) : 0))
|
|
66
|
+
decisive = range;
|
|
67
|
+
}
|
|
68
|
+
return decisive !== undefined && decisive.q > 0;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The shape to answer in: an event stream when the caller named one, which is exactly the stream every
|
|
72
|
+
* client gets today; otherwise JSON when the caller accepts it, including through a wildcard; and
|
|
73
|
+
* undefined when it accepts neither, where the transport's own 406 is the right answer.
|
|
74
|
+
*/
|
|
75
|
+
function answerFormatFor(accept) {
|
|
76
|
+
if (namesMediaType(accept, "text/event-stream"))
|
|
77
|
+
return "event-stream";
|
|
78
|
+
if (acceptsMediaType(accept, "application/json"))
|
|
79
|
+
return "json";
|
|
80
|
+
return undefined;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* The page that says how to connect is for a browser: a GET that names `text/html` and names neither
|
|
84
|
+
* MCP media type. A client that lists HTML among the types it can take still gets the protocol's
|
|
85
|
+
* answer, so no MCP client is ever handed the page.
|
|
86
|
+
*/
|
|
87
|
+
function isBrowserNavigation(accept) {
|
|
88
|
+
return namesMediaType(accept, "text/html") && !namesMcpMediaType(accept);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* A GET that names an MCP media type comes from a client reaching for the server. At the server's
|
|
92
|
+
* bare address, where the page is the default answer (a crawler and `curl` name no type at all), this
|
|
93
|
+
* is what tells a client from everyone else.
|
|
94
|
+
*/
|
|
95
|
+
function namesMcpMediaType(accept) {
|
|
96
|
+
return namesMediaType(accept, "application/json") || namesMediaType(accept, "text/event-stream");
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=accept.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accept.js","sourceRoot":"","sources":["../src/accept.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;AAYH,sCAeC;AAGD,wCAIC;AAUD,4CAcC;AAUD,0CAKC;AAOD,kDAEC;AAOD,8CAEC;AAlFD,MAAM,QAAQ,GAAG,GAAG,CAAC;AAErB,oGAAoG;AACpG,SAAgB,aAAa,CAAC,MAAe;IAC3C,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,EAAE,CAAC;IAE1C,OAAO,MAAM;SACV,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACZ,MAAM,CAAC,KAAK,EAAE,GAAG,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;QACtF,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACjD,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO;YAAE,OAAO,SAAS,CAAC;QACxC,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;QAC/D,MAAM,CAAC,GAAG,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAE/D,OAAO,EAAE,IAAI,EAAE,OA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CAAC,SAAS,cAAc,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAanH"}
|
package/dist/audit-log.js
CHANGED
|
@@ -30,6 +30,14 @@ function errorCodeOf(result) {
|
|
|
30
30
|
const text = result.content?.find((c) => c.type === "text")?.text ?? "";
|
|
31
31
|
return /^Error \[([a-z_]+)\]/.exec(text)?.[1] ?? "tool_error";
|
|
32
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* The field an error names (`Field: workflow_id` in our error text): a schema name, never a value.
|
|
35
|
+
* Without it the log said only `bad_request`, and what callers got wrong could not be read from it.
|
|
36
|
+
*/
|
|
37
|
+
function errorFieldOf(result) {
|
|
38
|
+
const text = result.content?.find((c) => c.type === "text")?.text ?? "";
|
|
39
|
+
return /^Field: ([A-Za-z0-9_.[\]-]{1,64})$/m.exec(text)?.[1];
|
|
40
|
+
}
|
|
33
41
|
function extra(authInfo, key) {
|
|
34
42
|
const value = authInfo?.extra?.[key];
|
|
35
43
|
return typeof value === "string" ? value : undefined;
|
|
@@ -44,13 +52,14 @@ function apiKeyFields(authInfo) {
|
|
|
44
52
|
return {};
|
|
45
53
|
return { credential: "api_key", ...(key.keyId ? { api_key_id: key.keyId } : {}), ...(key.primary ? { api_key_primary: true } : {}) };
|
|
46
54
|
}
|
|
47
|
-
function record(meta, startedAt, outcome, errorCode) {
|
|
55
|
+
function record(meta, startedAt, outcome, errorCode, errorField) {
|
|
48
56
|
return {
|
|
49
57
|
time: new Date().toISOString(),
|
|
50
58
|
event: "mcp.tool_call",
|
|
51
59
|
tool: meta.tool,
|
|
52
60
|
outcome,
|
|
53
61
|
...(errorCode ? { error_code: errorCode } : {}),
|
|
62
|
+
...(errorField ? { error_field: errorField } : {}),
|
|
54
63
|
duration_ms: Date.now() - startedAt,
|
|
55
64
|
transport: meta.hosted ? "hosted" : "stdio",
|
|
56
65
|
sub: extra(meta.authInfo, "sub"),
|
|
@@ -73,9 +82,9 @@ function record(meta, startedAt, outcome, errorCode) {
|
|
|
73
82
|
* keeps `level` and discards the ones it does not know, and a top-level `time` in this
|
|
74
83
|
* format makes it log a parse error for every line.
|
|
75
84
|
*/
|
|
76
|
-
function emit(meta, startedAt, outcome, errorCode) {
|
|
85
|
+
function emit(meta, startedAt, outcome, errorCode, errorField) {
|
|
77
86
|
try {
|
|
78
|
-
console.error(JSON.stringify({ level: "info", message: JSON.stringify(record(meta, startedAt, outcome, errorCode)) }));
|
|
87
|
+
console.error(JSON.stringify({ level: "info", message: JSON.stringify(record(meta, startedAt, outcome, errorCode, errorField)) }));
|
|
79
88
|
}
|
|
80
89
|
catch (error) {
|
|
81
90
|
console.error(`[didit-mcp] audit log failed for ${meta.tool}: ${error.message}`);
|
|
@@ -86,7 +95,7 @@ async function auditToolCall(meta, run) {
|
|
|
86
95
|
const startedAt = Date.now();
|
|
87
96
|
try {
|
|
88
97
|
const result = await run();
|
|
89
|
-
emit(meta, startedAt, result.isError ? "error" : "ok", result.isError ? errorCodeOf(result) : undefined);
|
|
98
|
+
emit(meta, startedAt, result.isError ? "error" : "ok", result.isError ? errorCodeOf(result) : undefined, result.isError ? errorFieldOf(result) : undefined);
|
|
90
99
|
return result;
|
|
91
100
|
}
|
|
92
101
|
catch (error) {
|
package/dist/audit-log.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit-log.js","sourceRoot":"","sources":["../src/audit-log.ts"],"names":[],"mappings":";;AA2BA,sCAUC;AAED,gCAEC;
|
|
1
|
+
{"version":3,"file":"audit-log.js","sourceRoot":"","sources":["../src/audit-log.ts"],"names":[],"mappings":";;AA2BA,sCAUC;AAED,gCAEC;AA4ED,sCAaC;AAlID,8FAA8F;AAC9F,oFAAoF;AACpF,sFAAsF;AACtF,sFAAsF;AACtF,kFAAkF;AAClF,6CAAyC;AAGzC,6DAAqD;AAkBrD,iGAAiG;AACjG,SAAgB,aAAa,CAAC,KA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,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One line for a request to a hosted MCP endpoint that was refused, or that never got an answer.
|
|
3
|
+
*
|
|
4
|
+
* Which requests: the MCP transport endpoints (`/mcp`, `/mcp/chatgpt`, `/mcp/payments`) — everything a
|
|
5
|
+
* connector sends, including a body the JSON parser rejected before any route ran (400/413/415) and a
|
|
6
|
+
* request that arrived and was then dropped, or hung, without an answer. Not covered: the discovery
|
|
7
|
+
* documents, the PDF and signature download links, and the investigator engine; none of those is part
|
|
8
|
+
* of a connector session.
|
|
9
|
+
*
|
|
10
|
+
* Why: the hosted endpoint refuses a connection with 401 (no credential), 401 (a credential the auth
|
|
11
|
+
* service did not accept), 403 (an API key on a profile endpoint), 405 (a reachability probe with GET),
|
|
12
|
+
* 406 (an Accept header the transport cannot answer) or 500 (the auth service did not answer). Until
|
|
13
|
+
* now every one of those was answered silently, so a report like "the Claude connector says it could
|
|
14
|
+
* not verify the server" left nothing behind on this side: an auth service refusing every credential
|
|
15
|
+
* and Anthropic's egress never arriving produced the same, empty log — and so did a request that
|
|
16
|
+
* arrived and was cut off before the answer, which is what a 502 at the connector usually is. The line
|
|
17
|
+
* says which, and how long the request was open, so the next report is one query instead of a
|
|
18
|
+
* reconstruction (the same reason the console logs refused authorizations).
|
|
19
|
+
*
|
|
20
|
+
* What it never says: the credential. Only which header carried one, and the reason — never a token,
|
|
21
|
+
* an API key or a prefix of either. Deliberately not sampled: the arrival time is the evidence, and a
|
|
22
|
+
* sample would drop exactly the request someone is asking about.
|
|
23
|
+
*/
|
|
24
|
+
import type { Request, Response } from "express";
|
|
25
|
+
/** Which request header carried the caller's credential, as it arrived (before any rewrite). */
|
|
26
|
+
export type CredentialHeader = "none" | "authorization" | "x-api-key" | "both";
|
|
27
|
+
/** Bounded, server-defined: never derived from a credential or from a free-form upstream message. */
|
|
28
|
+
export type RefusalReason = "missing_credential" | "credential_refused" | "forbidden" | "unsupported_method" | "not_acceptable" | "bad_request" | "server_error";
|
|
29
|
+
/** Why a request got no answer: the connection ended before the response did. */
|
|
30
|
+
export type NoAnswerReason = "client_closed";
|
|
31
|
+
/** `python-httpx/0.27.0` → `python-httpx`: the program, not the build, and never a URL or a token. */
|
|
32
|
+
export declare function clientOf(userAgent: unknown): string;
|
|
33
|
+
/**
|
|
34
|
+
* The address the balancer accepted the connection from: the LAST `X-Forwarded-For` entry.
|
|
35
|
+
*
|
|
36
|
+
* `mcp.didit.me` sits behind the shared `didit-public` ALB, which appends the address it saw to the
|
|
37
|
+
* end of the header. Every earlier entry is whatever the caller chose to declare, so taking the first
|
|
38
|
+
* one would let anyone claim to be Anthropic's egress. A request that reaches the task without the
|
|
39
|
+
* balancer can still write the whole header: the line says what arrived, not a verified identity.
|
|
40
|
+
*/
|
|
41
|
+
export declare function forwardedOf(req: Request): string | undefined;
|
|
42
|
+
/** Remember what arrived, before the x-api-key door rewrites it into an Authorization header. */
|
|
43
|
+
export declare function noteRequestCredentials(req: Request): void;
|
|
44
|
+
/** The reason a response of this status was a refusal, in the server's own words. */
|
|
45
|
+
export declare function refusalReasonOf(status: number, credential: CredentialHeader): RefusalReason | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Watch one request on a hosted endpoint and log how it ended. Mounted before the body parser, so a
|
|
48
|
+
* body it rejects is logged too; the caller has already noted the credentials (`noteRequestCredentials`).
|
|
49
|
+
*
|
|
50
|
+
* `finish` covers every answered request. `close` without `finish` is the case a 502 leaves behind: the
|
|
51
|
+
* request reached this task and the connection ended before an answer — the client gave up, or the
|
|
52
|
+
* balancer's timeout did — which is otherwise indistinguishable from a request that never arrived.
|
|
53
|
+
*/
|
|
54
|
+
export declare function watchHostedRequest(req: Request, res: Response, path: string): void;
|
|
55
|
+
/**
|
|
56
|
+
* Log one refused hosted request. Silent for anything that was not a refusal: a 404 from an
|
|
57
|
+
* unrelated path and every success stay out of the log.
|
|
58
|
+
*/
|
|
59
|
+
export declare function logRefusedHostedRequest(req: Request, path: string, status: number, elapsedMs?: number): void;
|
|
60
|
+
/** Log a request that reached this task and ended without an answer (close before finish). */
|
|
61
|
+
export declare function logUnansweredHostedRequest(req: Request, path: string, res: Response, elapsedMs: number): void;
|
|
62
|
+
//# sourceMappingURL=refusal-log.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refusal-log.d.ts","sourceRoot":"","sources":["../../src/auth/refusal-log.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEjD,gGAAgG;AAChG,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,eAAe,GAAG,WAAW,GAAG,MAAM,CAAC;AAE/E,qGAAqG;AACrG,MAAM,MAAM,aAAa,GACrB,oBAAoB,GACpB,oBAAoB,GACpB,WAAW,GACX,oBAAoB,GACpB,gBAAgB,GAChB,aAAa,GACb,cAAc,CAAC;AAEnB,iFAAiF;AACjF,MAAM,MAAM,cAAc,GAAG,eAAe,CAAC;AAY7C,sGAAsG;AACtG,wBAAgB,QAAQ,CAAC,SAAS,EAAE,OAAO,GAAG,MAAM,CAKnD;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAQ5D;AAED,iGAAiG;AACjG,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAOzD;AAED,qFAAqF;AACrF,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,gBAAgB,GAAG,aAAa,GAAG,SAAS,CAWvG;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAgBlF;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,SAAI,GAAG,IAAI,CAiBvG;AAED,8FAA8F;AAC9F,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAiB7G"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.clientOf = clientOf;
|
|
4
|
+
exports.forwardedOf = forwardedOf;
|
|
5
|
+
exports.noteRequestCredentials = noteRequestCredentials;
|
|
6
|
+
exports.refusalReasonOf = refusalReasonOf;
|
|
7
|
+
exports.watchHostedRequest = watchHostedRequest;
|
|
8
|
+
exports.logRefusedHostedRequest = logRefusedHostedRequest;
|
|
9
|
+
exports.logUnansweredHostedRequest = logUnansweredHostedRequest;
|
|
10
|
+
const callers = new WeakMap();
|
|
11
|
+
const text = (value) => (typeof value === "string" ? value : "");
|
|
12
|
+
/** `python-httpx/0.27.0` → `python-httpx`: the program, not the build, and never a URL or a token. */
|
|
13
|
+
function clientOf(userAgent) {
|
|
14
|
+
const first = text(userAgent).split(/\s+/)[0] ?? "";
|
|
15
|
+
const program = first.split("/")[0].replace(/[^A-Za-z0-9._-]/g, "");
|
|
16
|
+
return (program || "unknown").slice(0, 32);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The address the balancer accepted the connection from: the LAST `X-Forwarded-For` entry.
|
|
20
|
+
*
|
|
21
|
+
* `mcp.didit.me` sits behind the shared `didit-public` ALB, which appends the address it saw to the
|
|
22
|
+
* end of the header. Every earlier entry is whatever the caller chose to declare, so taking the first
|
|
23
|
+
* one would let anyone claim to be Anthropic's egress. A request that reaches the task without the
|
|
24
|
+
* balancer can still write the whole header: the line says what arrived, not a verified identity.
|
|
25
|
+
*/
|
|
26
|
+
function forwardedOf(req) {
|
|
27
|
+
const hops = text(req.headers["x-forwarded-for"])
|
|
28
|
+
.split(",")
|
|
29
|
+
.map((hop) => hop.trim())
|
|
30
|
+
.filter(Boolean);
|
|
31
|
+
const seen = hops[hops.length - 1];
|
|
32
|
+
return seen && seen.length <= 45 ? seen : undefined;
|
|
33
|
+
}
|
|
34
|
+
/** Remember what arrived, before the x-api-key door rewrites it into an Authorization header. */
|
|
35
|
+
function noteRequestCredentials(req) {
|
|
36
|
+
const authorization = Boolean(req.headers.authorization);
|
|
37
|
+
const apiKey = Boolean(text(req.headers["x-api-key"]).trim());
|
|
38
|
+
const credential = authorization && apiKey ? "both" : authorization ? "authorization" : apiKey ? "x-api-key" : "none";
|
|
39
|
+
callers.set(req, { credential, client: clientOf(req.headers["user-agent"]), forwarded: forwardedOf(req) });
|
|
40
|
+
}
|
|
41
|
+
/** The reason a response of this status was a refusal, in the server's own words. */
|
|
42
|
+
function refusalReasonOf(status, credential) {
|
|
43
|
+
if (status === 401)
|
|
44
|
+
return credential === "none" ? "missing_credential" : "credential_refused";
|
|
45
|
+
// Today only the API-key-on-a-profile-endpoint gate answers 403 (http.ts keyOnlyOnFullProfile).
|
|
46
|
+
if (status === 403)
|
|
47
|
+
return "forbidden";
|
|
48
|
+
if (status === 405)
|
|
49
|
+
return "unsupported_method";
|
|
50
|
+
// The transport's own Accept check: a client that does not accept both JSON and an event stream.
|
|
51
|
+
if (status === 406)
|
|
52
|
+
return "not_acceptable";
|
|
53
|
+
if (status === 400 || status === 413 || status === 415)
|
|
54
|
+
return "bad_request";
|
|
55
|
+
if (status >= 500)
|
|
56
|
+
return "server_error";
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Watch one request on a hosted endpoint and log how it ended. Mounted before the body parser, so a
|
|
61
|
+
* body it rejects is logged too; the caller has already noted the credentials (`noteRequestCredentials`).
|
|
62
|
+
*
|
|
63
|
+
* `finish` covers every answered request. `close` without `finish` is the case a 502 leaves behind: the
|
|
64
|
+
* request reached this task and the connection ended before an answer — the client gave up, or the
|
|
65
|
+
* balancer's timeout did — which is otherwise indistinguishable from a request that never arrived.
|
|
66
|
+
*/
|
|
67
|
+
function watchHostedRequest(req, res, path) {
|
|
68
|
+
const startedAt = Date.now();
|
|
69
|
+
let logged = false;
|
|
70
|
+
const logStatus = () => {
|
|
71
|
+
if (logged)
|
|
72
|
+
return;
|
|
73
|
+
logged = true;
|
|
74
|
+
logRefusedHostedRequest(req, path, res.statusCode, Date.now() - startedAt);
|
|
75
|
+
};
|
|
76
|
+
const logNoAnswer = () => {
|
|
77
|
+
if (logged)
|
|
78
|
+
return;
|
|
79
|
+
logged = true;
|
|
80
|
+
logUnansweredHostedRequest(req, path, res, Date.now() - startedAt);
|
|
81
|
+
};
|
|
82
|
+
res.on("finish", logStatus);
|
|
83
|
+
res.on("close", () => (res.writableFinished ? logStatus() : logNoAnswer()));
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Log one refused hosted request. Silent for anything that was not a refusal: a 404 from an
|
|
87
|
+
* unrelated path and every success stay out of the log.
|
|
88
|
+
*/
|
|
89
|
+
function logRefusedHostedRequest(req, path, status, elapsedMs = 0) {
|
|
90
|
+
const caller = callers.get(req);
|
|
91
|
+
if (!caller)
|
|
92
|
+
return;
|
|
93
|
+
const reason = refusalReasonOf(status, caller.credential);
|
|
94
|
+
if (!reason)
|
|
95
|
+
return;
|
|
96
|
+
emit({
|
|
97
|
+
level: "warn",
|
|
98
|
+
message: "hosted request refused",
|
|
99
|
+
path: path.slice(0, 64),
|
|
100
|
+
method: text(req.method).toUpperCase().slice(0, 8),
|
|
101
|
+
status,
|
|
102
|
+
reason,
|
|
103
|
+
credential: caller.credential,
|
|
104
|
+
client: caller.client,
|
|
105
|
+
ms: elapsedMs,
|
|
106
|
+
}, caller);
|
|
107
|
+
}
|
|
108
|
+
/** Log a request that reached this task and ended without an answer (close before finish). */
|
|
109
|
+
function logUnansweredHostedRequest(req, path, res, elapsedMs) {
|
|
110
|
+
const caller = callers.get(req);
|
|
111
|
+
if (!caller)
|
|
112
|
+
return;
|
|
113
|
+
const reason = "client_closed";
|
|
114
|
+
emit({
|
|
115
|
+
level: "warn",
|
|
116
|
+
message: "hosted request not answered",
|
|
117
|
+
path: path.slice(0, 64),
|
|
118
|
+
method: text(req.method).toUpperCase().slice(0, 8),
|
|
119
|
+
// 0 when nothing was sent: the caller saw a dropped connection, which is the 502 shape.
|
|
120
|
+
status: res.headersSent ? res.statusCode : 0,
|
|
121
|
+
reason,
|
|
122
|
+
credential: caller.credential,
|
|
123
|
+
client: caller.client,
|
|
124
|
+
ms: elapsedMs,
|
|
125
|
+
}, caller);
|
|
126
|
+
}
|
|
127
|
+
/** A warn-level line on stderr, which is where this service's log pipeline reads from. */
|
|
128
|
+
function emit(fields, caller) {
|
|
129
|
+
console.warn(JSON.stringify({ ...fields, ...(caller.forwarded ? { forwarded: caller.forwarded } : {}) }));
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=refusal-log.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refusal-log.js","sourceRoot":"","sources":["../../src/auth/refusal-log.ts"],"names":[],"mappings":";;AAoDA,4BAKC;AAUD,kCAQC;AAGD,wDAOC;AAGD,0CAWC;AAUD,gDAgBC;AAMD,0DAiBC;AAGD,gEAiBC;AAzHD,MAAM,OAAO,GAAG,IAAI,OAAO,EAAmB,CAAC;AAE/C,MAAM,IAAI,GAAG,CAAC,KAAc,EAAU,EAAE,CAAC,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAElF,sGAAsG;AACtG,SAAgB,QAAQ,CAAC,SAAkB;IACzC,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAA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ACpB,MAAM,MAAM,GAAmB,eAAe,CAAC;IAC/C,IAAI,CAAC;QACH,KAAK,EAAE,MAAM;QACb,OAAO,EAAE,6BAA6B;QACtC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;QACvB,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;QAClD,wFAAwF;QACxF,MAAM,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QAC5C,MAAM;QACN,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,EAAE,EAAE,SAAS;KACd,EAAE,MAAM,CAAC,CAAC;AACb,CAAC;AAED,0FAA0F;AAC1F,SAAS,IAAI,CAAC,MAA+B,EAAE,MAAc;IAC3D,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAC5G,CAAC"}
|
package/dist/chatgpt-app.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ export declare function widgetTools(_profile: CatalogProfile): Record<string, un
|
|
|
32
32
|
export declare function stdioCatalogProfile(): CatalogProfile;
|
|
33
33
|
export declare function mountDomainChallenge(_app: Express): void;
|
|
34
34
|
export declare function mountWidgetFonts(_app: Express): void;
|
|
35
|
+
export declare function profileEndpointPaths(): string[];
|
|
35
36
|
export interface ProfileEndpoint {
|
|
36
37
|
path: string;
|
|
37
38
|
profile: CatalogProfile;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chatgpt-app.d.ts","sourceRoot":"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AED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAE/F;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAE/E;AAED,wBAAgB,mBAAmB,IAAI,cAAc,CAEpD;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAAG;AAE5D,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAAG;AAExD,wBAAgB,oBAAoB,IAAI,MAAM,EAAE,CAE/C;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,cAAc,CAAC;IACxB,WAAW,EAAE,GAAG,CAAC;CAClB;AAED,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,OAAO,EACb,QAAQ,EAAE;IAAE,aAAa,EAAE,aAAa,CAAC;IAAC,iBAAiB,EAAE,GAAG,CAAC;IAAC,eAAe,EAAE,MAAM,EAAE,CAAA;CAAE,GAC5F,eAAe,GAAG,SAAS,CAE7B"}
|
package/dist/chatgpt-app.js
CHANGED
|
@@ -13,6 +13,7 @@ exports.widgetTools = widgetTools;
|
|
|
13
13
|
exports.stdioCatalogProfile = stdioCatalogProfile;
|
|
14
14
|
exports.mountDomainChallenge = mountDomainChallenge;
|
|
15
15
|
exports.mountWidgetFonts = mountWidgetFonts;
|
|
16
|
+
exports.profileEndpointPaths = profileEndpointPaths;
|
|
16
17
|
exports.mountProfileEndpoint = mountProfileEndpoint;
|
|
17
18
|
function applyCatalogProfile(tools, _profile) {
|
|
18
19
|
return [...tools];
|
|
@@ -48,6 +49,9 @@ function stdioCatalogProfile() {
|
|
|
48
49
|
}
|
|
49
50
|
function mountDomainChallenge(_app) { }
|
|
50
51
|
function mountWidgetFonts(_app) { }
|
|
52
|
+
function profileEndpointPaths() {
|
|
53
|
+
return [];
|
|
54
|
+
}
|
|
51
55
|
function mountProfileEndpoint(_app, _options) {
|
|
52
56
|
return undefined;
|
|
53
57
|
}
|
package/dist/chatgpt-app.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chatgpt-app.js","sourceRoot":"","sources":["../src/chatgpt-app.ts"],"names":[],"mappings":";;;AAiBA,kDAEC;AAED,gDAEC;AAED,sDAMC;AAKD,8CAEC;AAED,oDAEC;AAED,kDAEC;AAED,gDAEC;AAED,wCAEC;AAED,kCAEC;AAED,kDAEC;AAED,oDAA4D;AAE5D,4CAAwD;
|
|
1
|
+
{"version":3,"file":"chatgpt-app.js","sourceRoot":"","sources":["../src/chatgpt-app.ts"],"names":[],"mappings":";;;AAiBA,kDAEC;AAED,gDAEC;AAED,sDAMC;AAKD,8CAEC;AAED,oDAEC;AAED,kDAEC;AAED,gDAEC;AAED,wCAEC;AAED,kCAEC;AAED,kDAEC;AAED,oDAA4D;AAE5D,4CAAwD;AAExD,oDAEC;AAQD,oDAKC;AAlED,SAAgB,mBAAmB,CAAC,KAA6B,EAAE,QAAwB;IACzF,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC;AACpB,CAAC;AAED,SAAgB,kBAAkB,CAAC,QAAwB,EAAE,KAAa,EAAE,MAAe;IACzF,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAgB,qBAAqB,CACnC,QAAwB,EACxB,KAAa,EACb,KAA0C;IAE1C,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,qEAAqE;AACxD,QAAA,iBAAiB,GAAG,EAAE,CAAC;AAEpC,SAAgB,iBAAiB,CAAC,KAA8B;IAC9D,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC9E,CAAC;AAED,SAAgB,oBAAoB,CAAC,QAAwB;IAC3D,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAgB,mBAAmB;IACjC,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,SAAgB,kBAAkB,CAAC,GAAW;IAC5C,MAAM,IAAI,KAAK,CAAC,qBAAqB,GAAG,EAAE,CAAC,CAAC;AAC9C,CAAC;AAED,SAAgB,cAAc,CAAC,QAAwB,EAAE,KAAa;IACpE,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,SAAgB,WAAW,CAAC,QAAwB;IAClD,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,SAAgB,mBAAmB;IACjC,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAgB,oBAAoB,CAAC,IAAa,IAAS,CAAC;AAE5D,SAAgB,gBAAgB,CAAC,IAAa,IAAS,CAAC;AAExD,SAAgB,oBAAoB;IAClC,OAAO,EAAE,CAAC;AACZ,CAAC;AAQD,SAAgB,oBAAoB,CAClC,IAAa,EACb,QAA6F;IAE7F,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/dist/config.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
2
|
import type { FileSource } from "./security";
|
|
3
3
|
import type { ApiKeyScope } from "./api-key-connection";
|
|
4
|
-
export declare
|
|
4
|
+
export declare let SERVER_VERSION: string;
|
|
5
|
+
/** Name the release this process is: before the hosted server listens, or soon after when the first read failed. */
|
|
6
|
+
export declare function setServerVersion(version: string): void;
|
|
5
7
|
/**
|
|
6
8
|
* Per-tool permission pre-check (permissions.ts): `shadow` (default) only records what
|
|
7
9
|
* WOULD be denied on the audit line, `enforce` refuses the call and hides the tool from
|
|
@@ -54,6 +56,20 @@ export interface RequestCredentials {
|
|
|
54
56
|
/** Where the user acted from, sent to the Investigator as X-Didit-Actor-Via: "copilot" when the
|
|
55
57
|
* console assistant said so on the MCP request, otherwise "mcp". */
|
|
56
58
|
actorVia?: "copilot" | "mcp";
|
|
59
|
+
/** The applications a call could have meant, when it named none and the caller has several
|
|
60
|
+
* (set by the dispatcher). The scope error lists them, so the retry needs no lookup first. */
|
|
61
|
+
scopeChoices?: ScopeChoice[];
|
|
62
|
+
/** An organization's applications could not be listed, so `scopeChoices` may not be all of them. */
|
|
63
|
+
scopeChoicesPartial?: boolean;
|
|
64
|
+
}
|
|
65
|
+
/** One application of the caller, with the two ids a console path needs. */
|
|
66
|
+
export interface ScopeChoice {
|
|
67
|
+
organizationId: string;
|
|
68
|
+
organizationName?: string;
|
|
69
|
+
applicationId: string;
|
|
70
|
+
applicationName?: string;
|
|
71
|
+
/** "live" | "sandbox", when the auth API says. */
|
|
72
|
+
mode?: string;
|
|
57
73
|
}
|
|
58
74
|
export declare const requestContext: AsyncLocalStorage<RequestCredentials>;
|
|
59
75
|
/**
|