Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@ jobs:
# keys (S3-7), COMMIT confirmed by its tag and bounded (S5). No DB.
- name: Run I2b-S8 offline security test
run: npx ts-node test/mcpOAuthS8.test.ts
# I2b-S10: secret formats (every supported CSPRNG format accepted for
# every role incl. retained rotation keys; S8 weak patterns refused; no
# newly refused S8-accepted value), the per-request time budget, ONE
# deadline through COMMIT, connection recovery, and the held activation
# transaction (commit / unknown / not_committed / abort / expiry). No DB.
- name: Run I2b-S10 offline activation-readiness test
run: npx ts-node test/mcpOAuthS10.test.ts
- name: Run panchang day service test
run: npx ts-node test/panchangDay.test.ts
- name: Run panchang month service test
Expand Down Expand Up @@ -1115,6 +1122,15 @@ jobs:
# client address and name G/N (S3-6, S3-7). Touches only the MCP tables.
- name: Run I2b-S8 security DB test
run: npx ts-node test/mcpOAuthS8Db.test.ts
# I2b-S10 (S3-1 closure): an abandoned code -- activation failure,
# database outage, disconnect, partial delivery, replaced response,
# frozen process -- stays PENDING and is refused on ANOTHER instance even
# with the server-known code + verifier; issued codes (hand-off without
# proof of receipt) redeem once; a racing redemption waits for the
# in-flight activation; the request budget bounds a slow flow. Two
# instances with separate stores and pools. Touches only the MCP tables.
- name: Run I2b-S10 cross-instance code safety DB test
run: npx ts-node test/mcpOAuthS10Db.test.ts
- name: Verify every repository migration was recorded as applied
run: |
set -euo pipefail
Expand Down
242 changes: 242 additions & 0 deletions AURA_MCP_02_I2B_S10_ACTIVATION_READINESS_REPORT.md

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion packages/mcp-tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ I2b adds the components a deployed authorization server needs. **Nothing here en
| I2b-R-3 address normalisation (S2) | Canonical parsing (both IPv4-mapped forms → IPv4; zone ids, ports, lists, brackets rejected), IPv4 /32 and IPv6 /64 buckets, `/api/mcp` reads `AURA_MCP_CLIENT_ADDRESS_SOURCE`. A missing or invalid trusted address uses one shared bounded `unresolved` bucket and is audited (`*.address_unresolved`, reason code only) — never global-only. |
| S3-1 / S3-2 store issuance and late writes (S4) | New authorization codes are stored pending and activated only after the response that delivers them succeeded; any error response loses its `Location` and the code is revoked. Each store statement runs in its own transaction with `SET LOCAL statement_timeout` 1500 ms / `lock_timeout` 1000 ms and is committed only if the 3 s deadline has not answered failure, so a failed write cannot land later. |
| Ambiguous activation and interrupted responses (S6) | A code the server decides not to deliver (activation failed or uncertain, such as a lost COMMIT acknowledgement; error response; client disconnected before the response was fully written) is deleted whether pending or already active, with one retry. If every revocation attempt fails after an activation that did commit, the code was still never sent and expires with its 60 s TTL (audited `CodeRevocationFailed`). |
| Consolidated remediation (S8) | Undelivered codes whose revocation failed are refused by that instance and deleted by a background retry until they expire (S3-1 residual). The provider's request origin is pinned to the configured issuer, so Host / X-Forwarded-* never reach discovery, endpoint URLs or redirects (I2b-R-3). Signing keys must declare `alg`, be internally consistent (RSA CRT members, e = 65537, EC point) and pass a sign/verify probe against their public members; secrets need >= 128 bits of estimated entropy and no repeated block (I2b-R-6). Interaction-page store outages answer 503 (S3-3). One `AURA_MCP_CLIENT_ADDRESS_SOURCE` for the AS and `/api/mcp` (S3-4). Address input is length-bounded before parsing (S3-5). Limiter address buckets are keyed HMACs (S3-6) and shard keys name G and N (S3-7). Every MCP transaction sets `SET LOCAL idle_in_transaction_session_timeout` (S3-8). A COMMIT counts only with the `COMMIT` tag and within its own deadline (S5). |
| Consolidated remediation (S8) | (S3-1 residual hold: superseded by S10.) The provider's request origin is pinned to the configured issuer, so Host / X-Forwarded-* never reach discovery, endpoint URLs or redirects (I2b-R-3). Signing keys must declare `alg`, be internally consistent (RSA CRT members, e = 65537, EC point) and pass a sign/verify probe against their public members; secrets need >= 128 bits of estimated entropy and no repeated block (I2b-R-6). Interaction-page store outages answer 503 (S3-3). One `AURA_MCP_CLIENT_ADDRESS_SOURCE` for the AS and `/api/mcp` (S3-4). Address input is length-bounded before parsing (S3-5). Limiter address buckets are keyed HMACs (S3-6) and shard keys name G and N (S3-7). Every MCP transaction sets `SET LOCAL idle_in_transaction_session_timeout` (S3-8). A COMMIT counts only with the `COMMIT` tag (S5; S10: within the one statement deadline). |
| S3-1 closure, secrets, time budget (S10) | Authorization-code activation is a held transaction COMMITTED only after the complete response was handed off; every other outcome (error response, disconnect, partial write, replaced response, crash/freeze, database outage) leaves the code PENDING in the shared database without any further write, so no instance can redeem it. The S8 instance-local hold and background retry are removed. "Issued" means handed off, not received; a lost COMMIT acknowledgement after hand-off is "issued, outcome unknown" (safe either way). Code lookups use `FOR SHARE`, so a racing redemption waits for the activation. Secrets: format-aware strength (hex 4 bits/char, base64/base64url 6 bits/char; `openssl rand -hex 16` and `-base64 24` accepted) on top of the unchanged S8 rule, with repeated-block / run / skew vetoes. One deadline covers checkout + statement + COMMIT; one request budget (`requestBudgetMs`, default 5000 ms) caps all store calls of a request. |
| I2b-1 limiter contention (S2) | The global ceiling is split into up to 16 shard rows chosen at random, with limits summing to **exactly** the ceiling (aggregate never larger). A decision is 4 statements; rows are locked for one statement plus COMMIT, not from the first upsert. |

Other I2b behaviour:
Expand Down
Loading
Loading