@opendatalabs/personal-server-ts-core 1.29.0 → 1.29.1
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.
|
@@ -30,6 +30,16 @@ export declare function mcpRefreshExpiry(nowMs: number): string;
|
|
|
30
30
|
export declare function isMcpTokenExpired(record: Pick<McpConnectionRecord, "tokenExpiresAt">, nowMs?: number): boolean;
|
|
31
31
|
/** Fail closed, same rule: no proven lifetime means no refresh. */
|
|
32
32
|
export declare function isMcpRefreshExpired(record: Pick<McpConnectionRecord, "refreshExpiresAt">, nowMs?: number): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* True for a connection issued before the store recorded token lifetimes
|
|
35
|
+
* (Personal Server < 1.17): no `tokenExpiresAt` and no refresh token. Its
|
|
36
|
+
* client holds only the access token and has no way to refresh, so failing
|
|
37
|
+
* it closed forces every such client to re-consent. A store that may hold
|
|
38
|
+
* these records (PS-Lite, whose web owners ran 1.12) can accept them; owner
|
|
39
|
+
* revocation still ends them. Every record written since 1.17 carries an
|
|
40
|
+
* expiry, so this never makes a newly issued token unbounded.
|
|
41
|
+
*/
|
|
42
|
+
export declare function isPreExpiryMcpRecord(record: Pick<McpConnectionRecord, "tokenExpiresAt" | "refreshTokenHash" | "refreshExpiresAt">): boolean;
|
|
33
43
|
/**
|
|
34
44
|
* True when `hash` is this record's current or rotated-out refresh hash. Every
|
|
35
45
|
* store resolves a refresh token through this one predicate.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-expiry.d.ts","sourceRoot":"","sources":["../../src/mcp/token-expiry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEtD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,QAAiB,CAAC;AAE/C;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,QAA0B,CAAC;AAE1D,wDAAwD;AACxD,wBAAgB,cAAc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MAAmB,GACzB,OAAO,CAET;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,IAAI,CACV,mBAAmB,EACnB,gBAAgB,GAAG,kBAAkB,GAAG,kBAAkB,CAC3D,GACA,OAAO,CAMT;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,IAAI,CACV,mBAAmB,EACnB,kBAAkB,GAAG,0BAA0B,CAChD,EACD,IAAI,EAAE,MAAM,GACX,OAAO,CAMT"}
|
package/dist/mcp/token-expiry.js
CHANGED
|
@@ -37,6 +37,20 @@ export function isMcpTokenExpired(record, nowMs = Date.now()) {
|
|
|
37
37
|
export function isMcpRefreshExpired(record, nowMs = Date.now()) {
|
|
38
38
|
return isExpired(record.refreshExpiresAt, nowMs);
|
|
39
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* True for a connection issued before the store recorded token lifetimes
|
|
42
|
+
* (Personal Server < 1.17): no `tokenExpiresAt` and no refresh token. Its
|
|
43
|
+
* client holds only the access token and has no way to refresh, so failing
|
|
44
|
+
* it closed forces every such client to re-consent. A store that may hold
|
|
45
|
+
* these records (PS-Lite, whose web owners ran 1.12) can accept them; owner
|
|
46
|
+
* revocation still ends them. Every record written since 1.17 carries an
|
|
47
|
+
* expiry, so this never makes a newly issued token unbounded.
|
|
48
|
+
*/
|
|
49
|
+
export function isPreExpiryMcpRecord(record) {
|
|
50
|
+
return (!record.tokenExpiresAt &&
|
|
51
|
+
!record.refreshTokenHash &&
|
|
52
|
+
!record.refreshExpiresAt);
|
|
53
|
+
}
|
|
40
54
|
/**
|
|
41
55
|
* True when `hash` is this record's current or rotated-out refresh hash. Every
|
|
42
56
|
* store resolves a refresh token through this one predicate.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-expiry.js","sourceRoot":"","sources":["../../src/mcp/token-expiry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;;;GAIG;AACH,MAAM,CAAC,MAAM,gB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