@agent-native/core 0.206.0-nightly-20261009153146 → 0.206.0
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/dist/action.d.ts +7 -1
- package/dist/client/agent-chat/index.d.ts +1 -1
- package/dist/client/agent-chat/index.js +1 -1
- package/dist/client/embed-auth.d.ts +2 -0
- package/dist/client/embed-auth.js +160 -12
- package/dist/client/host/index.d.ts +1 -1
- package/dist/client/host/index.js +1 -1
- package/dist/client/mcp-app-host.d.ts +1 -0
- package/dist/client/mcp-app-host.js +4 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/file-upload/actions/upload-image.d.ts +2 -2
- package/dist/mcp/build-server.d.ts +15 -0
- package/dist/mcp/build-server.js +307 -91
- package/dist/mcp/connect-route.js +1 -0
- package/dist/mcp/embed-app.js +291 -31
- package/dist/mcp/oauth-route.js +3 -0
- package/dist/mcp/oauth-store.d.ts +2 -1
- package/dist/mcp/oauth-store.js +5 -6
- package/dist/mcp/oauth-token.d.ts +5 -0
- package/dist/mcp/oauth-token.js +17 -0
- package/dist/mcp/screen-memory-stdio.d.ts +7 -7
- package/dist/mcp/server.d.ts +2 -2
- package/dist/mcp/server.js +2 -2
- package/dist/observability/routes.d.ts +5 -5
- package/dist/org/handlers.d.ts +1 -1
- package/dist/org/workspace-app-access-request.d.ts +8 -0
- package/dist/org/workspace-app-access-request.js +20 -0
- package/dist/provider-api/actions/custom-provider-registration.d.ts +4 -4
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/secrets/routes.d.ts +11 -11
- package/dist/server/action-routes.d.ts +2 -0
- package/dist/server/action-routes.js +187 -31
- package/dist/server/agent-chat/mcp-options.d.ts +3 -1
- package/dist/server/agent-chat-plugin.js +26 -1
- package/dist/server/agent-engine-ollama-models-route.d.ts +2 -2
- package/dist/server/auth.js +11 -20
- package/dist/server/embed-route.js +5 -3
- package/dist/server/embed-session.d.ts +30 -1
- package/dist/server/embed-session.js +376 -30
- package/dist/server/realtime-token.d.ts +1 -1
- package/dist/server/request-context.d.ts +2 -0
- package/dist/server/request-context.js +25 -1
- package/dist/shared/embed-auth.d.ts +74 -0
- package/dist/shared/embed-auth.js +379 -10
- package/dist/sharing/actions/list-resource-shares.d.ts +1 -1
- package/dist/triggers/actions/manage-automation.d.ts +3 -3
- package/package.json +4 -4
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import crypto from "node:crypto";
|
|
2
2
|
import { getCookie, getHeader, getQuery, setCookie, setResponseHeader, } from "h3";
|
|
3
3
|
import { getDbExec } from "../db/client.js";
|
|
4
|
-
import { ensureTableExists } from "../db/ddl-guard.js";
|
|
5
|
-
import { EMBED_MODE_QUERY_PARAM, EMBED_SESSION_COOKIE, EMBED_TARGET_HEADER, EMBED_TARGET_QUERY_PARAM, EMBED_TOKEN_QUERY_PARAM,
|
|
4
|
+
import { ensureColumnExists, ensureTableExists } from "../db/ddl-guard.js";
|
|
5
|
+
import { EMBED_MODE_QUERY_PARAM, EMBED_SESSION_COOKIE, EMBED_TARGET_HEADER, EMBED_TARGET_QUERY_PARAM, EMBED_TOKEN_QUERY_PARAM, MCP_DIRECTORY_WIDGET_WRITE_CAPABILITY_MAX_AGE_MS, canRenewMcpDirectoryWidgetCapabilityScope, isMcpDirectoryWidgetCapabilityScope, isMcpDirectoryWidgetWriteCapabilityScope, getMcpDirectoryWidgetWriteCapabilityExpiresAt, MCP_DIRECTORY_WIDGET_WRITE_CAPABILITY_MAX_LENGTH, } from "../shared/embed-auth.js";
|
|
6
6
|
import { normalizeAppPath } from "../shared/sign-in-journey.js";
|
|
7
7
|
import { getConfiguredAppBasePath } from "./app-base-path.js";
|
|
8
8
|
import { resolveAuthCookieNamespace } from "./cookie-namespace.js";
|
|
@@ -13,6 +13,7 @@ import { getForwardedRequestHostname } from "./request-origin.js";
|
|
|
13
13
|
const TOKEN_KIND = "agent-native-embed-session";
|
|
14
14
|
const DEFAULT_TOKEN_TTL_SECONDS = 60 * 60;
|
|
15
15
|
const DEFAULT_TICKET_TTL_SECONDS = 5 * 60;
|
|
16
|
+
const MCP_DIRECTORY_WIDGET_RENEWAL_TTL_MS = 30 * 24 * 60 * 60 * 1000;
|
|
16
17
|
const EMBED_CAPABILITY_SCOPE_PREFIX = "capability:";
|
|
17
18
|
const CONTROL_CHARS = new RegExp("[\\u0000-\\u001f\\u007f]");
|
|
18
19
|
const OPEN_ROUTE_PATH = "/_agent-native/open";
|
|
@@ -58,7 +59,7 @@ export function resolvedEmbedCapabilityScope(session) {
|
|
|
58
59
|
const scope = session?.scope;
|
|
59
60
|
if (!isEmbedCapabilityScope(scope) ||
|
|
60
61
|
!scope ||
|
|
61
|
-
scope.length >
|
|
62
|
+
scope.length > MCP_DIRECTORY_WIDGET_WRITE_CAPABILITY_MAX_LENGTH ||
|
|
62
63
|
CONTROL_CHARS.test(scope)) {
|
|
63
64
|
return undefined;
|
|
64
65
|
}
|
|
@@ -76,10 +77,14 @@ export async function ensureTable() {
|
|
|
76
77
|
scope TEXT,
|
|
77
78
|
created_at BIGINT NOT NULL,
|
|
78
79
|
expires_at BIGINT NOT NULL,
|
|
79
|
-
consumed_at BIGINT
|
|
80
|
+
consumed_at BIGINT,
|
|
81
|
+
renewal_expires_at BIGINT,
|
|
82
|
+
session_active_until BIGINT
|
|
80
83
|
)
|
|
81
84
|
`;
|
|
82
85
|
await ensureTableExists("agent_native_embed_tickets", embedTicketsCreateSql);
|
|
86
|
+
await ensureColumnExists("agent_native_embed_tickets", "renewal_expires_at", "ALTER TABLE agent_native_embed_tickets ADD COLUMN renewal_expires_at BIGINT");
|
|
87
|
+
await ensureColumnExists("agent_native_embed_tickets", "session_active_until", "ALTER TABLE agent_native_embed_tickets ADD COLUMN session_active_until BIGINT");
|
|
83
88
|
await ensureTableExists("agent_native_embed_session_revocations", `CREATE TABLE IF NOT EXISTS agent_native_embed_session_revocations (
|
|
84
89
|
owner_hash TEXT PRIMARY KEY,
|
|
85
90
|
revoked_before BIGINT NOT NULL
|
|
@@ -551,26 +556,70 @@ export async function createEmbedSessionTicket(input) {
|
|
|
551
556
|
const createdAt = Date.now();
|
|
552
557
|
const ttlSeconds = input.ttlSeconds ?? DEFAULT_TICKET_TTL_SECONDS;
|
|
553
558
|
const expiresAt = createdAt + Math.max(1, ttlSeconds) * 1000;
|
|
559
|
+
const widgetCapability = isMcpDirectoryWidgetCapabilityScope(input.scope ?? undefined);
|
|
560
|
+
if (widgetCapability &&
|
|
561
|
+
(input.revocationAnchorCreatedAtMs === undefined ||
|
|
562
|
+
!Number.isSafeInteger(input.revocationAnchorCreatedAtMs))) {
|
|
563
|
+
throw new Error("Directory widget ticket requires a trusted revocation anchor.");
|
|
564
|
+
}
|
|
565
|
+
if (isMcpDirectoryWidgetWriteCapabilityScope(input.scope ?? undefined) &&
|
|
566
|
+
!canRenewMcpDirectoryWidgetCapabilityScope(input.scope, input.scope, {
|
|
567
|
+
userEmail: ownerEmail,
|
|
568
|
+
orgId: input.orgId,
|
|
569
|
+
})) {
|
|
570
|
+
throw new Error("Directory widget write capability identity does not match its ticket owner.");
|
|
571
|
+
}
|
|
572
|
+
const checksOwnerRevocation = !capabilityScope ||
|
|
573
|
+
widgetCapability ||
|
|
574
|
+
input.revocationAnchorCreatedAtMs !== undefined;
|
|
575
|
+
if (input.revocationAnchorCreatedAtMs !== undefined &&
|
|
576
|
+
!Number.isSafeInteger(input.revocationAnchorCreatedAtMs)) {
|
|
577
|
+
throw new Error("Embed session ticket has an invalid revocation anchor.");
|
|
578
|
+
}
|
|
579
|
+
const renewalExpiryCap = createdAt + MCP_DIRECTORY_WIDGET_RENEWAL_TTL_MS;
|
|
580
|
+
const renewalExpiresAt = widgetCapability
|
|
581
|
+
? Math.min(input.renewalExpiresAtMs ?? renewalExpiryCap, renewalExpiryCap)
|
|
582
|
+
: null;
|
|
583
|
+
if (widgetCapability &&
|
|
584
|
+
(renewalExpiresAt === null ||
|
|
585
|
+
!Number.isSafeInteger(renewalExpiresAt) ||
|
|
586
|
+
renewalExpiresAt <= createdAt)) {
|
|
587
|
+
throw new Error("Embed session ticket has an invalid renewal deadline.");
|
|
588
|
+
}
|
|
589
|
+
const writeCapabilityExpiresAtMs = isMcpDirectoryWidgetWriteCapabilityScope(input.scope ?? undefined)
|
|
590
|
+
? getMcpDirectoryWidgetWriteCapabilityExpiresAt(input.scope ?? undefined)
|
|
591
|
+
: undefined;
|
|
592
|
+
if (isMcpDirectoryWidgetWriteCapabilityScope(input.scope ?? undefined) &&
|
|
593
|
+
(writeCapabilityExpiresAtMs === undefined ||
|
|
594
|
+
!Number.isSafeInteger(writeCapabilityExpiresAtMs) ||
|
|
595
|
+
writeCapabilityExpiresAtMs <= createdAt)) {
|
|
596
|
+
throw new Error("Directory widget ticket has an invalid write capability.");
|
|
597
|
+
}
|
|
598
|
+
const sessionActiveUntil = writeCapabilityExpiresAtMs === undefined
|
|
599
|
+
? null
|
|
600
|
+
: Math.min(expiresAt, writeCapabilityExpiresAtMs, renewalExpiresAt);
|
|
554
601
|
const client = getDbExec();
|
|
555
602
|
const insert = async (tx) => {
|
|
556
|
-
if (
|
|
603
|
+
if (checksOwnerRevocation) {
|
|
557
604
|
const key = ownerHash(ownerEmail);
|
|
558
605
|
if (!key)
|
|
559
606
|
throw new Error("Embed session ticket requires ownerEmail.");
|
|
560
607
|
await lockEmbedSessionsForOwner(tx, key);
|
|
561
608
|
const revokedBefore = await embedSessionsRevokedBefore(ownerEmail, tx);
|
|
562
|
-
|
|
609
|
+
const revocationTime = input.revocationAnchorCreatedAtMs ?? authenticatedAtMs;
|
|
610
|
+
if (revokedBefore !== null && revocationTime <= revokedBefore) {
|
|
563
611
|
throw new Error("Embed session ticket creation was revoked by logout.");
|
|
564
612
|
}
|
|
565
|
-
if (
|
|
613
|
+
if (!capabilityScope &&
|
|
614
|
+
contextSessionToken &&
|
|
566
615
|
!(await sourceSessionBelongsToOwner(tx, ownerEmail, contextSessionToken))) {
|
|
567
616
|
throw new Error("Embed session ticket source session was revoked.");
|
|
568
617
|
}
|
|
569
618
|
}
|
|
570
619
|
await tx.execute({
|
|
571
620
|
sql: "INSERT INTO agent_native_embed_tickets " +
|
|
572
|
-
"(ticket_hash, owner_email, org_id, target_path, scope, created_at, expires_at, consumed_at) " +
|
|
573
|
-
"VALUES (?, ?, ?, ?, ?, ?, ?, ?)",
|
|
621
|
+
"(ticket_hash, owner_email, org_id, target_path, scope, created_at, expires_at, consumed_at, renewal_expires_at, session_active_until) " +
|
|
622
|
+
"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
|
|
574
623
|
args: [
|
|
575
624
|
ticketHash,
|
|
576
625
|
ownerEmail,
|
|
@@ -580,30 +629,275 @@ export async function createEmbedSessionTicket(input) {
|
|
|
580
629
|
createdAt,
|
|
581
630
|
expiresAt,
|
|
582
631
|
null,
|
|
632
|
+
renewalExpiresAt,
|
|
633
|
+
sessionActiveUntil,
|
|
583
634
|
],
|
|
584
635
|
});
|
|
585
636
|
};
|
|
586
|
-
if (
|
|
587
|
-
await insert(client);
|
|
588
|
-
}
|
|
589
|
-
else {
|
|
637
|
+
if (checksOwnerRevocation) {
|
|
590
638
|
if (!client.transaction) {
|
|
591
639
|
throw new Error("Embed session ticket creation requires database transactions.");
|
|
592
640
|
}
|
|
593
641
|
await client.transaction(insert);
|
|
594
642
|
}
|
|
643
|
+
else {
|
|
644
|
+
await insert(client);
|
|
645
|
+
}
|
|
595
646
|
return { ticket, ticketHash, expiresAt };
|
|
596
647
|
}
|
|
648
|
+
export async function readMcpDirectoryWidgetRenewalTicket(ticket) {
|
|
649
|
+
if (!ticket || ticket.length > 128 || CONTROL_CHARS.test(ticket)) {
|
|
650
|
+
return null;
|
|
651
|
+
}
|
|
652
|
+
await ensureTable();
|
|
653
|
+
const { rows } = await getDbExec().execute({
|
|
654
|
+
sql: "SELECT ticket_hash, owner_email, org_id, target_path, scope, created_at, expires_at, consumed_at, renewal_expires_at, session_active_until " +
|
|
655
|
+
"FROM agent_native_embed_tickets WHERE ticket_hash = ? LIMIT 1",
|
|
656
|
+
args: [hashTicket(ticket)],
|
|
657
|
+
});
|
|
658
|
+
const row = rows[0];
|
|
659
|
+
if (!row)
|
|
660
|
+
return null;
|
|
661
|
+
const ownerEmail = stringOrUndefined(row.owner_email ?? row.ownerEmail);
|
|
662
|
+
const targetPath = normalizeEmbedTargetPath(stringOrUndefined(row.target_path ?? row.targetPath));
|
|
663
|
+
const scope = stringOrUndefined(row.scope);
|
|
664
|
+
const createdAtMs = numberOrNull(row.created_at ?? row.createdAt);
|
|
665
|
+
const expiresAtMs = numberOrNull(row.expires_at ?? row.expiresAt);
|
|
666
|
+
const storedRenewalExpiresAt = row.renewal_expires_at ?? row.renewalExpiresAt;
|
|
667
|
+
const consumedAtMs = numberOrNull(row.consumed_at ?? row.consumedAt);
|
|
668
|
+
const sessionActiveUntilMs = numberOrNull(row.session_active_until ?? row.sessionActiveUntil);
|
|
669
|
+
const sessionId = stringOrUndefined(row.ticket_hash ?? row.ticketHash);
|
|
670
|
+
if (!ownerEmail ||
|
|
671
|
+
!targetPath ||
|
|
672
|
+
!scope ||
|
|
673
|
+
!isMcpDirectoryWidgetCapabilityScope(scope) ||
|
|
674
|
+
!createdAtMs ||
|
|
675
|
+
expiresAtMs === null ||
|
|
676
|
+
!sessionId) {
|
|
677
|
+
return null;
|
|
678
|
+
}
|
|
679
|
+
const renewalExpiryCap = createdAtMs + MCP_DIRECTORY_WIDGET_RENEWAL_TTL_MS;
|
|
680
|
+
const renewalExpiresAtMs = storedRenewalExpiresAt == null
|
|
681
|
+
? renewalExpiryCap
|
|
682
|
+
: numberOrNull(storedRenewalExpiresAt);
|
|
683
|
+
if (renewalExpiresAtMs === null)
|
|
684
|
+
return null;
|
|
685
|
+
const boundedRenewalExpiresAtMs = Math.min(renewalExpiresAtMs, renewalExpiryCap);
|
|
686
|
+
if (Date.now() >= boundedRenewalExpiresAtMs)
|
|
687
|
+
return null;
|
|
688
|
+
const orgId = stringOrUndefined(row.org_id ?? row.orgId);
|
|
689
|
+
return {
|
|
690
|
+
sessionId,
|
|
691
|
+
ownerEmail,
|
|
692
|
+
...(orgId ? { orgId } : {}),
|
|
693
|
+
targetPath,
|
|
694
|
+
scope,
|
|
695
|
+
createdAtMs,
|
|
696
|
+
expiresAtMs,
|
|
697
|
+
consumedAtMs,
|
|
698
|
+
renewalExpiresAtMs: boundedRenewalExpiresAtMs,
|
|
699
|
+
sessionActiveUntilMs,
|
|
700
|
+
};
|
|
701
|
+
}
|
|
702
|
+
export async function renewMcpDirectoryWidgetSession(input) {
|
|
703
|
+
const ownerEmail = normalizedEmail(input.ownerEmail);
|
|
704
|
+
if (!ownerEmail ||
|
|
705
|
+
!input.sourceTicket ||
|
|
706
|
+
input.sourceTicket.length > 128 ||
|
|
707
|
+
CONTROL_CHARS.test(input.sourceTicket)) {
|
|
708
|
+
return null;
|
|
709
|
+
}
|
|
710
|
+
await ensureTable();
|
|
711
|
+
const client = getDbExec();
|
|
712
|
+
if (!client.transaction) {
|
|
713
|
+
throw new Error("Widget session renewal requires database transactions.");
|
|
714
|
+
}
|
|
715
|
+
return client.transaction(async (tx) => {
|
|
716
|
+
const ticketHash = hashTicket(input.sourceTicket);
|
|
717
|
+
const { rows } = await tx.execute({
|
|
718
|
+
sql: "SELECT owner_email, org_id, target_path, scope, created_at, consumed_at, renewal_expires_at, session_active_until " +
|
|
719
|
+
"FROM agent_native_embed_tickets WHERE ticket_hash = ? FOR UPDATE",
|
|
720
|
+
args: [ticketHash],
|
|
721
|
+
});
|
|
722
|
+
const row = rows[0];
|
|
723
|
+
if (!row)
|
|
724
|
+
return null;
|
|
725
|
+
const currentOwner = stringOrUndefined(row.owner_email ?? row.ownerEmail);
|
|
726
|
+
const currentOrgId = stringOrUndefined(row.org_id ?? row.orgId);
|
|
727
|
+
const currentScope = stringOrUndefined(row.scope);
|
|
728
|
+
const createdAtMs = numberOrNull(row.created_at ?? row.createdAt);
|
|
729
|
+
const consumedAtMs = numberOrNull(row.consumed_at ?? row.consumedAt);
|
|
730
|
+
const storedRenewalExpiresAt = numberOrNull(row.renewal_expires_at ?? row.renewalExpiresAt);
|
|
731
|
+
const sessionActiveUntilMs = numberOrNull(row.session_active_until ?? row.sessionActiveUntil);
|
|
732
|
+
const renewalExpiryCap = createdAtMs === null
|
|
733
|
+
? null
|
|
734
|
+
: createdAtMs + MCP_DIRECTORY_WIDGET_RENEWAL_TTL_MS;
|
|
735
|
+
const renewalExpiresAtMs = renewalExpiryCap === null
|
|
736
|
+
? null
|
|
737
|
+
: Math.min(storedRenewalExpiresAt ?? renewalExpiryCap, renewalExpiryCap);
|
|
738
|
+
if (!currentOwner ||
|
|
739
|
+
normalizedEmail(currentOwner) !== ownerEmail ||
|
|
740
|
+
(currentOrgId ?? undefined) !== (input.orgId ?? undefined) ||
|
|
741
|
+
!currentScope ||
|
|
742
|
+
currentScope !== input.expectedScope ||
|
|
743
|
+
!isMcpDirectoryWidgetCapabilityScope(currentScope) ||
|
|
744
|
+
!isMcpDirectoryWidgetCapabilityScope(input.renewedScope) ||
|
|
745
|
+
!canRenewMcpDirectoryWidgetCapabilityScope(currentScope, input.renewedScope, { userEmail: ownerEmail, orgId: currentOrgId }) ||
|
|
746
|
+
createdAtMs === null ||
|
|
747
|
+
consumedAtMs === null ||
|
|
748
|
+
sessionActiveUntilMs === null ||
|
|
749
|
+
renewalExpiresAtMs === null ||
|
|
750
|
+
renewalExpiresAtMs <= Date.now()) {
|
|
751
|
+
return null;
|
|
752
|
+
}
|
|
753
|
+
const renewedWriteScope = isMcpDirectoryWidgetWriteCapabilityScope(input.renewedScope);
|
|
754
|
+
const renewedScopeExpiresAt = renewedWriteScope
|
|
755
|
+
? getMcpDirectoryWidgetWriteCapabilityExpiresAt(input.renewedScope)
|
|
756
|
+
: undefined;
|
|
757
|
+
if (renewedWriteScope &&
|
|
758
|
+
(renewedScopeExpiresAt === undefined ||
|
|
759
|
+
renewedScopeExpiresAt <= Date.now() ||
|
|
760
|
+
renewedScopeExpiresAt >
|
|
761
|
+
Date.now() + MCP_DIRECTORY_WIDGET_WRITE_CAPABILITY_MAX_AGE_MS)) {
|
|
762
|
+
return null;
|
|
763
|
+
}
|
|
764
|
+
const key = ownerHash(ownerEmail);
|
|
765
|
+
if (!key)
|
|
766
|
+
return null;
|
|
767
|
+
await lockEmbedSessionsForOwner(tx, key);
|
|
768
|
+
const revokedBefore = await embedSessionsRevokedBefore(ownerEmail, tx);
|
|
769
|
+
if (revokedBefore !== null && createdAtMs <= revokedBefore)
|
|
770
|
+
return null;
|
|
771
|
+
const activeUntilMs = Math.min(Date.now() + MCP_DIRECTORY_WIDGET_WRITE_CAPABILITY_MAX_AGE_MS, renewalExpiresAtMs, renewedScopeExpiresAt ?? Number.MAX_SAFE_INTEGER);
|
|
772
|
+
if (activeUntilMs <= Date.now())
|
|
773
|
+
return null;
|
|
774
|
+
const updated = await tx.execute({
|
|
775
|
+
sql: "UPDATE agent_native_embed_tickets SET scope = ?, session_active_until = ? " +
|
|
776
|
+
"WHERE ticket_hash = ? AND consumed_at IS NOT NULL AND scope = ?",
|
|
777
|
+
args: [input.renewedScope, activeUntilMs, ticketHash, currentScope],
|
|
778
|
+
});
|
|
779
|
+
return updated.rowsAffected === 0 ? null : activeUntilMs;
|
|
780
|
+
});
|
|
781
|
+
}
|
|
782
|
+
async function readMcpDirectoryWidgetSessionState(sessionId) {
|
|
783
|
+
if (!/^[a-f0-9]{64}$/.test(sessionId))
|
|
784
|
+
return null;
|
|
785
|
+
await ensureTable();
|
|
786
|
+
const { rows } = await getDbExec().execute({
|
|
787
|
+
sql: "SELECT ticket_hash, owner_email, org_id, target_path, scope, created_at, consumed_at, renewal_expires_at, session_active_until " +
|
|
788
|
+
"FROM agent_native_embed_tickets WHERE ticket_hash = ? LIMIT 1",
|
|
789
|
+
args: [sessionId],
|
|
790
|
+
});
|
|
791
|
+
const row = rows[0];
|
|
792
|
+
if (!row)
|
|
793
|
+
return null;
|
|
794
|
+
const ownerEmail = stringOrUndefined(row.owner_email ?? row.ownerEmail);
|
|
795
|
+
const targetPath = normalizeEmbedTargetPath(stringOrUndefined(row.target_path ?? row.targetPath));
|
|
796
|
+
const scope = stringOrUndefined(row.scope);
|
|
797
|
+
const createdAtMs = numberOrNull(row.created_at ?? row.createdAt);
|
|
798
|
+
const consumedAtMs = numberOrNull(row.consumed_at ?? row.consumedAt);
|
|
799
|
+
const storedRenewalExpiresAt = numberOrNull(row.renewal_expires_at ?? row.renewalExpiresAt);
|
|
800
|
+
const sessionActiveUntilMs = numberOrNull(row.session_active_until ?? row.sessionActiveUntil);
|
|
801
|
+
if (!ownerEmail ||
|
|
802
|
+
!targetPath ||
|
|
803
|
+
!scope ||
|
|
804
|
+
!isMcpDirectoryWidgetCapabilityScope(scope) ||
|
|
805
|
+
createdAtMs === null ||
|
|
806
|
+
consumedAtMs === null) {
|
|
807
|
+
return null;
|
|
808
|
+
}
|
|
809
|
+
const renewalExpiryCap = createdAtMs + MCP_DIRECTORY_WIDGET_RENEWAL_TTL_MS;
|
|
810
|
+
const renewalExpiresAtMs = Math.min(storedRenewalExpiresAt ?? renewalExpiryCap, renewalExpiryCap);
|
|
811
|
+
return {
|
|
812
|
+
sessionId,
|
|
813
|
+
ownerEmail,
|
|
814
|
+
...(stringOrUndefined(row.org_id ?? row.orgId)
|
|
815
|
+
? { orgId: stringOrUndefined(row.org_id ?? row.orgId) }
|
|
816
|
+
: {}),
|
|
817
|
+
targetPath,
|
|
818
|
+
scope,
|
|
819
|
+
createdAtMs,
|
|
820
|
+
renewalExpiresAtMs,
|
|
821
|
+
sessionActiveUntilMs,
|
|
822
|
+
};
|
|
823
|
+
}
|
|
597
824
|
export async function resolveEmbedSessionTokenForHost(token, hostname) {
|
|
598
|
-
const verified = verifyEmbedSessionToken(token);
|
|
825
|
+
const verified = verifyEmbedSessionToken(token, { allowExpired: true });
|
|
599
826
|
if (!verified.ok || !embedTokenMatchesHostname(hostname, verified.claims)) {
|
|
600
827
|
return null;
|
|
601
828
|
}
|
|
602
|
-
|
|
603
|
-
|
|
829
|
+
const claims = verified.claims;
|
|
830
|
+
let scope = claims.scope;
|
|
831
|
+
const widgetCapability = isMcpDirectoryWidgetCapabilityScope(scope);
|
|
832
|
+
if (widgetCapability &&
|
|
833
|
+
(typeof claims.ticketCreatedAtMs !== "number" ||
|
|
834
|
+
!Number.isSafeInteger(claims.ticketCreatedAtMs))) {
|
|
604
835
|
return null;
|
|
605
836
|
}
|
|
606
|
-
|
|
837
|
+
if (claims.sessionId) {
|
|
838
|
+
if (!widgetCapability)
|
|
839
|
+
return null;
|
|
840
|
+
const session = await readMcpDirectoryWidgetSessionState(claims.sessionId);
|
|
841
|
+
if (!session ||
|
|
842
|
+
normalizedEmail(session.ownerEmail) !==
|
|
843
|
+
normalizedEmail(claims.ownerEmail) ||
|
|
844
|
+
session.orgId !== claims.orgId ||
|
|
845
|
+
session.targetPath !== claims.targetPath ||
|
|
846
|
+
session.createdAtMs !== claims.ticketCreatedAtMs ||
|
|
847
|
+
session.sessionActiveUntilMs === null ||
|
|
848
|
+
session.sessionActiveUntilMs <= Date.now() ||
|
|
849
|
+
session.renewalExpiresAtMs <= Date.now()) {
|
|
850
|
+
return null;
|
|
851
|
+
}
|
|
852
|
+
scope = session.scope;
|
|
853
|
+
}
|
|
854
|
+
else if (claims.exp < Math.floor(Date.now() / 1000)) {
|
|
855
|
+
return null;
|
|
856
|
+
}
|
|
857
|
+
if (widgetCapability && !isMcpDirectoryWidgetCapabilityScope(scope)) {
|
|
858
|
+
return null;
|
|
859
|
+
}
|
|
860
|
+
const revokesWithOwner = !isEmbedCapabilityScope(scope) || widgetCapability;
|
|
861
|
+
if (revokesWithOwner &&
|
|
862
|
+
(await embedSessionIsRevoked(claims.ownerEmail, Math.min(claims.issuedAtMs ?? claims.iat * 1000, claims.ticketCreatedAtMs ?? Number.MAX_SAFE_INTEGER)))) {
|
|
863
|
+
return null;
|
|
864
|
+
}
|
|
865
|
+
return { ...claims, ...(scope ? { scope } : {}) };
|
|
866
|
+
}
|
|
867
|
+
export async function isExpiredMcpDirectoryWidgetSessionRequest(event) {
|
|
868
|
+
const hostname = requestHostname(event) ?? "";
|
|
869
|
+
const tokens = [
|
|
870
|
+
queryToken(event),
|
|
871
|
+
bearerToken(event),
|
|
872
|
+
getCookie(event, EMBED_SESSION_COOKIE),
|
|
873
|
+
];
|
|
874
|
+
for (const token of tokens) {
|
|
875
|
+
const verified = verifyEmbedSessionToken(token, { allowExpired: true });
|
|
876
|
+
if (!verified.ok ||
|
|
877
|
+
!verified.claims.sessionId ||
|
|
878
|
+
!isMcpDirectoryWidgetCapabilityScope(verified.claims.scope) ||
|
|
879
|
+
!embedTokenMatchesHostname(hostname, verified.claims) ||
|
|
880
|
+
!requestMatchesEmbedTarget(event, verified.claims.targetPath)) {
|
|
881
|
+
continue;
|
|
882
|
+
}
|
|
883
|
+
const session = await readMcpDirectoryWidgetSessionState(verified.claims.sessionId);
|
|
884
|
+
if (!session ||
|
|
885
|
+
normalizedEmail(session.ownerEmail) !==
|
|
886
|
+
normalizedEmail(verified.claims.ownerEmail) ||
|
|
887
|
+
session.orgId !== verified.claims.orgId ||
|
|
888
|
+
session.targetPath !== verified.claims.targetPath ||
|
|
889
|
+
session.createdAtMs !== verified.claims.ticketCreatedAtMs ||
|
|
890
|
+
session.sessionActiveUntilMs === null ||
|
|
891
|
+
session.sessionActiveUntilMs > Date.now() ||
|
|
892
|
+
session.renewalExpiresAtMs <= Date.now()) {
|
|
893
|
+
continue;
|
|
894
|
+
}
|
|
895
|
+
if (await embedSessionIsRevoked(verified.claims.ownerEmail, Math.min(verified.claims.issuedAtMs ?? verified.claims.iat * 1000, session.createdAtMs))) {
|
|
896
|
+
continue;
|
|
897
|
+
}
|
|
898
|
+
return true;
|
|
899
|
+
}
|
|
900
|
+
return false;
|
|
607
901
|
}
|
|
608
902
|
export async function resolveEmbedSessionCookieOwners(tokens) {
|
|
609
903
|
if (tokens.length === 0)
|
|
@@ -641,7 +935,7 @@ export async function consumeEmbedSessionTicket(ticket, options = {}) {
|
|
|
641
935
|
const ticketHash = hashTicket(ticket);
|
|
642
936
|
const ticketKey = ticketHash.slice(0, 12);
|
|
643
937
|
const { rows } = await getDbExec().execute({
|
|
644
|
-
sql: "SELECT ticket_hash, owner_email, org_id, target_path, scope, created_at, expires_at, consumed_at " +
|
|
938
|
+
sql: "SELECT ticket_hash, owner_email, org_id, target_path, scope, created_at, expires_at, consumed_at, renewal_expires_at " +
|
|
645
939
|
"FROM agent_native_embed_tickets WHERE ticket_hash = ?",
|
|
646
940
|
args: [ticketHash],
|
|
647
941
|
});
|
|
@@ -662,12 +956,16 @@ export async function consumeEmbedSessionTicket(ticket, options = {}) {
|
|
|
662
956
|
const row = rows[0];
|
|
663
957
|
const createdAt = numberOrNull(row.created_at ?? row.createdAt);
|
|
664
958
|
const expiresAt = numberOrNull(row.expires_at ?? row.expiresAt);
|
|
959
|
+
const storedRenewalExpiresAt = numberOrNull(row.renewal_expires_at ?? row.renewalExpiresAt);
|
|
665
960
|
const consumedAt = numberOrNull(row.consumed_at ?? row.consumedAt);
|
|
666
961
|
const ownerEmail = stringOrUndefined(row.owner_email ?? row.ownerEmail);
|
|
962
|
+
const scope = stringOrUndefined(row.scope);
|
|
667
963
|
const ticketOwnerKey = redactedIdentifier(normalizedEmail(ownerEmail));
|
|
668
964
|
const orgId = stringOrUndefined(row.org_id ?? row.orgId);
|
|
669
965
|
const ticketOrgKey = redactedIdentifier(orgId);
|
|
670
|
-
const capabilityScope = isEmbedCapabilityScope(
|
|
966
|
+
const capabilityScope = isEmbedCapabilityScope(scope);
|
|
967
|
+
const widgetCapability = isMcpDirectoryWidgetCapabilityScope(scope);
|
|
968
|
+
const revokesWithOwner = !capabilityScope || widgetCapability;
|
|
671
969
|
if (!ownerEmail || createdAt === null || expiresAt === null) {
|
|
672
970
|
options.onResult?.({
|
|
673
971
|
outcome: "invalid-row",
|
|
@@ -682,7 +980,15 @@ export async function consumeEmbedSessionTicket(ticket, options = {}) {
|
|
|
682
980
|
});
|
|
683
981
|
return null;
|
|
684
982
|
}
|
|
685
|
-
const
|
|
983
|
+
const renewalExpiryCap = createdAt + MCP_DIRECTORY_WIDGET_RENEWAL_TTL_MS;
|
|
984
|
+
const renewalExpiresAt = Math.min(storedRenewalExpiresAt ?? renewalExpiryCap, renewalExpiryCap);
|
|
985
|
+
const writeCapabilityExpiresAt = getMcpDirectoryWidgetWriteCapabilityExpiresAt(scope);
|
|
986
|
+
const sessionActiveUntil = isMcpDirectoryWidgetWriteCapabilityScope(scope)
|
|
987
|
+
? Math.min(expiresAt, writeCapabilityExpiresAt ?? 0, renewalExpiresAt)
|
|
988
|
+
: null;
|
|
989
|
+
const identityMismatchAllowed = options.allowCapabilityIdentityMismatch &&
|
|
990
|
+
capabilityScope &&
|
|
991
|
+
!isMcpDirectoryWidgetWriteCapabilityScope(scope);
|
|
686
992
|
if (consumedAt != null) {
|
|
687
993
|
options.onResult?.({
|
|
688
994
|
outcome: "already-consumed",
|
|
@@ -733,7 +1039,7 @@ export async function consumeEmbedSessionTicket(ticket, options = {}) {
|
|
|
733
1039
|
}
|
|
734
1040
|
const client = getDbExec();
|
|
735
1041
|
const claim = async (tx) => {
|
|
736
|
-
if (
|
|
1042
|
+
if (revokesWithOwner) {
|
|
737
1043
|
const key = ownerHash(ownerEmail);
|
|
738
1044
|
if (!key)
|
|
739
1045
|
return "invalid-row";
|
|
@@ -746,23 +1052,29 @@ export async function consumeEmbedSessionTicket(ticket, options = {}) {
|
|
|
746
1052
|
const consumedAt = Date.now();
|
|
747
1053
|
if (expiresAt < consumedAt)
|
|
748
1054
|
return "expired";
|
|
1055
|
+
if (isMcpDirectoryWidgetWriteCapabilityScope(scope) &&
|
|
1056
|
+
(!Number.isSafeInteger(sessionActiveUntil) ||
|
|
1057
|
+
sessionActiveUntil === null ||
|
|
1058
|
+
sessionActiveUntil <= consumedAt)) {
|
|
1059
|
+
return "invalid-row";
|
|
1060
|
+
}
|
|
749
1061
|
const result = await tx.execute({
|
|
750
|
-
sql: "UPDATE agent_native_embed_tickets SET consumed_at = ? " +
|
|
1062
|
+
sql: "UPDATE agent_native_embed_tickets SET consumed_at = ?, session_active_until = ? " +
|
|
751
1063
|
"WHERE ticket_hash = ? AND consumed_at IS NULL",
|
|
752
|
-
args: [consumedAt, ticketHash],
|
|
1064
|
+
args: [consumedAt, sessionActiveUntil, ticketHash],
|
|
753
1065
|
});
|
|
754
1066
|
return result.rowsAffected === 0 ? "consumption-race" : "consumed";
|
|
755
1067
|
};
|
|
756
1068
|
let outcome;
|
|
757
|
-
if (
|
|
758
|
-
outcome = await claim(client);
|
|
759
|
-
}
|
|
760
|
-
else {
|
|
1069
|
+
if (revokesWithOwner) {
|
|
761
1070
|
if (!client.transaction) {
|
|
762
1071
|
throw new Error("Embed ticket consumption requires database transactions.");
|
|
763
1072
|
}
|
|
764
1073
|
outcome = await client.transaction(claim);
|
|
765
1074
|
}
|
|
1075
|
+
else {
|
|
1076
|
+
outcome = await claim(client);
|
|
1077
|
+
}
|
|
766
1078
|
if (outcome !== "consumed") {
|
|
767
1079
|
options.onResult?.({
|
|
768
1080
|
outcome,
|
|
@@ -812,10 +1124,23 @@ export async function consumeEmbedSessionTicket(ticket, options = {}) {
|
|
|
812
1124
|
: {}),
|
|
813
1125
|
expiresAt,
|
|
814
1126
|
ticketCreatedAtMs: createdAt,
|
|
1127
|
+
...(isMcpDirectoryWidgetWriteCapabilityScope(scope)
|
|
1128
|
+
? { sessionId: ticketHash }
|
|
1129
|
+
: {}),
|
|
815
1130
|
};
|
|
816
1131
|
}
|
|
817
1132
|
export function signEmbedSessionToken(input) {
|
|
818
1133
|
const targetPath = normalizeEmbedTargetPath(input.targetPath) ?? "/";
|
|
1134
|
+
if (isMcpDirectoryWidgetCapabilityScope(input.scope ?? undefined) &&
|
|
1135
|
+
(input.ticketCreatedAtMs === undefined ||
|
|
1136
|
+
!Number.isSafeInteger(input.ticketCreatedAtMs))) {
|
|
1137
|
+
throw new Error("Directory widget token requires its ticket creation time.");
|
|
1138
|
+
}
|
|
1139
|
+
if (isMcpDirectoryWidgetWriteCapabilityScope(input.scope ?? undefined) &&
|
|
1140
|
+
(typeof input.sessionId !== "string" ||
|
|
1141
|
+
!/^[a-f0-9]{64}$/.test(input.sessionId))) {
|
|
1142
|
+
throw new Error("Directory widget write token requires its session id.");
|
|
1143
|
+
}
|
|
819
1144
|
const issuedAtMs = Date.now();
|
|
820
1145
|
const now = Math.floor(issuedAtMs / 1000);
|
|
821
1146
|
const ttl = Math.max(1, input.ttlSeconds ?? DEFAULT_TOKEN_TTL_SECONDS);
|
|
@@ -830,6 +1155,8 @@ export function signEmbedSessionToken(input) {
|
|
|
830
1155
|
if (input.ticketCreatedAtMs != null) {
|
|
831
1156
|
claims.ticketCreatedAtMs = input.ticketCreatedAtMs;
|
|
832
1157
|
}
|
|
1158
|
+
if (input.sessionId)
|
|
1159
|
+
claims.sessionId = input.sessionId;
|
|
833
1160
|
if (input.orgId)
|
|
834
1161
|
claims.orgId = input.orgId;
|
|
835
1162
|
if (input.audienceHost) {
|
|
@@ -840,7 +1167,7 @@ export function signEmbedSessionToken(input) {
|
|
|
840
1167
|
const payload = base64UrlEncode(JSON.stringify(claims));
|
|
841
1168
|
return `${payload}.${signPayload(payload)}`;
|
|
842
1169
|
}
|
|
843
|
-
export function verifyEmbedSessionToken(token) {
|
|
1170
|
+
export function verifyEmbedSessionToken(token, options = {}) {
|
|
844
1171
|
if (!token || typeof token !== "string") {
|
|
845
1172
|
return { ok: false, reason: "missing" };
|
|
846
1173
|
}
|
|
@@ -874,11 +1201,14 @@ export function verifyEmbedSessionToken(token) {
|
|
|
874
1201
|
(claims.ticketCreatedAtMs !== undefined &&
|
|
875
1202
|
(typeof claims.ticketCreatedAtMs !== "number" ||
|
|
876
1203
|
!Number.isFinite(claims.ticketCreatedAtMs))) ||
|
|
1204
|
+
(claims.sessionId !== undefined &&
|
|
1205
|
+
(typeof claims.sessionId !== "string" ||
|
|
1206
|
+
!/^[a-f0-9]{64}$/.test(claims.sessionId))) ||
|
|
877
1207
|
typeof claims.exp !== "number" ||
|
|
878
1208
|
!Number.isFinite(claims.exp)) {
|
|
879
1209
|
return { ok: false, reason: "claims" };
|
|
880
1210
|
}
|
|
881
|
-
if (claims.exp < Math.floor(Date.now() / 1000)) {
|
|
1211
|
+
if (!options.allowExpired && claims.exp < Math.floor(Date.now() / 1000)) {
|
|
882
1212
|
return { ok: false, reason: "expired" };
|
|
883
1213
|
}
|
|
884
1214
|
claims.targetPath = normalizeEmbedTargetPath(claims.targetPath) ?? "/";
|
|
@@ -948,7 +1278,7 @@ export async function resolveEmbedSessionFromRequest(event) {
|
|
|
948
1278
|
if (candidate.source === "query" && candidate.token) {
|
|
949
1279
|
try {
|
|
950
1280
|
setEmbedSessionCookie(event, candidate.token);
|
|
951
|
-
setResponseHeader(event, "Referrer-Policy", "
|
|
1281
|
+
setResponseHeader(event, "Referrer-Policy", "no-referrer");
|
|
952
1282
|
}
|
|
953
1283
|
catch {
|
|
954
1284
|
// Some tests and edge runtimes expose read-only request shims. The
|
|
@@ -965,6 +1295,22 @@ export async function resolveEmbedSessionFromRequest(event) {
|
|
|
965
1295
|
}
|
|
966
1296
|
return null;
|
|
967
1297
|
}
|
|
1298
|
+
export function hasExplicitEmbedSessionCredential(event) {
|
|
1299
|
+
if (queryToken(event))
|
|
1300
|
+
return true;
|
|
1301
|
+
const targetHeader = getHeader(event, EMBED_TARGET_HEADER);
|
|
1302
|
+
const targetQuery = getQuery(event)?.[EMBED_TARGET_QUERY_PARAM];
|
|
1303
|
+
if (bearerToken(event) &&
|
|
1304
|
+
(typeof targetHeader === "string" ||
|
|
1305
|
+
typeof targetQuery === "string" ||
|
|
1306
|
+
(Array.isArray(targetQuery) && typeof targetQuery[0] === "string"))) {
|
|
1307
|
+
return true;
|
|
1308
|
+
}
|
|
1309
|
+
const cookieClaims = verifyEmbedSessionToken(getCookie(event, EMBED_SESSION_COOKIE));
|
|
1310
|
+
return (cookieClaims.ok &&
|
|
1311
|
+
embedTokenMatchesRequestAudience(event, cookieClaims.claims) &&
|
|
1312
|
+
requestMatchesEmbedTarget(event, cookieClaims.claims.targetPath));
|
|
1313
|
+
}
|
|
968
1314
|
export function requestHasEmbedAuthMarker(event) {
|
|
969
1315
|
try {
|
|
970
1316
|
const q = getQuery(event) ?? {};
|
|
@@ -54,8 +54,8 @@ export declare function createRealtimeTokenHandler(): import("h3").EventHandlerW
|
|
|
54
54
|
expiresAt?: undefined;
|
|
55
55
|
ttlSeconds?: undefined;
|
|
56
56
|
} | {
|
|
57
|
-
error?: undefined;
|
|
58
57
|
token: string;
|
|
59
58
|
expiresAt: string;
|
|
60
59
|
ttlSeconds: number;
|
|
60
|
+
error?: undefined;
|
|
61
61
|
}>>;
|
|
@@ -65,6 +65,8 @@ export interface RequestContext {
|
|
|
65
65
|
};
|
|
66
66
|
identityAuthenticatedAtMs?: number;
|
|
67
67
|
identitySessionToken?: string;
|
|
68
|
+
/** Signed MCP credential issue time, used to revoke derived widget grants. */
|
|
69
|
+
mcpCredentialIssuedAtMs?: number | null;
|
|
68
70
|
authUserId?: string;
|
|
69
71
|
agentRunAnonymous?: boolean;
|
|
70
72
|
userName?: string;
|
|
@@ -177,6 +177,16 @@ export function runWithRequestContext(ctx, fn) {
|
|
|
177
177
|
Number.isFinite(context.identityAuthenticatedAtMs)
|
|
178
178
|
? context.identityAuthenticatedAtMs
|
|
179
179
|
: undefined;
|
|
180
|
+
const inheritedMcpCredentialIssuedAtMs = inheritedUserEmail === contextUserEmail &&
|
|
181
|
+
typeof inheritedContext?.mcpCredentialIssuedAtMs === "number" &&
|
|
182
|
+
Number.isSafeInteger(inheritedContext?.mcpCredentialIssuedAtMs)
|
|
183
|
+
? inheritedContext.mcpCredentialIssuedAtMs
|
|
184
|
+
: undefined;
|
|
185
|
+
const contextMcpCredentialIssuedAtMs = typeof context.mcpCredentialIssuedAtMs === "number" &&
|
|
186
|
+
Number.isSafeInteger(context.mcpCredentialIssuedAtMs)
|
|
187
|
+
? context.mcpCredentialIssuedAtMs
|
|
188
|
+
: undefined;
|
|
189
|
+
const clearMcpCredentialIssuedAt = context.mcpCredentialIssuedAtMs === null;
|
|
180
190
|
const inheritedSessionToken = inheritedUserEmail === contextUserEmail &&
|
|
181
191
|
typeof inheritedContext?.identitySessionToken === "string"
|
|
182
192
|
? inheritedContext.identitySessionToken
|
|
@@ -187,16 +197,30 @@ export function runWithRequestContext(ctx, fn) {
|
|
|
187
197
|
inheritedAuthTime !== undefined
|
|
188
198
|
? Math.min(inheritedAuthTime, contextAuthTime ?? inheritedAuthTime)
|
|
189
199
|
: (contextAuthTime ?? Date.now()),
|
|
200
|
+
...(clearMcpCredentialIssuedAt
|
|
201
|
+
? { mcpCredentialIssuedAtMs: null }
|
|
202
|
+
: inheritedMcpCredentialIssuedAtMs !== undefined ||
|
|
203
|
+
contextMcpCredentialIssuedAtMs !== undefined
|
|
204
|
+
? {
|
|
205
|
+
mcpCredentialIssuedAtMs: inheritedUserEmail === contextUserEmail &&
|
|
206
|
+
inheritedMcpCredentialIssuedAtMs !== undefined
|
|
207
|
+
? Math.min(inheritedMcpCredentialIssuedAtMs, contextMcpCredentialIssuedAtMs ??
|
|
208
|
+
inheritedMcpCredentialIssuedAtMs)
|
|
209
|
+
: contextMcpCredentialIssuedAtMs,
|
|
210
|
+
}
|
|
211
|
+
: {}),
|
|
190
212
|
...(context.identitySessionToken === undefined && inheritedSessionToken
|
|
191
213
|
? { identitySessionToken: inheritedSessionToken }
|
|
192
214
|
: {}),
|
|
193
215
|
};
|
|
194
216
|
}
|
|
195
217
|
else if (context.identityAuthenticatedAtMs !== undefined ||
|
|
196
|
-
context.identitySessionToken !== undefined
|
|
218
|
+
context.identitySessionToken !== undefined ||
|
|
219
|
+
context.mcpCredentialIssuedAtMs !== undefined) {
|
|
197
220
|
const contextWithoutIdentityTime = { ...context };
|
|
198
221
|
delete contextWithoutIdentityTime.identityAuthenticatedAtMs;
|
|
199
222
|
delete contextWithoutIdentityTime.identitySessionToken;
|
|
223
|
+
delete contextWithoutIdentityTime.mcpCredentialIssuedAtMs;
|
|
200
224
|
context = contextWithoutIdentityTime;
|
|
201
225
|
}
|
|
202
226
|
if (context.run?.allowedActionNames !== undefined ||
|