@softure-ai/mcp-access 0.1.9 → 0.1.10
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/CHANGELOG.md +5 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/token-status.js +5 -3
- package/dist/token-status.js.map +1 -1
- package/module.json +1 -1
- package/package.json +2 -2
- package/src/index.ts +1 -1
- package/src/token-status.ts +3 -5
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,11 @@ Newest first. Each version lists what changed for an app that uses `@softure-ai/
|
|
|
4
4
|
production, the version gets a line `verified in: <app>@<commit>` ([docs/05](../../docs/05-adoption-playbook.md),
|
|
5
5
|
"Definition of done"). Versions before the first one below are described in their GitHub Releases (`mcp-access@x.y.z`).
|
|
6
6
|
|
|
7
|
+
## 0.1.10
|
|
8
|
+
|
|
9
|
+
- The days left on a token are counted with `toCalendarDay` from `@softure-ai/core` instead of a local `en-CA`
|
|
10
|
+
formatter. Same results; requires `@softure-ai/core` `^0.1.7` (#270).
|
|
11
|
+
|
|
7
12
|
## 0.1.9
|
|
8
13
|
|
|
9
14
|
- The OAuth registration, token and consent decision routes read their body through `readSmallBody`
|
package/dist/index.js
CHANGED
|
@@ -29,7 +29,7 @@ export const MCP_RATE_LIMIT_BUCKETS = {
|
|
|
29
29
|
export const mcpAccess = defineModule({
|
|
30
30
|
manifest: {
|
|
31
31
|
id: MODULE_ID,
|
|
32
|
-
version: "0.1.
|
|
32
|
+
version: "0.1.10",
|
|
33
33
|
dependsOn: { security: "^0.1.0", auth: "^0.1.0" },
|
|
34
34
|
dbSchema: "mcp",
|
|
35
35
|
tables: ["access_tokens", "oauth_clients", "oauth_authorization_codes", "oauth_grants"],
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,kGAAkG;AAClG,kG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AAE,eAAe,EAAE,IAAI,EAAE,qDAAqD,EAAE,MAAM,EAAE,qCAAqC,EAAE;YACrI,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,mDAAmD,EAAE,MAAM,EAAE,mCAAmC,EAAE;YACjI,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,2DAA2D,EAAE,MAAM,EAAE,mCAAmC,EAAE;SAC1I;QACD,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE;KAC1C;IACD,QAAQ,EAAE,iBAAiB;IAC3B,OAAO,EAAE,sBAAsB;IAC/B,UAAU,EAAE,EAAE,GAAG,EAAE,oBAAoB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,gBAAgB,CAAC,EAAE;IAC5E,OAAO,EAAE,2BAA2B;IACpC,MAAM,EAAE,sBAAsB;CAC/B,CAAC,CAAC;AAEH,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,iBAAiB,GAElB,MAAM,mBAAmB,CAAC;AAc3B,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAA0B,MAAM,qBAAqB,CAAC;AACtG,OAAO,EACL,0BAA0B,EAC1B,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,mCAAmC,EACnC,iCAAiC,GASlC,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,iBAAiB,EAA0C,MAAM,cAAc,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,uBAAuB,EAAE,YAAY,EAAE,WAAW,EAA0D,MAAM,aAAa,CAAC;AACvJ,OAAO,EAAE,oBAAoB,EAAiC,MAAM,mBAAmB,CAAC"}
|
package/dist/token-status.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
// Where a token stands on its expiry, for the owner's list, in the app's time zone. Expiry compares instants
|
|
2
|
+
// with the same boundary as verification (valid while `expires_at > now`), so the list never calls
|
|
3
|
+
// a token active that the endpoint already refuses; the distance counts calendar days, as people do.
|
|
4
|
+
import { toCalendarDay } from "@softure-ai/core";
|
|
1
5
|
const DAY_MS = 24 * 60 * 60 * 1000;
|
|
2
6
|
export function getAccessTokenStatus(expiresAt, now, options) {
|
|
3
7
|
if (expiresAt.getTime() <= now.getTime())
|
|
@@ -7,8 +11,6 @@ export function getAccessTokenStatus(expiresAt, now, options) {
|
|
|
7
11
|
}
|
|
8
12
|
/** The calendar day of an instant in a time zone, as a day count; two of them subtract to days. */
|
|
9
13
|
function getDayNumber(instant, timezone) {
|
|
10
|
-
|
|
11
|
-
const parts = Object.fromEntries(format.formatToParts(instant).map((part) => [part.type, part.value]));
|
|
12
|
-
return Date.UTC(Number(parts.year), Number(parts.month) - 1, Number(parts.day)) / DAY_MS;
|
|
14
|
+
return Date.parse(`${toCalendarDay(instant, timezone)}T00:00:00Z`) / DAY_MS;
|
|
13
15
|
}
|
|
14
16
|
//# sourceMappingURL=token-status.js.map
|
package/dist/token-status.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-status.js","sourceRoot":"","sources":["../src/token-status.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"token-status.js","sourceRoot":"","sources":["../src/token-status.ts"],"names":[],"mappings":"AAAA,6GAA6G;AAC7G,mGAAmG;AACnG,qGAAqG;AACrG,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD,MAAM,MAAM,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AASnC,MAAM,UAAU,oBAAoB,CAAC,SAAe,EAAE,GAAS,EAAE,OAAiC;IAChG,IAAI,SAAS,CAAC,OAAO,EAAE,IAAI,GAAG,CAAC,OAAO,EAAE;QAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IACrE,MAAM,QAAQ,GAAG,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,YAAY,CAAC,GAAG,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IACjG,OAAO,QAAQ,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;AAC/F,CAAC;AAED,mGAAmG;AACnG,SAAS,YAAY,CAAC,OAAa,EAAE,QAAgB;IACnD,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,aAAa,CAAC,OAAO,EAAE,QAAQ,CAAC,YAAY,CAAC,GAAG,MAAM,CAAC;AAC9E,CAAC"}
|
package/module.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@softure-ai/mcp-access",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"description": "SOFTURE AI MCP access module: hashed, scoped, expiring access tokens, a rate-limited Bearer endpoint around the app's MCP server factory, and a token page with client setup instructions for Next.js.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@softure-ai/auth": "^0.1.0",
|
|
57
|
-
"@softure-ai/core": "^0.1.
|
|
57
|
+
"@softure-ai/core": "^0.1.7",
|
|
58
58
|
"@softure-ai/db": "^0.1.0",
|
|
59
59
|
"@softure-ai/security": "^0.1.0",
|
|
60
60
|
"zod": "^4.6.5"
|
package/src/index.ts
CHANGED
|
@@ -32,7 +32,7 @@ export const MCP_RATE_LIMIT_BUCKETS = {
|
|
|
32
32
|
export const mcpAccess = defineModule({
|
|
33
33
|
manifest: {
|
|
34
34
|
id: MODULE_ID,
|
|
35
|
-
version: "0.1.
|
|
35
|
+
version: "0.1.10",
|
|
36
36
|
dependsOn: { security: "^0.1.0", auth: "^0.1.0" },
|
|
37
37
|
dbSchema: "mcp",
|
|
38
38
|
tables: ["access_tokens", "oauth_clients", "oauth_authorization_codes", "oauth_grants"],
|
package/src/token-status.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
// Where a token stands on its expiry, for the owner's list
|
|
2
|
-
// `src/lib/access-token-status.ts`, generalised to the app's time zone). Expiry compares instants
|
|
1
|
+
// Where a token stands on its expiry, for the owner's list, in the app's time zone. Expiry compares instants
|
|
3
2
|
// with the same boundary as verification (valid while `expires_at > now`), so the list never calls
|
|
4
3
|
// a token active that the endpoint already refuses; the distance counts calendar days, as people do.
|
|
4
|
+
import { toCalendarDay } from "@softure-ai/core";
|
|
5
5
|
import type { AccessTokenStatus } from "./contract.js";
|
|
6
6
|
|
|
7
7
|
const DAY_MS = 24 * 60 * 60 * 1000;
|
|
@@ -21,7 +21,5 @@ export function getAccessTokenStatus(expiresAt: Date, now: Date, options: Access
|
|
|
21
21
|
|
|
22
22
|
/** The calendar day of an instant in a time zone, as a day count; two of them subtract to days. */
|
|
23
23
|
function getDayNumber(instant: Date, timezone: string): number {
|
|
24
|
-
|
|
25
|
-
const parts = Object.fromEntries(format.formatToParts(instant).map((part) => [part.type, part.value]));
|
|
26
|
-
return Date.UTC(Number(parts.year), Number(parts.month) - 1, Number(parts.day)) / DAY_MS;
|
|
24
|
+
return Date.parse(`${toCalendarDay(instant, timezone)}T00:00:00Z`) / DAY_MS;
|
|
27
25
|
}
|