managed-deepagents 0.5.3-dev.111 → 0.5.3-dev.113
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 +20 -17
- package/dist/channels/manifest.d.ts +0 -2
- package/dist/channels/manifest.d.ts.map +1 -1
- package/dist/channels/slack/http.d.ts.map +1 -1
- package/dist/channels/slack/http.js +3 -48
- package/dist/channels/slack/http.js.map +1 -1
- package/dist/channels/slack/index.d.ts +2 -3
- package/dist/channels/slack/index.d.ts.map +1 -1
- package/dist/channels/slack/index.js +2 -3
- package/dist/channels/slack/index.js.map +1 -1
- package/dist/connectors/mcp/index.d.ts.map +1 -1
- package/dist/connectors/mcp/index.js +5 -1
- package/dist/connectors/mcp/index.js.map +1 -1
- package/dist/connectors/mcp/load.js +3 -0
- package/dist/connectors/mcp/load.js.map +1 -1
- package/dist/connectors/tool-selection.d.ts +13 -18
- package/dist/connectors/tool-selection.d.ts.map +1 -1
- package/dist/connectors/tool-selection.js +10 -13
- package/dist/connectors/tool-selection.js.map +1 -1
- package/dist/extension.d.ts +5 -5
- package/dist/extension.js +5 -5
- package/dist/identity/index.d.ts +2 -11
- package/dist/identity/index.d.ts.map +1 -1
- package/dist/identity/index.js +8 -66
- package/dist/identity/index.js.map +1 -1
- package/dist/identity/options.d.ts +3 -3
- package/dist/identity/options.js +7 -8
- package/dist/identity/options.js.map +1 -1
- package/dist/identity/slack/links.d.ts +1 -2
- package/dist/identity/slack/links.d.ts.map +1 -1
- package/dist/identity/slack/links.js +1 -2
- package/dist/identity/slack/links.js.map +1 -1
- package/dist/identity/supabase.d.ts.map +1 -1
- package/dist/identity/supabase.js +2 -0
- package/dist/identity/supabase.js.map +1 -1
- package/dist/identity/types.d.ts +8 -81
- package/dist/identity/types.d.ts.map +1 -1
- package/dist/index.d.ts +2 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/namespaces.d.ts +5 -183
- package/dist/namespaces.d.ts.map +1 -1
- package/dist/namespaces.js +1 -63
- package/dist/namespaces.js.map +1 -1
- package/dist/runtime/auth.d.ts +11 -14
- package/dist/runtime/auth.d.ts.map +1 -1
- package/dist/runtime/auth.js +15 -54
- package/dist/runtime/auth.js.map +1 -1
- package/dist/runtime/cors.d.ts +5 -4
- package/dist/runtime/cors.d.ts.map +1 -1
- package/dist/runtime/cors.js +5 -9
- package/dist/runtime/cors.js.map +1 -1
- package/dist/runtime/identity-http.d.ts.map +1 -1
- package/dist/runtime/identity-http.js +0 -69
- package/dist/runtime/identity-http.js.map +1 -1
- package/dist/runtime/identity-runtime.d.ts +2 -10
- package/dist/runtime/identity-runtime.d.ts.map +1 -1
- package/dist/runtime/identity-runtime.js +2 -38
- package/dist/runtime/identity-runtime.js.map +1 -1
- package/dist/runtime/index.d.ts +15 -11
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +8 -44
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/managed-middleware.d.ts +2 -3
- package/dist/runtime/managed-middleware.d.ts.map +1 -1
- package/dist/runtime/managed-middleware.js +12 -12
- package/dist/runtime/managed-middleware.js.map +1 -1
- package/dist/runtime/managed-tools.d.ts +4 -11
- package/dist/runtime/managed-tools.d.ts.map +1 -1
- package/dist/runtime/managed-tools.js +11 -18
- package/dist/runtime/managed-tools.js.map +1 -1
- package/dist/runtime/memory/context-io.d.ts +0 -1
- package/dist/runtime/memory/context-io.d.ts.map +1 -1
- package/dist/runtime/memory/context-io.js +0 -10
- package/dist/runtime/memory/context-io.js.map +1 -1
- package/dist/runtime/memory/mounts.d.ts.map +1 -1
- package/dist/runtime/memory/mounts.js +0 -10
- package/dist/runtime/memory/mounts.js.map +1 -1
- package/dist/runtime/validated-token.d.ts.map +1 -1
- package/dist/runtime/validated-token.js +7 -1
- package/dist/runtime/validated-token.js.map +1 -1
- package/package.json +10 -11
- package/dist/channels/index.d.ts +0 -25
- package/dist/channels/index.d.ts.map +0 -1
- package/dist/channels/index.js +0 -18
- package/dist/channels/index.js.map +0 -1
- package/dist/connectors/marketplace/catalog.d.ts +0 -96
- package/dist/connectors/marketplace/catalog.d.ts.map +0 -1
- package/dist/connectors/marketplace/catalog.js +0 -213
- package/dist/connectors/marketplace/catalog.js.map +0 -1
- package/dist/connectors/marketplace/fleet-mcp.d.ts +0 -62
- package/dist/connectors/marketplace/fleet-mcp.d.ts.map +0 -1
- package/dist/connectors/marketplace/fleet-mcp.js +0 -215
- package/dist/connectors/marketplace/fleet-mcp.js.map +0 -1
- package/dist/connectors/marketplace/index.d.ts +0 -31
- package/dist/connectors/marketplace/index.d.ts.map +0 -1
- package/dist/connectors/marketplace/index.js +0 -39
- package/dist/connectors/marketplace/index.js.map +0 -1
- package/dist/connectors/marketplace/load.d.ts +0 -14
- package/dist/connectors/marketplace/load.d.ts.map +0 -1
- package/dist/connectors/marketplace/load.js +0 -206
- package/dist/connectors/marketplace/load.js.map +0 -1
- package/dist/connectors/slack/index.d.ts +0 -24
- package/dist/connectors/slack/index.d.ts.map +0 -1
- package/dist/connectors/slack/index.js +0 -64
- package/dist/connectors/slack/index.js.map +0 -1
- package/dist/connectors/toolserver/catalog.d.ts +0 -326
- package/dist/connectors/toolserver/catalog.d.ts.map +0 -1
- package/dist/connectors/toolserver/catalog.js +0 -415
- package/dist/connectors/toolserver/catalog.js.map +0 -1
- package/dist/connectors/toolserver/connectors.d.ts +0 -698
- package/dist/connectors/toolserver/connectors.d.ts.map +0 -1
- package/dist/connectors/toolserver/connectors.js +0 -13
- package/dist/connectors/toolserver/connectors.js.map +0 -1
- package/dist/connectors/toolserver/index.d.ts +0 -142
- package/dist/connectors/toolserver/index.d.ts.map +0 -1
- package/dist/connectors/toolserver/index.js +0 -105
- package/dist/connectors/toolserver/index.js.map +0 -1
- package/dist/connectors/toolserver/integrations.d.ts +0 -103
- package/dist/connectors/toolserver/integrations.d.ts.map +0 -1
- package/dist/connectors/toolserver/integrations.js +0 -288
- package/dist/connectors/toolserver/integrations.js.map +0 -1
- package/dist/connectors/toolserver/load.d.ts +0 -55
- package/dist/connectors/toolserver/load.d.ts.map +0 -1
- package/dist/connectors/toolserver/load.js +0 -289
- package/dist/connectors/toolserver/load.js.map +0 -1
- package/dist/identity/actor-subject.d.ts +0 -60
- package/dist/identity/actor-subject.d.ts.map +0 -1
- package/dist/identity/actor-subject.js +0 -107
- package/dist/identity/actor-subject.js.map +0 -1
- package/dist/identity/byo-oauth.d.ts +0 -105
- package/dist/identity/byo-oauth.d.ts.map +0 -1
- package/dist/identity/byo-oauth.js +0 -190
- package/dist/identity/byo-oauth.js.map +0 -1
- package/dist/identity/connect-inference.d.ts +0 -37
- package/dist/identity/connect-inference.d.ts.map +0 -1
- package/dist/identity/connect-inference.js +0 -53
- package/dist/identity/connect-inference.js.map +0 -1
- package/dist/identity/connect-paths.d.ts +0 -8
- package/dist/identity/connect-paths.d.ts.map +0 -1
- package/dist/identity/connect-paths.js +0 -11
- package/dist/identity/connect-paths.js.map +0 -1
- package/dist/identity/connect-provider-types.d.ts +0 -97
- package/dist/identity/connect-provider-types.d.ts.map +0 -1
- package/dist/identity/connect-provider-types.js +0 -10
- package/dist/identity/connect-provider-types.js.map +0 -1
- package/dist/identity/connect-provider.d.ts +0 -35
- package/dist/identity/connect-provider.d.ts.map +0 -1
- package/dist/identity/connect-provider.js +0 -148
- package/dist/identity/connect-provider.js.map +0 -1
- package/dist/identity/credential-resolvers.d.ts +0 -33
- package/dist/identity/credential-resolvers.d.ts.map +0 -1
- package/dist/identity/credential-resolvers.js +0 -62
- package/dist/identity/credential-resolvers.js.map +0 -1
- package/dist/identity/define-fleet-connect.d.ts +0 -53
- package/dist/identity/define-fleet-connect.d.ts.map +0 -1
- package/dist/identity/define-fleet-connect.js +0 -76
- package/dist/identity/define-fleet-connect.js.map +0 -1
- package/dist/identity/fleet-connect-hint.d.ts +0 -41
- package/dist/identity/fleet-connect-hint.d.ts.map +0 -1
- package/dist/identity/fleet-connect-hint.js +0 -190
- package/dist/identity/fleet-connect-hint.js.map +0 -1
- package/dist/identity/fleet-connect.d.ts +0 -93
- package/dist/identity/fleet-connect.d.ts.map +0 -1
- package/dist/identity/fleet-connect.js +0 -256
- package/dist/identity/fleet-connect.js.map +0 -1
- package/dist/identity/fleet-integration-connect.d.ts +0 -32
- package/dist/identity/fleet-integration-connect.d.ts.map +0 -1
- package/dist/identity/fleet-integration-connect.js +0 -35
- package/dist/identity/fleet-integration-connect.js.map +0 -1
- package/dist/identity/fleet.d.ts +0 -56
- package/dist/identity/fleet.d.ts.map +0 -1
- package/dist/identity/fleet.js +0 -131
- package/dist/identity/fleet.js.map +0 -1
- package/dist/identity/github/connect-http.d.ts +0 -37
- package/dist/identity/github/connect-http.d.ts.map +0 -1
- package/dist/identity/github/connect-http.js +0 -128
- package/dist/identity/github/connect-http.js.map +0 -1
- package/dist/identity/github/credentials-store.d.ts +0 -76
- package/dist/identity/github/credentials-store.d.ts.map +0 -1
- package/dist/identity/github/credentials-store.js +0 -270
- package/dist/identity/github/credentials-store.js.map +0 -1
- package/dist/identity/github/credentials.d.ts +0 -87
- package/dist/identity/github/credentials.d.ts.map +0 -1
- package/dist/identity/github/credentials.js +0 -201
- package/dist/identity/github/credentials.js.map +0 -1
- package/dist/identity/github/index.d.ts +0 -7
- package/dist/identity/github/index.d.ts.map +0 -1
- package/dist/identity/github/index.js +0 -6
- package/dist/identity/github/index.js.map +0 -1
- package/dist/identity/github/oauth.d.ts +0 -47
- package/dist/identity/github/oauth.d.ts.map +0 -1
- package/dist/identity/github/oauth.js +0 -124
- package/dist/identity/github/oauth.js.map +0 -1
- package/dist/identity/google/connect-http.d.ts +0 -37
- package/dist/identity/google/connect-http.d.ts.map +0 -1
- package/dist/identity/google/connect-http.js +0 -42
- package/dist/identity/google/connect-http.js.map +0 -1
- package/dist/identity/google/index.d.ts +0 -7
- package/dist/identity/google/index.d.ts.map +0 -1
- package/dist/identity/google/index.js +0 -6
- package/dist/identity/google/index.js.map +0 -1
- package/dist/identity/google/oauth.d.ts +0 -22
- package/dist/identity/google/oauth.d.ts.map +0 -1
- package/dist/identity/google/oauth.js +0 -48
- package/dist/identity/google/oauth.js.map +0 -1
- package/dist/identity/linkedin/connect-http.d.ts +0 -37
- package/dist/identity/linkedin/connect-http.d.ts.map +0 -1
- package/dist/identity/linkedin/connect-http.js +0 -41
- package/dist/identity/linkedin/connect-http.js.map +0 -1
- package/dist/identity/linkedin/index.d.ts +0 -7
- package/dist/identity/linkedin/index.d.ts.map +0 -1
- package/dist/identity/linkedin/index.js +0 -6
- package/dist/identity/linkedin/index.js.map +0 -1
- package/dist/identity/linkedin/oauth.d.ts +0 -22
- package/dist/identity/linkedin/oauth.d.ts.map +0 -1
- package/dist/identity/linkedin/oauth.js +0 -47
- package/dist/identity/linkedin/oauth.js.map +0 -1
- package/dist/identity/marketplace/connect-hint.d.ts +0 -31
- package/dist/identity/marketplace/connect-hint.d.ts.map +0 -1
- package/dist/identity/marketplace/connect-hint.js +0 -59
- package/dist/identity/marketplace/connect-hint.js.map +0 -1
- package/dist/identity/marketplace/connect.d.ts +0 -51
- package/dist/identity/marketplace/connect.d.ts.map +0 -1
- package/dist/identity/marketplace/connect.js +0 -88
- package/dist/identity/marketplace/connect.js.map +0 -1
- package/dist/identity/marketplace/index.d.ts +0 -9
- package/dist/identity/marketplace/index.d.ts.map +0 -1
- package/dist/identity/marketplace/index.js +0 -9
- package/dist/identity/marketplace/index.js.map +0 -1
- package/dist/identity/microsoft/connect-http.d.ts +0 -38
- package/dist/identity/microsoft/connect-http.d.ts.map +0 -1
- package/dist/identity/microsoft/connect-http.js +0 -42
- package/dist/identity/microsoft/connect-http.js.map +0 -1
- package/dist/identity/microsoft/index.d.ts +0 -7
- package/dist/identity/microsoft/index.d.ts.map +0 -1
- package/dist/identity/microsoft/index.js +0 -6
- package/dist/identity/microsoft/index.js.map +0 -1
- package/dist/identity/microsoft/oauth.d.ts +0 -24
- package/dist/identity/microsoft/oauth.d.ts.map +0 -1
- package/dist/identity/microsoft/oauth.js +0 -65
- package/dist/identity/microsoft/oauth.js.map +0 -1
- package/dist/identity/oauth-env.d.ts +0 -43
- package/dist/identity/oauth-env.d.ts.map +0 -1
- package/dist/identity/oauth-env.js +0 -66
- package/dist/identity/oauth-env.js.map +0 -1
- package/dist/identity/oauth-tickets.d.ts +0 -37
- package/dist/identity/oauth-tickets.d.ts.map +0 -1
- package/dist/identity/oauth-tickets.js +0 -114
- package/dist/identity/oauth-tickets.js.map +0 -1
- package/dist/identity/slack/connect-http.d.ts +0 -35
- package/dist/identity/slack/connect-http.d.ts.map +0 -1
- package/dist/identity/slack/connect-http.js +0 -115
- package/dist/identity/slack/connect-http.js.map +0 -1
- package/dist/identity/slack/index.d.ts +0 -8
- package/dist/identity/slack/index.d.ts.map +0 -1
- package/dist/identity/slack/index.js +0 -7
- package/dist/identity/slack/index.js.map +0 -1
- package/dist/identity/slack/oauth.d.ts +0 -28
- package/dist/identity/slack/oauth.d.ts.map +0 -1
- package/dist/identity/slack/oauth.js +0 -87
- package/dist/identity/slack/oauth.js.map +0 -1
- package/dist/identity/x/connect-http.d.ts +0 -38
- package/dist/identity/x/connect-http.d.ts.map +0 -1
- package/dist/identity/x/connect-http.js +0 -41
- package/dist/identity/x/connect-http.js.map +0 -1
- package/dist/identity/x/index.d.ts +0 -6
- package/dist/identity/x/index.d.ts.map +0 -1
- package/dist/identity/x/index.js +0 -5
- package/dist/identity/x/index.js.map +0 -1
- package/dist/runtime/credentials.d.ts +0 -68
- package/dist/runtime/credentials.d.ts.map +0 -1
- package/dist/runtime/credentials.js +0 -235
- package/dist/runtime/credentials.js.map +0 -1
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Connect-hint middleware for Fleet marketplace MCP bridges.
|
|
3
|
-
*
|
|
4
|
-
* Same proactive "not connected yet" system hint as toolserver Fleet OAuth
|
|
5
|
-
* integrations ({@link createFleetConnectHintMiddleware}), but the vault
|
|
6
|
-
* `provider_id` is discovered from the workspace `mcp_servers` row.
|
|
7
|
-
*/
|
|
8
|
-
import { resolveMarketplaceMcpServer } from "../../connectors/marketplace/fleet-mcp.js";
|
|
9
|
-
import { agentIdFromActor } from "../actor-subject.js";
|
|
10
|
-
import { createFleetConnectHintMiddleware, fleetConnectHintUrl, } from "../fleet-connect-hint.js";
|
|
11
|
-
import { listAgentConnections } from "../fleet.js";
|
|
12
|
-
/** Adapt a marketplace catalog row to the Fleet Connect / hint integration shape. */
|
|
13
|
-
export function marketplaceAsFleetHint(integration, providerId = "") {
|
|
14
|
-
return {
|
|
15
|
-
id: integration.id,
|
|
16
|
-
connectId: integration.connectId,
|
|
17
|
-
displayName: integration.displayName,
|
|
18
|
-
defaultProviderSlug: providerId,
|
|
19
|
-
toolServerSlugs: [],
|
|
20
|
-
scopesBySlug: {},
|
|
21
|
-
...(integration.scopes?.length
|
|
22
|
-
? { profileScopes: [...integration.scopes] }
|
|
23
|
-
: {}),
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Absolute Connect start URL for a marketplace bridge (with optional ticket).
|
|
28
|
-
*/
|
|
29
|
-
export async function marketplaceConnectHintUrl(integration, env = process.env, userId) {
|
|
30
|
-
return fleetConnectHintUrl(marketplaceAsFleetHint(integration), env, userId);
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Middleware that injects a system hint when the caller has no vault connection
|
|
34
|
-
* for this marketplace MCP integration.
|
|
35
|
-
*/
|
|
36
|
-
export function createMarketplaceConnectHintMiddleware(integration, options = {}) {
|
|
37
|
-
const list = options.fleet?.list ?? listAgentConnections;
|
|
38
|
-
const resolve = options.fleet?.resolveServer ?? resolveMarketplaceMcpServer;
|
|
39
|
-
return createFleetConnectHintMiddleware({
|
|
40
|
-
integration: marketplaceAsFleetHint(integration),
|
|
41
|
-
resolvePublicAppUrl: options.resolvePublicAppUrl,
|
|
42
|
-
fleet: options.fleet,
|
|
43
|
-
isConnected: options.isConnected ??
|
|
44
|
-
(async (userId) => {
|
|
45
|
-
const server = await resolve({
|
|
46
|
-
mcpUrl: integration.mcpUrl,
|
|
47
|
-
...(options.fleet ?? {}),
|
|
48
|
-
});
|
|
49
|
-
const providerId = server.oauth_provider_id?.trim();
|
|
50
|
-
if (!providerId) {
|
|
51
|
-
return false;
|
|
52
|
-
}
|
|
53
|
-
const agentId = agentIdFromActor(userId);
|
|
54
|
-
const connections = await list(agentId, options.fleet ?? {});
|
|
55
|
-
return connections.some((c) => c.provider_id === providerId);
|
|
56
|
-
}),
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
//# sourceMappingURL=connect-hint.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"connect-hint.js","sourceRoot":"","sources":["../../../src/identity/marketplace/connect-hint.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAC;AAGxF,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EACL,gCAAgC,EAChC,mBAAmB,GAEpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,oBAAoB,EAA2B,MAAM,aAAa,CAAC;AAE5E,qFAAqF;AACrF,MAAM,UAAU,sBAAsB,CACpC,WAAsC,EACtC,UAAU,GAAG,EAAE;IAEf,OAAO;QACL,EAAE,EAAE,WAAW,CAAC,EAAE;QAClB,SAAS,EAAE,WAAW,CAAC,SAAS;QAChC,WAAW,EAAE,WAAW,CAAC,WAAW;QACpC,mBAAmB,EAAE,UAAU;QAC/B,eAAe,EAAE,EAAE;QACnB,YAAY,EAAE,EAAE;QAChB,GAAG,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM;YAC5B,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,GAAG,WAAW,CAAC,MAAM,CAAC,EAAE;YAC5C,CAAC,CAAC,EAAE,CAAC;KACR,CAAC;AACJ,CAAC;AAYD;;GAEG;AACH,MA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;KACL,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Connect-with-X for Fleet marketplace MCP integrations.
|
|
3
|
-
*
|
|
4
|
-
* Thin adapter over {@link createFleetVaultConnectProvider}: same actor →
|
|
5
|
-
* agent_id vault lifecycle as Google / Microsoft / LinkedIn, but the OAuth
|
|
6
|
-
* provider slug is discovered at runtime from the workspace `mcp_servers` row.
|
|
7
|
-
*
|
|
8
|
-
* `connect.<id>()` factories and identity-http candidates are derived from
|
|
9
|
-
* {@link MARKETPLACE_MCP_INTEGRATIONS}.
|
|
10
|
-
*/
|
|
11
|
-
import { type MarketplaceMcpIntegration, type MarketplaceMcpIntegrationId } from "../../connectors/marketplace/catalog.js";
|
|
12
|
-
import { resolveMarketplaceMcpServer } from "../../connectors/marketplace/fleet-mcp.js";
|
|
13
|
-
import type { IdentityConnectProvider } from "../connect-provider-types.js";
|
|
14
|
-
import { createFleetAuthSession, deleteAgentConnection, listAgentConnections, type FleetClientOptions } from "../fleet.js";
|
|
15
|
-
export interface MarketplaceConnectProviderOptions {
|
|
16
|
-
/** Injectable Fleet client (tests). */
|
|
17
|
-
fleet?: FleetClientOptions & {
|
|
18
|
-
list?: typeof listAgentConnections;
|
|
19
|
-
delete?: typeof deleteAgentConnection;
|
|
20
|
-
resolveServer?: typeof resolveMarketplaceMcpServer;
|
|
21
|
-
createSession?: typeof createFleetAuthSession;
|
|
22
|
-
};
|
|
23
|
-
/** Override OAuth scopes (default: integration.scopes). */
|
|
24
|
-
scopes?: string[];
|
|
25
|
-
}
|
|
26
|
-
/** `connect.<id>()` factories for every marketplace catalog entry. */
|
|
27
|
-
export type MarketplaceConnect = {
|
|
28
|
-
[Id in MarketplaceMcpIntegrationId]: (options?: MarketplaceConnectProviderOptions) => IdentityConnectProvider;
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* Build a Connect provider for a marketplace MCP integration.
|
|
32
|
-
*
|
|
33
|
-
* Mounts when declared on `identity.connect`, or when the matching
|
|
34
|
-
* `connectors.<id>` is present on a user-scoped deployment.
|
|
35
|
-
*/
|
|
36
|
-
export declare function createMarketplaceVaultConnectProvider(integration: MarketplaceMcpIntegration, options?: MarketplaceConnectProviderOptions): IdentityConnectProvider;
|
|
37
|
-
/**
|
|
38
|
-
* Default Connect providers for every marketplace catalog entry.
|
|
39
|
-
*
|
|
40
|
-
* Shared between `connect.<id>()` (no options) and identity-http candidates so
|
|
41
|
-
* mount inference and explicit opt-in use the same instances.
|
|
42
|
-
*/
|
|
43
|
-
export declare const marketplaceIdentityConnectProviders: IdentityConnectProvider[];
|
|
44
|
-
/**
|
|
45
|
-
* `connect.<id>()` factories derived from the marketplace catalog.
|
|
46
|
-
*
|
|
47
|
-
* Usually unnecessary: declaring `connectors.<id>` on a user-scoped identity
|
|
48
|
-
* deployment mounts the matching Connect flow automatically.
|
|
49
|
-
*/
|
|
50
|
-
export declare const marketplaceConnect: MarketplaceConnect;
|
|
51
|
-
//# sourceMappingURL=connect.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../../../src/identity/marketplace/connect.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAGL,KAAK,yBAAyB,EAC9B,KAAK,2BAA2B,EACjC,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAC;AAExF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAK5E,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,KAAK,kBAAkB,EACxB,MAAM,aAAa,CAAC;AAQrB,MAAM,WAAW,iCAAiC;IAChD,uCAAuC;IACvC,KAAK,CAAC,EAAE,kBAAkB,GAAG;QAC3B,IAAI,CAAC,EAAE,OAAO,oBAAoB,CAAC;QACnC,MAAM,CAAC,EAAE,OAAO,qBAAqB,CAAC;QACtC,aAAa,CAAC,EAAE,OAAO,2BAA2B,CAAC;QACnD,aAAa,CAAC,EAAE,OAAO,sBAAsB,CAAC;KAC/C,CAAC;IACF,2DAA2D;IAC3D,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,sEAAsE;AACtE,MAAM,MAAM,kBAAkB,GAAG;KAC9B,EAAE,IAAI,2BAA2B,GAAG,CACnC,OAAO,CAAC,EAAE,iCAAiC,KACxC,uBAAuB;CAC7B,CAAC;AAuBF;;;;;GAKG;AACH,wBAAgB,qCAAqC,CACnD,WAAW,EAAE,yBAAyB,EACtC,OAAO,GAAE,iCAAsC,GAC9C,uBAAuB,CAqCzB;AAED;;;;;GAKG;AACH,eAAO,MAAM,mCAAmC,EAAE,uBAAuB,EAGtE,CAAC;AAEJ;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,kBAUV,CAAC"}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Connect-with-X for Fleet marketplace MCP integrations.
|
|
3
|
-
*
|
|
4
|
-
* Thin adapter over {@link createFleetVaultConnectProvider}: same actor →
|
|
5
|
-
* agent_id vault lifecycle as Google / Microsoft / LinkedIn, but the OAuth
|
|
6
|
-
* provider slug is discovered at runtime from the workspace `mcp_servers` row.
|
|
7
|
-
*
|
|
8
|
-
* `connect.<id>()` factories and identity-http candidates are derived from
|
|
9
|
-
* {@link MARKETPLACE_MCP_INTEGRATIONS}.
|
|
10
|
-
*/
|
|
11
|
-
import { MARKETPLACE_MCP_INTEGRATIONS, hasMarketplaceConnector, } from "../../connectors/marketplace/catalog.js";
|
|
12
|
-
import { resolveMarketplaceMcpServer } from "../../connectors/marketplace/fleet-mcp.js";
|
|
13
|
-
import { enableActorSubjectIntegration } from "../actor-subject.js";
|
|
14
|
-
import { createFleetVaultConnectProvider, } from "../fleet-connect.js";
|
|
15
|
-
import { createFleetAuthSession, deleteAgentConnection, listAgentConnections, } from "../fleet.js";
|
|
16
|
-
import { MDA_PUBLIC_API_URL_ENV, MDA_PUBLIC_APP_URL_ENV, resolveOauthRedirectBase, } from "../oauth-env.js";
|
|
17
|
-
import { marketplaceAsFleetHint } from "./connect-hint.js";
|
|
18
|
-
function fleetClientOptions(fleet) {
|
|
19
|
-
if (!fleet) {
|
|
20
|
-
return undefined;
|
|
21
|
-
}
|
|
22
|
-
const { list, delete: remove, createSession, resolveServer: _resolveServer, ...rest } = fleet;
|
|
23
|
-
return {
|
|
24
|
-
...rest,
|
|
25
|
-
...(list ? { list } : {}),
|
|
26
|
-
...(remove ? { delete: remove } : {}),
|
|
27
|
-
...(createSession ? { createAuthSession: createSession } : {}),
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Build a Connect provider for a marketplace MCP integration.
|
|
32
|
-
*
|
|
33
|
-
* Mounts when declared on `identity.connect`, or when the matching
|
|
34
|
-
* `connectors.<id>` is present on a user-scoped deployment.
|
|
35
|
-
*/
|
|
36
|
-
export function createMarketplaceVaultConnectProvider(integration, options = {}) {
|
|
37
|
-
const resolveServer = options.fleet?.resolveServer ?? resolveMarketplaceMcpServer;
|
|
38
|
-
const fleet = fleetClientOptions(options.fleet);
|
|
39
|
-
return createFleetVaultConnectProvider({
|
|
40
|
-
integration: marketplaceAsFleetHint(integration),
|
|
41
|
-
...(options.scopes ? { scopes: [...options.scopes] } : {}),
|
|
42
|
-
fallbackScopes: [...(integration.scopes ?? [])],
|
|
43
|
-
resolveRedirectBase: resolveOauthRedirectBase,
|
|
44
|
-
resolvePublicAppUrl() {
|
|
45
|
-
return (process.env[MDA_PUBLIC_APP_URL_ENV]?.replace(/\/$/, "") ||
|
|
46
|
-
process.env[MDA_PUBLIC_API_URL_ENV]?.replace(/\/$/, ""));
|
|
47
|
-
},
|
|
48
|
-
...(fleet ? { fleet } : {}),
|
|
49
|
-
async resolveProviderSlug() {
|
|
50
|
-
const server = await resolveServer({
|
|
51
|
-
mcpUrl: integration.mcpUrl,
|
|
52
|
-
...(fleet ?? {}),
|
|
53
|
-
});
|
|
54
|
-
const providerId = server.oauth_provider_id?.trim();
|
|
55
|
-
if (!providerId) {
|
|
56
|
-
throw new Error(`${integration.displayName} MCP server has no oauth_provider_id`);
|
|
57
|
-
}
|
|
58
|
-
return providerId;
|
|
59
|
-
},
|
|
60
|
-
hasDeclaredConnector: (kinds) => hasMarketplaceConnector(integration.id, kinds),
|
|
61
|
-
notConfiguredError: `${integration.displayName} connect needs LANGSMITH_API_KEY ` +
|
|
62
|
-
`(and a workspace ${integration.displayName} MCP server from Fleet marketplace).`,
|
|
63
|
-
softAuthorizeFailures: true,
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Default Connect providers for every marketplace catalog entry.
|
|
68
|
-
*
|
|
69
|
-
* Shared between `connect.<id>()` (no options) and identity-http candidates so
|
|
70
|
-
* mount inference and explicit opt-in use the same instances.
|
|
71
|
-
*/
|
|
72
|
-
export const marketplaceIdentityConnectProviders = MARKETPLACE_MCP_INTEGRATIONS.map((entry) => createMarketplaceVaultConnectProvider(entry));
|
|
73
|
-
/**
|
|
74
|
-
* `connect.<id>()` factories derived from the marketplace catalog.
|
|
75
|
-
*
|
|
76
|
-
* Usually unnecessary: declaring `connectors.<id>` on a user-scoped identity
|
|
77
|
-
* deployment mounts the matching Connect flow automatically.
|
|
78
|
-
*/
|
|
79
|
-
export const marketplaceConnect = Object.fromEntries(MARKETPLACE_MCP_INTEGRATIONS.map((entry, index) => [
|
|
80
|
-
entry.id,
|
|
81
|
-
(options) => {
|
|
82
|
-
enableActorSubjectIntegration(entry.id);
|
|
83
|
-
return options
|
|
84
|
-
? createMarketplaceVaultConnectProvider(entry, options)
|
|
85
|
-
: marketplaceIdentityConnectProviders[index];
|
|
86
|
-
},
|
|
87
|
-
]));
|
|
88
|
-
//# sourceMappingURL=connect.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"connect.js","sourceR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,EAChB,GAAG,WAAW,CAAC,WAAW,mCAAmC;YAC7D,oBAAoB,WAAW,CAAC,WAAW,sCAAsC;QACnF,qBAAqB,EAAE,IAAI;KAC5B,CAAC,CAAC;AACL,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mCAAmC,GAC9C,4BAA4B,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CACzC,qCAAqC,CAAC,KAAK,CAAC,CAC7C,CAAC;AAEJ;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAuB,MAAM,CAAC,WAAW,CACtE,4BAA4B,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC;IACjD,KAAK,CAAC,EAAE;IACR,CAAC,OAA2C,EAAE,EAAE;QAC9C,6BAA6B,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACxC,OAAO,OAAO;YACZ,CAAC,CAAC,qCAAqC,CAAC,KAAK,EAAE,OAAO,CAAC;YACvD,CAAC,CAAC,mCAAmC,CAAC,KAAK,CAAE,CAAC;IAClD,CAAC;CACF,CAAC,CACmB,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Marketplace identity helpers — Connect-with-X for Fleet marketplace MCP bridges.
|
|
3
|
-
*
|
|
4
|
-
* One surface covers every catalog entry (Notion, Cloudflare, Neon, …): vault
|
|
5
|
-
* Connect providers, `connect.<id>()` factories, and proactive connect hints.
|
|
6
|
-
*/
|
|
7
|
-
export { createMarketplaceVaultConnectProvider, marketplaceConnect, marketplaceIdentityConnectProviders, type MarketplaceConnect, type MarketplaceConnectProviderOptions, } from "./connect.js";
|
|
8
|
-
export { createMarketplaceConnectHintMiddleware, marketplaceAsFleetHint, marketplaceConnectHintUrl, type MarketplaceConnectHintMiddlewareOptions, } from "./connect-hint.js";
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/identity/marketplace/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,qCAAqC,EACrC,kBAAkB,EAClB,mCAAmC,EACnC,KAAK,kBAAkB,EACvB,KAAK,iCAAiC,GACvC,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,sCAAsC,EACtC,sBAAsB,EACtB,yBAAyB,EACzB,KAAK,uCAAuC,GAC7C,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Marketplace identity helpers — Connect-with-X for Fleet marketplace MCP bridges.
|
|
3
|
-
*
|
|
4
|
-
* One surface covers every catalog entry (Notion, Cloudflare, Neon, …): vault
|
|
5
|
-
* Connect providers, `connect.<id>()` factories, and proactive connect hints.
|
|
6
|
-
*/
|
|
7
|
-
export { createMarketplaceVaultConnectProvider, marketplaceConnect, marketplaceIdentityConnectProviders, } from "./connect.js";
|
|
8
|
-
export { createMarketplaceConnectHintMiddleware, marketplaceAsFleetHint, marketplaceConnectHintUrl, } from "./connect-hint.js";
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/identity/marketplace/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,qCAAqC,EACrC,kBAAkB,EAClB,mCAAmC,GAGpC,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,sCAAsC,EACtC,sBAAsB,EACtB,yBAAyB,GAE1B,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Connect-with-Microsoft — thin adapter over {@link defineFleetIntegrationConnect}.
|
|
3
|
-
*
|
|
4
|
-
* Mounted under `/identity/microsoft/*` when listed on `identity.connect`, or
|
|
5
|
-
* inferred from declared Microsoft toolserver connectors on a user-scoped
|
|
6
|
-
* deployment.
|
|
7
|
-
*/
|
|
8
|
-
import type { FleetIntegrationConnectProviderOptions } from "../fleet-integration-connect.js";
|
|
9
|
-
export declare const MICROSOFT_CONNECT_STATUS_PATH: string;
|
|
10
|
-
export declare const MICROSOFT_CONNECT_START_PATH: string;
|
|
11
|
-
export declare const MICROSOFT_CONNECT_CALLBACK_PATH: string;
|
|
12
|
-
export declare const MICROSOFT_CONNECT_LINK_PATH: string;
|
|
13
|
-
export declare const isMicrosoftActorSubjectEnabled: () => boolean;
|
|
14
|
-
export declare const enableMicrosoftActorSubject: () => void;
|
|
15
|
-
/**
|
|
16
|
-
* Enable actor-subject mode when Microsoft connectors imply per-user vault subjects.
|
|
17
|
-
*
|
|
18
|
-
* Prefer {@link enableActorSubjectIntegrationsFromConnectors} at compile seams.
|
|
19
|
-
*/
|
|
20
|
-
export declare const enableMicrosoftActorSubjectFromConnectors: (connectorKinds: readonly (string | undefined)[] | undefined, scope?: import("../connect-provider-types.js").IdentityConnectMountContext["scope"]) => void;
|
|
21
|
-
export declare const resetMicrosoftActorSubjectEnabledForTests: () => void;
|
|
22
|
-
export declare const isMicrosoftConnectConfigured: (env?: NodeJS.ProcessEnv) => boolean;
|
|
23
|
-
export declare const microsoftConnectUrl: (publicAppUrl: string) => string;
|
|
24
|
-
/** Options for {@link createMicrosoftIdentityConnectProvider}. */
|
|
25
|
-
export type MicrosoftIdentityConnectProviderOptions = FleetIntegrationConnectProviderOptions;
|
|
26
|
-
/** Build a Microsoft connect provider. */
|
|
27
|
-
export declare const createMicrosoftIdentityConnectProvider: (options?: FleetIntegrationConnectProviderOptions) => import("../connect-provider-types.js").IdentityConnectProvider;
|
|
28
|
-
/** Default Microsoft connect provider used as a built-in mount candidate. */
|
|
29
|
-
export declare const microsoftIdentityConnectProvider: import("../connect-provider-types.js").IdentityConnectProvider;
|
|
30
|
-
/**
|
|
31
|
-
* Opt into Connect-with-Microsoft on `defineIdentity({ connect: […] })`.
|
|
32
|
-
*
|
|
33
|
-
* Usually unnecessary: declaring Microsoft toolserver connectors on a
|
|
34
|
-
* user-scoped identity deployment mounts this provider and derives OAuth
|
|
35
|
-
* scopes automatically.
|
|
36
|
-
*/
|
|
37
|
-
export declare const connect: (options?: FleetIntegrationConnectProviderOptions) => import("../connect-provider-types.js").IdentityConnectProvider;
|
|
38
|
-
//# sourceMappingURL=connect-http.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"connect-http.d.ts","sourceRoot":"","sources":["../../../src/identity/microsoft/connect-http.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,sCAAsC,EAAE,MAAM,iCAAiC,CAAC;AAQ9F,eAAO,MAAM,6BAA6B,QAAyB,CAAC;AACpE,eAAO,MAAM,4BAA4B,QAA0B,CAAC;AACpE,eAAO,MAAM,+BAA+B,QAA2B,CAAC;AACxE,eAAO,MAAM,2BAA2B,QAAuB,CAAC;AAEhE,eAAO,MAAM,8BAA8B,eAAkC,CAAC;AAC9E,eAAO,MAAM,2BAA2B,YAA+B,CAAC;AACxE;;;;GAIG;AACH,eAAO,MAAM,yCAAyC,4JACV,CAAC;AAC7C,eAAO,MAAM,yCAAyC,YACV,CAAC;AAC7C,eAAO,MAAM,4BAA4B,sCAAgC,CAAC;AAC1E,eAAO,MAAM,mBAAmB,kCAAuB,CAAC;AAExD,kEAAkE;AAClE,MAAM,MAAM,uCAAuC,GACjD,sCAAsC,CAAC;AAEzC,0CAA0C;AAC1C,eAAO,MAAM,sCAAsC,sHAA2B,CAAC;AAE/E,6EAA6E;AAC7E,eAAO,MAAM,gCAAgC,gEAAqB,CAAC;AAEnE;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,sHAAoB,CAAC"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Connect-with-Microsoft — thin adapter over {@link defineFleetIntegrationConnect}.
|
|
3
|
-
*
|
|
4
|
-
* Mounted under `/identity/microsoft/*` when listed on `identity.connect`, or
|
|
5
|
-
* inferred from declared Microsoft toolserver connectors on a user-scoped
|
|
6
|
-
* deployment.
|
|
7
|
-
*/
|
|
8
|
-
import { MICROSOFT_INTEGRATION } from "../../connectors/toolserver/integrations.js";
|
|
9
|
-
import { defineFleetIntegrationConnect } from "../define-fleet-connect.js";
|
|
10
|
-
import { microsoftByoOauth } from "./oauth.js";
|
|
11
|
-
const microsoft = defineFleetIntegrationConnect({
|
|
12
|
-
integration: MICROSOFT_INTEGRATION,
|
|
13
|
-
byoClient: microsoftByoOauth,
|
|
14
|
-
});
|
|
15
|
-
export const MICROSOFT_CONNECT_STATUS_PATH = microsoft.paths.status;
|
|
16
|
-
export const MICROSOFT_CONNECT_START_PATH = microsoft.paths.connect;
|
|
17
|
-
export const MICROSOFT_CONNECT_CALLBACK_PATH = microsoft.paths.callback;
|
|
18
|
-
export const MICROSOFT_CONNECT_LINK_PATH = microsoft.paths.link;
|
|
19
|
-
export const isMicrosoftActorSubjectEnabled = microsoft.isActorSubjectEnabled;
|
|
20
|
-
export const enableMicrosoftActorSubject = microsoft.enableActorSubject;
|
|
21
|
-
/**
|
|
22
|
-
* Enable actor-subject mode when Microsoft connectors imply per-user vault subjects.
|
|
23
|
-
*
|
|
24
|
-
* Prefer {@link enableActorSubjectIntegrationsFromConnectors} at compile seams.
|
|
25
|
-
*/
|
|
26
|
-
export const enableMicrosoftActorSubjectFromConnectors = microsoft.enableActorSubjectFromConnectors;
|
|
27
|
-
export const resetMicrosoftActorSubjectEnabledForTests = microsoft.resetActorSubjectEnabledForTests;
|
|
28
|
-
export const isMicrosoftConnectConfigured = microsoft.isConnectConfigured;
|
|
29
|
-
export const microsoftConnectUrl = microsoft.connectUrl;
|
|
30
|
-
/** Build a Microsoft connect provider. */
|
|
31
|
-
export const createMicrosoftIdentityConnectProvider = microsoft.createProvider;
|
|
32
|
-
/** Default Microsoft connect provider used as a built-in mount candidate. */
|
|
33
|
-
export const microsoftIdentityConnectProvider = microsoft.provider;
|
|
34
|
-
/**
|
|
35
|
-
* Opt into Connect-with-Microsoft on `defineIdentity({ connect: […] })`.
|
|
36
|
-
*
|
|
37
|
-
* Usually unnecessary: declaring Microsoft toolserver connectors on a
|
|
38
|
-
* user-scoped identity deployment mounts this provider and derives OAuth
|
|
39
|
-
* scopes automatically.
|
|
40
|
-
*/
|
|
41
|
-
export const connect = microsoft.connect;
|
|
42
|
-
//# sourceMappingURL=connect-http.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"connect-http.js","sourceRoot":"","sources":["../../../src/identity/microsoft/connect-http.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AACpF,OAAO,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAE3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,MAAM,SAAS,GAAG,6BAA6B,CAAC;IAC9C,WAAW,EAAE,qBAAqB;IAClC,SAAS,EAAE,iBAAiB;CAC7B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,6BAA6B,GAAG,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC;AACpE,MAAM,CAAC,MAAM,4BAA4B,GAAG,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC;AACpE,MAAM,CAAC,MAAM,+BAA+B,GAAG,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC;AACxE,MAAM,CAAC,MAAM,2BAA2B,GAAG,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC;AAEhE,MAAM,CAAC,MAAM,8BAA8B,GAAG,SAAS,CAAC,qBAAqB,CAAC;AAC9E,MAAM,CAAC,MAAM,2BAA2B,GAAG,SAAS,CAAC,kBAAkB,CAAC;AACxE;;;;GAIG;AACH,MAAM,CAAC,MAAM,yCAAyC,GACpD,SAAS,CAAC,gCAAgC,CAAC;AAC7C,MAAM,CAAC,MAAM,yCAAyC,GACpD,SAAS,CAAC,gCAAgC,CAAC;AAC7C,MAAM,CAAC,MAAM,4BAA4B,GAAG,SAAS,CAAC,mBAAmB,CAAC;AAC1E,MAAM,CAAC,MAAM,mBAAmB,GAAG,SAAS,CAAC,UAAU,CAAC;AAMxD,0CAA0C;AAC1C,MAAM,CAAC,MAAM,sCAAsC,GAAG,SAAS,CAAC,cAAc,CAAC;AAE/E,6EAA6E;AAC7E,MAAM,CAAC,MAAM,gCAAgC,GAAG,SAAS,CAAC,QAAQ,CAAC;AAEnE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Microsoft identity helpers — Connect-with-Microsoft (Fleet vault).
|
|
3
|
-
*/
|
|
4
|
-
export { connect, createMicrosoftIdentityConnectProvider, enableMicrosoftActorSubject, enableMicrosoftActorSubjectFromConnectors, microsoftConnectUrl, microsoftIdentityConnectProvider, isMicrosoftActorSubjectEnabled, isMicrosoftConnectConfigured, resetMicrosoftActorSubjectEnabledForTests, MICROSOFT_CONNECT_CALLBACK_PATH, MICROSOFT_CONNECT_LINK_PATH, MICROSOFT_CONNECT_START_PATH, MICROSOFT_CONNECT_STATUS_PATH, } from "./connect-http.js";
|
|
5
|
-
export type { MicrosoftIdentityConnectProviderOptions } from "./connect-http.js";
|
|
6
|
-
export { microsoftOauthTickets } from "./oauth.js";
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/identity/microsoft/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,OAAO,EACP,sCAAsC,EACtC,2BAA2B,EAC3B,yCAAyC,EACzC,mBAAmB,EACnB,gCAAgC,EAChC,8BAA8B,EAC9B,4BAA4B,EAC5B,yCAAyC,EACzC,+BAA+B,EAC/B,2BAA2B,EAC3B,4BAA4B,EAC5B,6BAA6B,GAC9B,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,uCAAuC,EAAE,MAAM,mBAAmB,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Microsoft identity helpers — Connect-with-Microsoft (Fleet vault).
|
|
3
|
-
*/
|
|
4
|
-
export { connect, createMicrosoftIdentityConnectProvider, enableMicrosoftActorSubject, enableMicrosoftActorSubjectFromConnectors, microsoftConnectUrl, microsoftIdentityConnectProvider, isMicrosoftActorSubjectEnabled, isMicrosoftConnectConfigured, resetMicrosoftActorSubjectEnabledForTests, MICROSOFT_CONNECT_CALLBACK_PATH, MICROSOFT_CONNECT_LINK_PATH, MICROSOFT_CONNECT_START_PATH, MICROSOFT_CONNECT_STATUS_PATH, } from "./connect-http.js";
|
|
5
|
-
export { microsoftOauthTickets } from "./oauth.js";
|
|
6
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/identity/microsoft/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,OAAO,EACP,sCAAsC,EACtC,2BAA2B,EAC3B,yCAAyC,EACzC,mBAAmB,EACnB,gCAAgC,EAChC,8BAA8B,EAC9B,4BAA4B,EAC5B,yCAAyC,EACzC,+BAA+B,EAC/B,2BAA2B,EAC3B,4BAA4B,EAC5B,6BAA6B,GAC9B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Microsoft BYO OAuth descriptor — optional non-LangSmith Connect-with-Microsoft.
|
|
3
|
-
* The default path uses Fleet auth-sessions instead.
|
|
4
|
-
*/
|
|
5
|
-
import { type ByoOauthConfig, type ByoOauthClient } from "../byo-oauth.js";
|
|
6
|
-
export { MDA_PUBLIC_API_URL_ENV, MDA_PUBLIC_APP_URL_ENV, OAUTH_STATE_SIGNING_KEY_ENV, readOauthStateSigningKey, } from "../byo-oauth.js";
|
|
7
|
-
export type MicrosoftOauthConfig = ByoOauthConfig;
|
|
8
|
-
/** Azure AD tenant (`common`, `organizations`, `consumers`, or a tenant id). */
|
|
9
|
-
export declare const MICROSOFT_OAUTH_TENANT_ENV = "MICROSOFT_OAUTH_TENANT";
|
|
10
|
-
/** Microsoft BYO OAuth client (config, authorize, exchange, Fleet adapter). */
|
|
11
|
-
export declare const microsoftByoOauth: ByoOauthClient;
|
|
12
|
-
export declare const MICROSOFT_OAUTH_CLIENT_ID_ENV: string;
|
|
13
|
-
export declare const MICROSOFT_OAUTH_CLIENT_SECRET_ENV: string;
|
|
14
|
-
export declare const MICROSOFT_OAUTH_SCOPES_ENV: string;
|
|
15
|
-
export declare const MICROSOFT_OAUTH_AUTH_URL_ENV: string;
|
|
16
|
-
export declare const MICROSOFT_OAUTH_TOKEN_URL_ENV: string;
|
|
17
|
-
export declare const MICROSOFT_OAUTH_USERINFO_URL_ENV: string;
|
|
18
|
-
/** Microsoft-bound OAuth state / connect-ticket helpers. */
|
|
19
|
-
export declare const microsoftOauthTickets: import("../oauth-tickets.js").OauthTickets;
|
|
20
|
-
export declare const resolveMicrosoftOauthRedirectBase: typeof import("../oauth-env.js").resolveOauthRedirectBase;
|
|
21
|
-
export declare const readMicrosoftOauthConfig: (env?: NodeJS.ProcessEnv) => ByoOauthConfig | null;
|
|
22
|
-
export declare const buildMicrosoftAuthorizeUrl: (config: ByoOauthConfig, state: string, redirectUri: string, scopes?: string) => string;
|
|
23
|
-
export declare const exchangeMicrosoftOauthCode: (config: ByoOauthConfig, code: string, redirectUri: string, fetchImpl?: typeof fetch) => Promise<import("../fleet-connect.js").FleetVaultByoTokenResult>;
|
|
24
|
-
//# sourceMappingURL=oauth.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"oauth.d.ts","sourceRoot":"","sources":["../../../src/identity/microsoft/oauth.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,2BAA2B,EAC3B,wBAAwB,GACzB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC;AAElD,gFAAgF;AAChF,eAAO,MAAM,0BAA0B,2BAA2B,CAAC;AAqBnE,+EAA+E;AAC/E,eAAO,MAAM,iBAAiB,EAAE,cA2B9B,CAAC;AAEH,eAAO,MAAM,6BAA6B,QAAiC,CAAC;AAC5E,eAAO,MAAM,iCAAiC,QACV,CAAC;AACrC,eAAO,MAAM,0BAA0B,QAA+B,CAAC;AACvE,eAAO,MAAM,4BAA4B,QAAgC,CAAC;AAC1E,eAAO,MAAM,6BAA6B,QAAiC,CAAC;AAC5E,eAAO,MAAM,gCAAgC,QACV,CAAC;AAEpC,4DAA4D;AAC5D,eAAO,MAAM,qBAAqB,4CAA4B,CAAC;AAE/D,eAAO,MAAM,iCAAiC,2DACP,CAAC;AAExC,eAAO,MAAM,wBAAwB,oDAA+B,CAAC;AACrE,eAAO,MAAM,0BAA0B,yFAAsC,CAAC;AAC9E,eAAO,MAAM,0BAA0B,0JAAiC,CAAC"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Microsoft BYO OAuth descriptor — optional non-LangSmith Connect-with-Microsoft.
|
|
3
|
-
* The default path uses Fleet auth-sessions instead.
|
|
4
|
-
*/
|
|
5
|
-
import { createByoOauthClient, } from "../byo-oauth.js";
|
|
6
|
-
export { MDA_PUBLIC_API_URL_ENV, MDA_PUBLIC_APP_URL_ENV, OAUTH_STATE_SIGNING_KEY_ENV, readOauthStateSigningKey, } from "../byo-oauth.js";
|
|
7
|
-
/** Azure AD tenant (`common`, `organizations`, `consumers`, or a tenant id). */
|
|
8
|
-
export const MICROSOFT_OAUTH_TENANT_ENV = "MICROSOFT_OAUTH_TENANT";
|
|
9
|
-
const DEFAULT_TENANT = "common";
|
|
10
|
-
const DEFAULT_USERINFO_URL = "https://graph.microsoft.com/v1.0/me";
|
|
11
|
-
/** Profile + refresh; connector-derived unions replace this at authorize time. */
|
|
12
|
-
const DEFAULT_SCOPES = [
|
|
13
|
-
"openid",
|
|
14
|
-
"email",
|
|
15
|
-
"profile",
|
|
16
|
-
"offline_access",
|
|
17
|
-
"https://graph.microsoft.com/User.Read",
|
|
18
|
-
].join(" ");
|
|
19
|
-
function defaultAuthUrl(tenant) {
|
|
20
|
-
return `https://login.microsoftonline.com/${tenant}/oauth2/v2.0/authorize`;
|
|
21
|
-
}
|
|
22
|
-
function defaultTokenUrl(tenant) {
|
|
23
|
-
return `https://login.microsoftonline.com/${tenant}/oauth2/v2.0/token`;
|
|
24
|
-
}
|
|
25
|
-
/** Microsoft BYO OAuth client (config, authorize, exchange, Fleet adapter). */
|
|
26
|
-
export const microsoftByoOauth = createByoOauthClient({
|
|
27
|
-
providerId: "microsoft",
|
|
28
|
-
displayName: "Microsoft",
|
|
29
|
-
envPrefix: "MICROSOFT_OAUTH",
|
|
30
|
-
defaultEndpoints(env) {
|
|
31
|
-
const tenant = env[MICROSOFT_OAUTH_TENANT_ENV]?.trim() || DEFAULT_TENANT;
|
|
32
|
-
return {
|
|
33
|
-
authUrl: defaultAuthUrl(tenant),
|
|
34
|
-
tokenUrl: defaultTokenUrl(tenant),
|
|
35
|
-
userInfoUrl: DEFAULT_USERINFO_URL,
|
|
36
|
-
defaultScopes: DEFAULT_SCOPES,
|
|
37
|
-
};
|
|
38
|
-
},
|
|
39
|
-
authorizeParams: { response_mode: "query" },
|
|
40
|
-
parseUserInfo(json) {
|
|
41
|
-
const mail = typeof json.mail === "string" ? json.mail : undefined;
|
|
42
|
-
const upn = typeof json.userPrincipalName === "string"
|
|
43
|
-
? json.userPrincipalName
|
|
44
|
-
: undefined;
|
|
45
|
-
const id = typeof json.id === "string" ? json.id : undefined;
|
|
46
|
-
return {
|
|
47
|
-
...(mail || upn ? { email: mail || upn } : {}),
|
|
48
|
-
...(id ? { subject: id } : {}),
|
|
49
|
-
};
|
|
50
|
-
},
|
|
51
|
-
subjectMetadataKey: "microsoft_oid",
|
|
52
|
-
});
|
|
53
|
-
export const MICROSOFT_OAUTH_CLIENT_ID_ENV = microsoftByoOauth.env.clientId;
|
|
54
|
-
export const MICROSOFT_OAUTH_CLIENT_SECRET_ENV = microsoftByoOauth.env.clientSecret;
|
|
55
|
-
export const MICROSOFT_OAUTH_SCOPES_ENV = microsoftByoOauth.env.scopes;
|
|
56
|
-
export const MICROSOFT_OAUTH_AUTH_URL_ENV = microsoftByoOauth.env.authUrl;
|
|
57
|
-
export const MICROSOFT_OAUTH_TOKEN_URL_ENV = microsoftByoOauth.env.tokenUrl;
|
|
58
|
-
export const MICROSOFT_OAUTH_USERINFO_URL_ENV = microsoftByoOauth.env.userInfoUrl;
|
|
59
|
-
/** Microsoft-bound OAuth state / connect-ticket helpers. */
|
|
60
|
-
export const microsoftOauthTickets = microsoftByoOauth.tickets;
|
|
61
|
-
export const resolveMicrosoftOauthRedirectBase = microsoftByoOauth.resolveRedirectBase;
|
|
62
|
-
export const readMicrosoftOauthConfig = microsoftByoOauth.readConfig;
|
|
63
|
-
export const buildMicrosoftAuthorizeUrl = microsoftByoOauth.buildAuthorizeUrl;
|
|
64
|
-
export const exchangeMicrosoftOauthCode = microsoftByoOauth.exchangeCode;
|
|
65
|
-
//# sourceMappingURL=oauth.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"oauth.js","sourceRoot":"","sources":["../../../src/identity/microsoft/oauth.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,oBAAoB,GAGrB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,sBAAs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,CAAC,iBAAiB,CAAC;AAC9E,MAAM,CAAC,MAAM,0BAA0B,GAAG,iBAAiB,CAAC,YAAY,CAAC"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared deployment OAuth env keys and redirect-base resolution.
|
|
3
|
-
*
|
|
4
|
-
* Used by Slack OIDC, GitHub Connect, Fleet vault Connect, and BYO clients —
|
|
5
|
-
* not Slack-specific despite historical residence under `slack/oauth.ts`.
|
|
6
|
-
*/
|
|
7
|
-
export declare const MDA_PUBLIC_APP_URL_ENV = "MDA_PUBLIC_APP_URL";
|
|
8
|
-
/**
|
|
9
|
-
* Public Agent Server base URL used for OAuth `redirect_uri`.
|
|
10
|
-
* Required on LangGraph Host where the ASGI request origin is an internal
|
|
11
|
-
* loopback (e.g. `http://localhost:5557`) rather than `*.langgraph.app`.
|
|
12
|
-
*/
|
|
13
|
-
export declare const MDA_PUBLIC_API_URL_ENV = "MDA_PUBLIC_API_URL";
|
|
14
|
-
/**
|
|
15
|
-
* Signing key for OAuth `state` JWTs (Connect-with-X). The env var name is
|
|
16
|
-
* historical — it predates guest ingress being removed — and is kept so
|
|
17
|
-
* existing deployments do not have to rotate a secret. Never a provider client
|
|
18
|
-
* secret (that value is an OAuth credential, not a signing key).
|
|
19
|
-
*/
|
|
20
|
-
export declare const OAUTH_STATE_SIGNING_KEY_ENV = "MDA_GUEST_SIGNING_KEY";
|
|
21
|
-
/** Server-side key for OAuth state JWTs; null when Connect cannot bind actors. */
|
|
22
|
-
export declare function readOauthStateSigningKey(env?: NodeJS.ProcessEnv): string | null;
|
|
23
|
-
/**
|
|
24
|
-
* Public base URL for OAuth `redirect_uri` (`…/identity/{provider}/callback`).
|
|
25
|
-
*
|
|
26
|
-
* Prefer an explicit public Agent Server URL over the ASGI request origin:
|
|
27
|
-
* LangGraph Host rewrites requests to an internal loopback that IdPs cannot
|
|
28
|
-
* use as a redirect.
|
|
29
|
-
*/
|
|
30
|
-
export declare function resolveOauthRedirectBase(options: {
|
|
31
|
-
requestUrl: string;
|
|
32
|
-
headers?: Headers | {
|
|
33
|
-
get(name: string): string | null | undefined;
|
|
34
|
-
};
|
|
35
|
-
deploymentBaseUrl?: string;
|
|
36
|
-
env?: NodeJS.ProcessEnv;
|
|
37
|
-
}): string;
|
|
38
|
-
/**
|
|
39
|
-
* @deprecated Use {@link resolveOauthRedirectBase}. Kept for callers that still
|
|
40
|
-
* import the historical Slack-named alias.
|
|
41
|
-
*/
|
|
42
|
-
export declare const resolveSlackOauthRedirectBase: typeof resolveOauthRedirectBase;
|
|
43
|
-
//# sourceMappingURL=oauth-env.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-env.d.ts","sourceRoot":"","sources":["../../src/identity/oauth-env.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,eAAO,MAAM,sBAAsB,uBAAuB,CAAC;AAC3D;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,uBAAuB,CAAC;AAE3D;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,0BAA0B,CAAC;AAEnE,kFAAkF;AAClF,wBAAgB,wBAAwB,CACtC,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,MAAM,GAAG,IAAI,CAGf;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE;IAChD,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,GAAG;QAAE,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;KAAE,CAAC;IACrE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;CACzB,GAAG,MAAM,CAcT;AAED;;;GAGG;AACH,eAAO,MAAM,6BAA6B,iCAA2B,CAAC"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared deployment OAuth env keys and redirect-base resolution.
|
|
3
|
-
*
|
|
4
|
-
* Used by Slack OIDC, GitHub Connect, Fleet vault Connect, and BYO clients —
|
|
5
|
-
* not Slack-specific despite historical residence under `slack/oauth.ts`.
|
|
6
|
-
*/
|
|
7
|
-
import { isLoopbackHost, isLoopbackUrl } from "./loopback.js";
|
|
8
|
-
export const MDA_PUBLIC_APP_URL_ENV = "MDA_PUBLIC_APP_URL";
|
|
9
|
-
/**
|
|
10
|
-
* Public Agent Server base URL used for OAuth `redirect_uri`.
|
|
11
|
-
* Required on LangGraph Host where the ASGI request origin is an internal
|
|
12
|
-
* loopback (e.g. `http://localhost:5557`) rather than `*.langgraph.app`.
|
|
13
|
-
*/
|
|
14
|
-
export const MDA_PUBLIC_API_URL_ENV = "MDA_PUBLIC_API_URL";
|
|
15
|
-
/**
|
|
16
|
-
* Signing key for OAuth `state` JWTs (Connect-with-X). The env var name is
|
|
17
|
-
* historical — it predates guest ingress being removed — and is kept so
|
|
18
|
-
* existing deployments do not have to rotate a secret. Never a provider client
|
|
19
|
-
* secret (that value is an OAuth credential, not a signing key).
|
|
20
|
-
*/
|
|
21
|
-
export const OAUTH_STATE_SIGNING_KEY_ENV = "MDA_GUEST_SIGNING_KEY";
|
|
22
|
-
/** Server-side key for OAuth state JWTs; null when Connect cannot bind actors. */
|
|
23
|
-
export function readOauthStateSigningKey(env = process.env) {
|
|
24
|
-
const key = env[OAUTH_STATE_SIGNING_KEY_ENV]?.trim();
|
|
25
|
-
return key || null;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Public base URL for OAuth `redirect_uri` (`…/identity/{provider}/callback`).
|
|
29
|
-
*
|
|
30
|
-
* Prefer an explicit public Agent Server URL over the ASGI request origin:
|
|
31
|
-
* LangGraph Host rewrites requests to an internal loopback that IdPs cannot
|
|
32
|
-
* use as a redirect.
|
|
33
|
-
*/
|
|
34
|
-
export function resolveOauthRedirectBase(options) {
|
|
35
|
-
const env = options.env ?? process.env;
|
|
36
|
-
if (options.deploymentBaseUrl?.trim()) {
|
|
37
|
-
return options.deploymentBaseUrl.trim().replace(/\/$/, "");
|
|
38
|
-
}
|
|
39
|
-
const fromEnv = env[MDA_PUBLIC_API_URL_ENV]?.trim().replace(/\/$/, "");
|
|
40
|
-
if (fromEnv && !isLoopbackUrl(fromEnv)) {
|
|
41
|
-
return fromEnv;
|
|
42
|
-
}
|
|
43
|
-
const forwarded = publicOriginFromForwardedHeaders(options.headers);
|
|
44
|
-
if (forwarded) {
|
|
45
|
-
return forwarded;
|
|
46
|
-
}
|
|
47
|
-
return new URL(options.requestUrl).origin;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* @deprecated Use {@link resolveOauthRedirectBase}. Kept for callers that still
|
|
51
|
-
* import the historical Slack-named alias.
|
|
52
|
-
*/
|
|
53
|
-
export const resolveSlackOauthRedirectBase = resolveOauthRedirectBase;
|
|
54
|
-
function publicOriginFromForwardedHeaders(headers) {
|
|
55
|
-
if (!headers) {
|
|
56
|
-
return undefined;
|
|
57
|
-
}
|
|
58
|
-
const host = headers.get("x-forwarded-host")?.split(",")[0]?.trim();
|
|
59
|
-
if (!host || isLoopbackHost(host)) {
|
|
60
|
-
return undefined;
|
|
61
|
-
}
|
|
62
|
-
const proto = headers.get("x-forwarded-proto")?.split(",")[0]?.trim() ||
|
|
63
|
-
(host.includes("localhost") || host.startsWith("127.") ? "http" : "https");
|
|
64
|
-
return `${proto}://${host}`;
|
|
65
|
-
}
|
|
66
|
-
//# sourceMappingURL=oauth-env.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-env.js","sourceRoot":"","sources":["../../src/identity/oauth-env.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9D,MAAM,CAAC,MAAM,sBAAsB,GAAG,oBAAoB,CAAC;AAC3D;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAA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,CAAC,GAAG,CAAC,kBAAkB,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;IACpE,IAAI,CAAC,IAAI,IAAI,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC;QAClC,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,KAAK,GACT,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE;QACvD,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IAC7E,OAAO,GAAG,KAAK,MAAM,IAAI,EAAE,CAAC;AAC9B,CAAC"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared OAuth state and connect-ticket JWTs for Connect-with-X providers.
|
|
3
|
-
*
|
|
4
|
-
* Parameterized by provider id so each integration gets distinct `typ` values
|
|
5
|
-
* (`mda-{id}-oauth-state`, `mda-{id}-connect-ticket`) without copying JWT code.
|
|
6
|
-
*/
|
|
7
|
-
export declare function createOauthState(providerId: string, userId: string, signingKey: string, nowMs?: number): Promise<string>;
|
|
8
|
-
export declare function verifyOauthState(providerId: string, state: string, signingKey: string, nowMs?: number): Promise<{
|
|
9
|
-
userId: string;
|
|
10
|
-
}>;
|
|
11
|
-
/**
|
|
12
|
-
* Mint a short-lived connect ticket for channel actors (Slack, etc.) who have
|
|
13
|
-
* no browser session. The Connect start route accepts `?ticket=…` and binds
|
|
14
|
-
* the OAuth vault subject to this user id.
|
|
15
|
-
*/
|
|
16
|
-
export declare function createConnectTicket(providerId: string, userId: string, signingKey: string, nowMs?: number): Promise<string>;
|
|
17
|
-
export declare function verifyConnectTicket(providerId: string, ticket: string, signingKey: string, nowMs?: number): Promise<{
|
|
18
|
-
userId: string;
|
|
19
|
-
}>;
|
|
20
|
-
/** Bound OAuth state / connect-ticket helpers for one Connect provider id. */
|
|
21
|
-
export interface OauthTickets {
|
|
22
|
-
readonly providerId: string;
|
|
23
|
-
createState(userId: string, signingKey: string, nowMs?: number): Promise<string>;
|
|
24
|
-
verifyState(state: string, signingKey: string, nowMs?: number): Promise<{
|
|
25
|
-
userId: string;
|
|
26
|
-
}>;
|
|
27
|
-
createTicket(userId: string, signingKey: string, nowMs?: number): Promise<string>;
|
|
28
|
-
verifyTicket(ticket: string, signingKey: string, nowMs?: number): Promise<{
|
|
29
|
-
userId: string;
|
|
30
|
-
}>;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Bind {@link createOauthState} / ticket helpers to a Connect provider id
|
|
34
|
-
* (`mda-{id}-oauth-state`, `mda-{id}-connect-ticket`).
|
|
35
|
-
*/
|
|
36
|
-
export declare function oauthTicketsFor(providerId: string): OauthTickets;
|
|
37
|
-
//# sourceMappingURL=oauth-tickets.d.ts.map
|