@frontmcp/sdk 0.9.0 → 0.11.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/adapter/adapter.instance.d.ts +10 -3
- package/adapter/adapter.instance.d.ts.map +1 -1
- package/adapter/{adapter.regsitry.d.ts → adapter.registry.d.ts} +2 -1
- package/adapter/adapter.registry.d.ts.map +1 -0
- package/adapter/adapter.utils.d.ts.map +1 -1
- package/agent/agent.instance.d.ts.map +1 -1
- package/agent/agent.scope.d.ts +9 -9
- package/agent/agent.scope.d.ts.map +1 -1
- package/agent/agent.utils.d.ts.map +1 -1
- package/app/app.registry.d.ts.map +1 -1
- package/app/app.utils.d.ts.map +1 -1
- package/app/instances/app.local.instance.d.ts +1 -1
- package/auth/auth.registry.d.ts +1 -1
- package/auth/auth.registry.d.ts.map +1 -1
- package/auth/auth.utils.d.ts.map +1 -1
- package/auth/authorization/index.d.ts +0 -6
- package/auth/authorization/index.d.ts.map +1 -1
- package/auth/authorization/orchestrated.context-extension.d.ts +1 -1
- package/auth/authorization/orchestrated.context-extension.d.ts.map +1 -1
- package/auth/flows/auth.verify.flow.d.ts +1 -1
- package/auth/flows/auth.verify.flow.d.ts.map +1 -1
- package/auth/flows/oauth.authorize.flow.d.ts.map +1 -1
- package/auth/flows/oauth.callback.flow.d.ts.map +1 -1
- package/auth/flows/oauth.provider-callback.flow.d.ts.map +1 -1
- package/auth/flows/session.verify.flow.d.ts +2 -2
- package/auth/flows/session.verify.flow.d.ts.map +1 -1
- package/auth/flows/well-known.jwks.flow.d.ts.map +1 -1
- package/auth/flows/well-known.oauth-authorization-server.flow.d.ts.map +1 -1
- package/auth/flows/well-known.prm.flow.d.ts.map +1 -1
- package/auth/instances/instance.local-primary-auth.d.ts +2 -2
- package/auth/instances/instance.local-primary-auth.d.ts.map +1 -1
- package/auth/session/index.d.ts +7 -11
- package/auth/session/index.d.ts.map +1 -1
- package/auth/session/record/session.base.d.ts +1 -1
- package/auth/session/record/session.base.d.ts.map +1 -1
- package/auth/session/session-store.factory.d.ts +19 -3
- package/auth/session/session-store.factory.d.ts.map +1 -1
- package/auth/session/session.service.d.ts +1 -1
- package/auth/session/session.service.d.ts.map +1 -1
- package/auth/session/transport-session.manager.d.ts +1 -1
- package/auth/session/transport-session.manager.d.ts.map +1 -1
- package/auth/session/utils/session-id.utils.d.ts +1 -2
- package/auth/session/utils/session-id.utils.d.ts.map +1 -1
- package/auth/vault/auth-providers.context-extension.d.ts +2 -2
- package/auth/vault/auth-providers.context-extension.d.ts.map +1 -1
- package/auth/vault/auth-providers.providers.d.ts +1 -1
- package/auth/vault/auth-providers.providers.d.ts.map +1 -1
- package/auth/vault/index.d.ts +0 -52
- package/auth/vault/index.d.ts.map +1 -1
- package/builtin/config/config-resolver.d.ts.map +1 -1
- package/common/decorators/app.decorator.d.ts +1 -1
- package/common/decorators/app.decorator.d.ts.map +1 -1
- package/common/decorators/front-mcp.decorator.d.ts.map +1 -1
- package/common/decorators/plugin.decorator.d.ts.map +1 -1
- package/common/dynamic/dynamic.adapter.d.ts.map +1 -1
- package/common/dynamic/dynamic.plugin.d.ts.map +1 -1
- package/common/interfaces/agent.interface.d.ts.map +1 -1
- package/common/interfaces/internal/flow.utils.d.ts.map +1 -1
- package/common/interfaces/server.interface.d.ts +4 -2
- package/common/interfaces/server.interface.d.ts.map +1 -1
- package/common/metadata/app.metadata.d.ts +16 -16
- package/common/metadata/front-mcp.metadata.d.ts +184 -52
- package/common/metadata/front-mcp.metadata.d.ts.map +1 -1
- package/common/providers/base-config.provider.d.ts.map +1 -1
- package/common/tokens/front-mcp.tokens.d.ts.map +1 -1
- package/common/types/auth/jwt.types.d.ts +2 -86
- package/common/types/auth/jwt.types.d.ts.map +1 -1
- package/common/types/auth/session.types.d.ts +5 -101
- package/common/types/auth/session.types.d.ts.map +1 -1
- package/common/types/options/auth/app-auth.schema.d.ts +8 -8
- package/common/types/options/auth/index.d.ts +14 -14
- package/common/types/options/auth/index.d.ts.map +1 -1
- package/common/types/options/auth/interfaces.d.ts +1 -1
- package/common/types/options/auth/interfaces.d.ts.map +1 -1
- package/common/types/options/auth/orchestrated.schema.d.ts +10 -10
- package/common/types/options/auth/public.schema.d.ts +2 -2
- package/common/types/options/auth/schema.d.ts +8 -8
- package/common/types/options/auth/shared.schemas.d.ts +2 -132
- package/common/types/options/auth/shared.schemas.d.ts.map +1 -1
- package/common/types/options/auth/transparent.schema.d.ts +1 -1
- package/common/types/options/http/index.d.ts +1 -1
- package/common/types/options/http/index.d.ts.map +1 -1
- package/common/types/options/http/interfaces.d.ts +36 -0
- package/common/types/options/http/interfaces.d.ts.map +1 -1
- package/common/types/options/http/schema.d.ts +6 -0
- package/common/types/options/http/schema.d.ts.map +1 -1
- package/common/types/options/index.d.ts +1 -0
- package/common/types/options/index.d.ts.map +1 -1
- package/common/types/options/session/schema.d.ts +3 -3
- package/common/types/options/sqlite/index.d.ts +3 -0
- package/common/types/options/sqlite/index.d.ts.map +1 -0
- package/common/types/options/sqlite/schema.d.ts +26 -0
- package/common/types/options/sqlite/schema.d.ts.map +1 -0
- package/common/types/options/transport/schema.d.ts +1 -1
- package/elicitation/store/elicitation-encryption.d.ts +1 -1
- package/elicitation/store/elicitation-encryption.d.ts.map +1 -1
- package/elicitation/store/elicitation-store.factory.d.ts +21 -1
- package/elicitation/store/elicitation-store.factory.d.ts.map +1 -1
- package/errors/auth-internal.errors.d.ts +2 -0
- package/errors/auth-internal.errors.d.ts.map +1 -0
- package/errors/decorator.errors.d.ts +14 -0
- package/errors/decorator.errors.d.ts.map +1 -0
- package/errors/index.d.ts +8 -1
- package/errors/index.d.ts.map +1 -1
- package/errors/normalization.errors.d.ts +32 -0
- package/errors/normalization.errors.d.ts.map +1 -0
- package/errors/provider.errors.d.ts +63 -0
- package/errors/provider.errors.d.ts.map +1 -0
- package/errors/registry.errors.d.ts +50 -0
- package/errors/registry.errors.d.ts.map +1 -0
- package/errors/remote.errors.d.ts +8 -0
- package/errors/remote.errors.d.ts.map +1 -1
- package/errors/sdk.errors.d.ts +139 -0
- package/errors/sdk.errors.d.ts.map +1 -0
- package/errors/transport.errors.d.ts +46 -0
- package/errors/transport.errors.d.ts.map +1 -0
- package/esm/index.mjs +7422 -8497
- package/esm/package.json +11 -7
- package/flows/flow.instance.d.ts.map +1 -1
- package/flows/flow.registry.d.ts.map +1 -1
- package/flows/flow.utils.d.ts.map +1 -1
- package/front-mcp/front-mcp.d.ts +30 -1
- package/front-mcp/front-mcp.d.ts.map +1 -1
- package/front-mcp/front-mcp.providers.d.ts +76 -20
- package/front-mcp/front-mcp.providers.d.ts.map +1 -1
- package/front-mcp/serverless-handler.d.ts +0 -4
- package/front-mcp/serverless-handler.d.ts.map +1 -1
- package/hooks/hook.instance.d.ts.map +1 -1
- package/hooks/hook.registry.d.ts.map +1 -1
- package/index.d.ts +1 -1
- package/index.js +19714 -20739
- package/logger/logger.registry.d.ts.map +1 -1
- package/logger/logger.utils.d.ts.map +1 -1
- package/package.json +11 -7
- package/plugin/plugin.utils.d.ts.map +1 -1
- package/prompt/prompt.instance.d.ts.map +1 -1
- package/prompt/prompt.registry.d.ts.map +1 -1
- package/prompt/prompt.utils.d.ts.map +1 -1
- package/provider/provider.registry.d.ts.map +1 -1
- package/provider/provider.utils.d.ts.map +1 -1
- package/regsitry/registry.base.d.ts.map +1 -1
- package/remote-mcp/mcp-client.service.d.ts.map +1 -1
- package/remote-mcp/resilience/retry.d.ts.map +1 -1
- package/resource/resource.instance.d.ts.map +1 -1
- package/resource/resource.registry.d.ts.map +1 -1
- package/resource/resource.utils.d.ts.map +1 -1
- package/scope/flows/http.request.flow.d.ts +1 -1
- package/scope/flows/http.request.flow.d.ts.map +1 -1
- package/scope/scope.instance.d.ts.map +1 -1
- package/scope/scope.registry.d.ts.map +1 -1
- package/scope/scope.utils.d.ts.map +1 -1
- package/server/adapters/base.host.adapter.d.ts +4 -2
- package/server/adapters/base.host.adapter.d.ts.map +1 -1
- package/server/adapters/express.host.adapter.d.ts +6 -32
- package/server/adapters/express.host.adapter.d.ts.map +1 -1
- package/server/server.instance.d.ts +1 -1
- package/server/server.instance.d.ts.map +1 -1
- package/skill/flows/search-skills.flow.d.ts +2 -2
- package/skill/session/skill-session.manager.d.ts.map +1 -1
- package/skill/skill.utils.d.ts.map +1 -1
- package/skill/tools/search-skills.tool.d.ts +1 -1
- package/tool/tool.instance.d.ts.map +1 -1
- package/tool/tool.registry.d.ts.map +1 -1
- package/tool/tool.utils.d.ts.map +1 -1
- package/transport/adapters/streamable-http-transport.d.ts +9 -3
- package/transport/adapters/streamable-http-transport.d.ts.map +1 -1
- package/transport/event-stores/event-store.factory.d.ts +8 -3
- package/transport/event-stores/event-store.factory.d.ts.map +1 -1
- package/transport/event-stores/redis.event-store.d.ts.map +1 -1
- package/transport/flows/handle.sse.flow.d.ts +1 -1
- package/transport/flows/handle.streamable-http.flow.d.ts +1 -1
- package/transport/legacy/legacy.sse.tranporter.d.ts.map +1 -1
- package/transport/mcp-handlers/skills-mcp.types.d.ts +1 -1
- package/transport/transport.local.d.ts.map +1 -1
- package/transport/transport.registry.d.ts +1 -1
- package/transport/transport.registry.d.ts.map +1 -1
- package/transport/transport.remote.d.ts.map +1 -1
- package/adapter/adapter.regsitry.d.ts.map +0 -1
- package/auth/authorization/authorization.class.d.ts +0 -123
- package/auth/authorization/authorization.class.d.ts.map +0 -1
- package/auth/authorization/authorization.types.d.ts +0 -128
- package/auth/authorization/authorization.types.d.ts.map +0 -1
- package/auth/authorization/orchestrated.accessor.d.ts +0 -161
- package/auth/authorization/orchestrated.accessor.d.ts.map +0 -1
- package/auth/authorization/orchestrated.authorization.d.ts +0 -258
- package/auth/authorization/orchestrated.authorization.d.ts.map +0 -1
- package/auth/authorization/public.authorization.d.ts +0 -92
- package/auth/authorization/public.authorization.d.ts.map +0 -1
- package/auth/authorization/transparent.authorization.d.ts +0 -131
- package/auth/authorization/transparent.authorization.d.ts.map +0 -1
- package/auth/consent/consent.types.d.ts +0 -112
- package/auth/consent/consent.types.d.ts.map +0 -1
- package/auth/consent/index.d.ts +0 -2
- package/auth/consent/index.d.ts.map +0 -1
- package/auth/detection/auth-provider-detection.d.ts +0 -85
- package/auth/detection/auth-provider-detection.d.ts.map +0 -1
- package/auth/detection/index.d.ts +0 -2
- package/auth/detection/index.d.ts.map +0 -1
- package/auth/machine-id.d.ts +0 -28
- package/auth/machine-id.d.ts.map +0 -1
- package/auth/session/encrypted-authorization-vault.d.ts +0 -181
- package/auth/session/encrypted-authorization-vault.d.ts.map +0 -1
- package/auth/session/federated-auth.session.d.ts +0 -252
- package/auth/session/federated-auth.session.d.ts.map +0 -1
- package/auth/session/orchestrated-token.store.d.ts +0 -155
- package/auth/session/orchestrated-token.store.d.ts.map +0 -1
- package/auth/session/redis-session.store.d.ts +0 -93
- package/auth/session/redis-session.store.d.ts.map +0 -1
- package/auth/session/session-crypto.d.ts +0 -84
- package/auth/session/session-crypto.d.ts.map +0 -1
- package/auth/session/session-rate-limiter.d.ts +0 -114
- package/auth/session/session-rate-limiter.d.ts.map +0 -1
- package/auth/session/session.transport.d.ts +0 -11
- package/auth/session/session.transport.d.ts.map +0 -1
- package/auth/session/session.types.d.ts +0 -66
- package/auth/session/session.types.d.ts.map +0 -1
- package/auth/session/token.refresh.d.ts +0 -60
- package/auth/session/token.refresh.d.ts.map +0 -1
- package/auth/session/transport-session.types.d.ts +0 -479
- package/auth/session/transport-session.types.d.ts.map +0 -1
- package/auth/session/utils/auth-token.utils.d.ts +0 -12
- package/auth/session/utils/auth-token.utils.d.ts.map +0 -1
- package/auth/session/vercel-kv-session.store.d.ts +0 -117
- package/auth/session/vercel-kv-session.store.d.ts.map +0 -1
- package/auth/ui/base-layout.d.ts +0 -181
- package/auth/ui/base-layout.d.ts.map +0 -1
- package/auth/ui/index.d.ts +0 -11
- package/auth/ui/index.d.ts.map +0 -1
- package/auth/ui/templates.d.ts +0 -135
- package/auth/ui/templates.d.ts.map +0 -1
- package/auth/utils/authorization-id.utils.d.ts +0 -12
- package/auth/utils/authorization-id.utils.d.ts.map +0 -1
- package/auth/utils/index.d.ts +0 -2
- package/auth/utils/index.d.ts.map +0 -1
- package/auth/vault/auth-providers.accessor.d.ts +0 -153
- package/auth/vault/auth-providers.accessor.d.ts.map +0 -1
- package/auth/vault/auth-providers.accessor.impl.d.ts +0 -52
- package/auth/vault/auth-providers.accessor.impl.d.ts.map +0 -1
- package/auth/vault/auth-providers.registry.d.ts +0 -110
- package/auth/vault/auth-providers.registry.d.ts.map +0 -1
- package/auth/vault/auth-providers.vault.d.ts +0 -93
- package/auth/vault/auth-providers.vault.d.ts.map +0 -1
- package/auth/vault/credential-loaders/eager-loader.d.ts +0 -46
- package/auth/vault/credential-loaders/eager-loader.d.ts.map +0 -1
- package/auth/vault/credential-loaders/index.d.ts +0 -7
- package/auth/vault/credential-loaders/index.d.ts.map +0 -1
- package/auth/vault/credential-loaders/lazy-loader.d.ts +0 -53
- package/auth/vault/credential-loaders/lazy-loader.d.ts.map +0 -1
|
@@ -1,258 +0,0 @@
|
|
|
1
|
-
import { AuthorizationBase } from './authorization.class';
|
|
2
|
-
import { AuthorizationCreateCtx, AuthUser } from './authorization.types';
|
|
3
|
-
import { EncryptedBlob } from '../session';
|
|
4
|
-
import { AuthMode } from '../../common';
|
|
5
|
-
/**
|
|
6
|
-
* Token store interface for orchestrated mode
|
|
7
|
-
* Implementations can be memory-based, Redis, or custom stores
|
|
8
|
-
*/
|
|
9
|
-
export interface TokenStore {
|
|
10
|
-
/**
|
|
11
|
-
* Retrieve decrypted access token for a provider
|
|
12
|
-
*/
|
|
13
|
-
getAccessToken(authorizationId: string, providerId: string): Promise<string | null>;
|
|
14
|
-
/**
|
|
15
|
-
* Retrieve decrypted refresh token for a provider
|
|
16
|
-
*/
|
|
17
|
-
getRefreshToken(authorizationId: string, providerId: string): Promise<string | null>;
|
|
18
|
-
/**
|
|
19
|
-
* Store tokens for a provider (encrypted)
|
|
20
|
-
*/
|
|
21
|
-
storeTokens(authorizationId: string, providerId: string, tokens: {
|
|
22
|
-
accessToken: string;
|
|
23
|
-
refreshToken?: string;
|
|
24
|
-
expiresAt?: number;
|
|
25
|
-
}): Promise<void>;
|
|
26
|
-
/**
|
|
27
|
-
* Delete tokens for a provider
|
|
28
|
-
*/
|
|
29
|
-
deleteTokens(authorizationId: string, providerId: string): Promise<void>;
|
|
30
|
-
/**
|
|
31
|
-
* Check if tokens exist for a provider
|
|
32
|
-
*/
|
|
33
|
-
hasTokens(authorizationId: string, providerId: string): Promise<boolean>;
|
|
34
|
-
/**
|
|
35
|
-
* Get all provider IDs that have tokens stored for this authorization.
|
|
36
|
-
*/
|
|
37
|
-
getProviderIds(authorizationId: string): Promise<string[]>;
|
|
38
|
-
/**
|
|
39
|
-
* Migrate tokens from one authorization ID to another.
|
|
40
|
-
* Used when tokens are stored with a pending ID during federated auth
|
|
41
|
-
* and need to be accessible under the real authorization ID.
|
|
42
|
-
*
|
|
43
|
-
* @param fromAuthId - Source authorization ID (e.g., "pending:abc123")
|
|
44
|
-
* @param toAuthId - Target authorization ID (e.g., "def456")
|
|
45
|
-
*/
|
|
46
|
-
migrateTokens(fromAuthId: string, toAuthId: string): Promise<void>;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Token refresh callback type
|
|
50
|
-
*/
|
|
51
|
-
export type TokenRefreshCallback = (providerId: string, refreshToken: string) => Promise<{
|
|
52
|
-
accessToken: string;
|
|
53
|
-
refreshToken?: string;
|
|
54
|
-
expiresIn?: number;
|
|
55
|
-
}>;
|
|
56
|
-
/**
|
|
57
|
-
* Provider token state for orchestrated authorization
|
|
58
|
-
*/
|
|
59
|
-
export interface OrchestratedProviderState {
|
|
60
|
-
/** Provider ID */
|
|
61
|
-
id: string;
|
|
62
|
-
/** Encrypted access token blob */
|
|
63
|
-
accessTokenEnc?: EncryptedBlob;
|
|
64
|
-
/** Encrypted refresh token blob */
|
|
65
|
-
refreshTokenEnc?: EncryptedBlob;
|
|
66
|
-
/** Token expiration (epoch ms) */
|
|
67
|
-
expiresAt?: number;
|
|
68
|
-
/** External reference ID (for vault/store) */
|
|
69
|
-
secretRefId?: string;
|
|
70
|
-
/** Refresh reference ID */
|
|
71
|
-
refreshRefId?: string;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Context for creating an OrchestratedAuthorization
|
|
75
|
-
*/
|
|
76
|
-
export interface OrchestratedAuthorizationCreateCtx {
|
|
77
|
-
/**
|
|
78
|
-
* The local JWT issued by the orchestrating server
|
|
79
|
-
*/
|
|
80
|
-
token: string;
|
|
81
|
-
/**
|
|
82
|
-
* User identity from upstream provider
|
|
83
|
-
*/
|
|
84
|
-
user: AuthUser;
|
|
85
|
-
/**
|
|
86
|
-
* Scopes granted to this authorization
|
|
87
|
-
*/
|
|
88
|
-
scopes?: string[];
|
|
89
|
-
/**
|
|
90
|
-
* JWT claims
|
|
91
|
-
*/
|
|
92
|
-
claims?: Record<string, unknown>;
|
|
93
|
-
/**
|
|
94
|
-
* Expiration (epoch ms)
|
|
95
|
-
*/
|
|
96
|
-
expiresAt?: number;
|
|
97
|
-
/**
|
|
98
|
-
* Primary provider ID (default for getToken)
|
|
99
|
-
*/
|
|
100
|
-
primaryProviderId?: string;
|
|
101
|
-
/**
|
|
102
|
-
* Token store for retrieving/storing provider tokens
|
|
103
|
-
*/
|
|
104
|
-
tokenStore?: TokenStore;
|
|
105
|
-
/**
|
|
106
|
-
* Token refresh callback
|
|
107
|
-
*/
|
|
108
|
-
onTokenRefresh?: TokenRefreshCallback;
|
|
109
|
-
/**
|
|
110
|
-
* Provider states (with encrypted tokens)
|
|
111
|
-
*/
|
|
112
|
-
providers?: Record<string, OrchestratedProviderState>;
|
|
113
|
-
/**
|
|
114
|
-
* Precomputed authorization projections
|
|
115
|
-
*/
|
|
116
|
-
authorizedTools?: AuthorizationCreateCtx['authorizedTools'];
|
|
117
|
-
authorizedToolIds?: string[];
|
|
118
|
-
authorizedPrompts?: AuthorizationCreateCtx['authorizedPrompts'];
|
|
119
|
-
authorizedPromptIds?: string[];
|
|
120
|
-
authorizedApps?: AuthorizationCreateCtx['authorizedApps'];
|
|
121
|
-
authorizedAppIds?: string[];
|
|
122
|
-
authorizedResources?: string[];
|
|
123
|
-
/**
|
|
124
|
-
* Provider IDs that the user has explicitly authorized during federated login.
|
|
125
|
-
* Populated from JWT claims (`federated.selectedProviders`) or token store.
|
|
126
|
-
* Controls which providers the authorization has access to for progressive auth.
|
|
127
|
-
*/
|
|
128
|
-
authorizedProviderIds?: string[];
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* OrchestratedAuthorization - Local auth server with secure token storage
|
|
132
|
-
*
|
|
133
|
-
* In orchestrated mode:
|
|
134
|
-
* - The MCP server acts as an OAuth client to upstream providers
|
|
135
|
-
* - Provider tokens are encrypted and never exposed to the LLM
|
|
136
|
-
* - Supports token refresh and multi-provider scenarios
|
|
137
|
-
* - getToken() retrieves decrypted tokens from secure storage
|
|
138
|
-
* - Ideal for multi-tenant, federated auth, or high-security scenarios
|
|
139
|
-
*/
|
|
140
|
-
export declare class OrchestratedAuthorization extends AuthorizationBase {
|
|
141
|
-
#private;
|
|
142
|
-
readonly mode: AuthMode;
|
|
143
|
-
/**
|
|
144
|
-
* Primary provider ID (default for getToken)
|
|
145
|
-
*/
|
|
146
|
-
readonly primaryProviderId?: string;
|
|
147
|
-
private constructor();
|
|
148
|
-
/**
|
|
149
|
-
* Create an OrchestratedAuthorization
|
|
150
|
-
*
|
|
151
|
-
* @param ctx - Creation context
|
|
152
|
-
* @returns A new OrchestratedAuthorization instance
|
|
153
|
-
*
|
|
154
|
-
* @example
|
|
155
|
-
* ```typescript
|
|
156
|
-
* const auth = OrchestratedAuthorization.create({
|
|
157
|
-
* token: localJwt,
|
|
158
|
-
* user: { sub: 'user123', name: 'John' },
|
|
159
|
-
* primaryProviderId: 'github',
|
|
160
|
-
* tokenStore: redisTokenStore,
|
|
161
|
-
* providers: {
|
|
162
|
-
* github: { id: 'github', secretRefId: 'vault:github:user123' },
|
|
163
|
-
* },
|
|
164
|
-
* });
|
|
165
|
-
*
|
|
166
|
-
* // Retrieve token securely (never exposed to LLM)
|
|
167
|
-
* const githubToken = await auth.getToken('github');
|
|
168
|
-
* ```
|
|
169
|
-
*/
|
|
170
|
-
static create(ctx: OrchestratedAuthorizationCreateCtx): OrchestratedAuthorization;
|
|
171
|
-
/**
|
|
172
|
-
* Get access token for a provider
|
|
173
|
-
*
|
|
174
|
-
* Retrieves the decrypted token from the secure store.
|
|
175
|
-
* If the token is expired and refresh is available, attempts refresh.
|
|
176
|
-
*
|
|
177
|
-
* @param providerId - Provider ID (defaults to primaryProviderId)
|
|
178
|
-
* @returns The decrypted access token
|
|
179
|
-
* @throws If no token store or no token available
|
|
180
|
-
*/
|
|
181
|
-
getToken(providerId?: string): Promise<string>;
|
|
182
|
-
/**
|
|
183
|
-
* Refresh token and return new access token
|
|
184
|
-
*/
|
|
185
|
-
private refreshAndGetToken;
|
|
186
|
-
/**
|
|
187
|
-
* Check if a provider has tokens stored
|
|
188
|
-
*/
|
|
189
|
-
hasProvider(providerId: string): boolean;
|
|
190
|
-
/**
|
|
191
|
-
* Get all provider IDs with tokens
|
|
192
|
-
*/
|
|
193
|
-
getProviderIds(): string[];
|
|
194
|
-
/**
|
|
195
|
-
* Add a new provider to this authorization
|
|
196
|
-
* Used when user authorizes additional providers after initial auth
|
|
197
|
-
*/
|
|
198
|
-
addProvider(providerId: string, tokens: {
|
|
199
|
-
accessToken: string;
|
|
200
|
-
refreshToken?: string;
|
|
201
|
-
expiresIn?: number;
|
|
202
|
-
}): Promise<void>;
|
|
203
|
-
/**
|
|
204
|
-
* Add app authorization after initial auth (progressive authorization).
|
|
205
|
-
* Stores app tokens server-side and updates authorized apps without JWT reissue.
|
|
206
|
-
*
|
|
207
|
-
* @param appId - App ID to authorize
|
|
208
|
-
* @param toolIds - Tool IDs accessible through this app authorization
|
|
209
|
-
* @param tokens - OAuth tokens from the app's auth provider
|
|
210
|
-
*
|
|
211
|
-
* @example
|
|
212
|
-
* ```typescript
|
|
213
|
-
* // User clicks auth link for Slack app
|
|
214
|
-
* await auth.addAppAuthorization('slack', ['slack:send_message', 'slack:list_channels'], {
|
|
215
|
-
* accessToken: slackAccessToken,
|
|
216
|
-
* refreshToken: slackRefreshToken,
|
|
217
|
-
* expiresIn: 3600,
|
|
218
|
-
* });
|
|
219
|
-
*
|
|
220
|
-
* // Now slack tools will work without re-auth
|
|
221
|
-
* ```
|
|
222
|
-
*/
|
|
223
|
-
addAppAuthorization(appId: string, toolIds: string[], tokens: {
|
|
224
|
-
accessToken: string;
|
|
225
|
-
refreshToken?: string;
|
|
226
|
-
expiresIn?: number;
|
|
227
|
-
}): Promise<void>;
|
|
228
|
-
/**
|
|
229
|
-
* Get access token for a specific app (for tool execution).
|
|
230
|
-
* Retrieves the app's OAuth token from server-side storage.
|
|
231
|
-
*
|
|
232
|
-
* @param appId - App ID to get token for
|
|
233
|
-
* @returns The decrypted access token, or null if not authorized
|
|
234
|
-
*/
|
|
235
|
-
getAppToken(appId: string): Promise<string | null>;
|
|
236
|
-
/**
|
|
237
|
-
* Check if an app is authorized (includes progressively authorized apps).
|
|
238
|
-
* Overrides base class to include mutable app authorization state.
|
|
239
|
-
*/
|
|
240
|
-
isAppAuthorized(appId: string): boolean;
|
|
241
|
-
/**
|
|
242
|
-
* Get all authorized app IDs (includes progressively authorized apps).
|
|
243
|
-
*/
|
|
244
|
-
getAllAuthorizedAppIds(): string[];
|
|
245
|
-
/**
|
|
246
|
-
* Get tool IDs authorized through an app.
|
|
247
|
-
*/
|
|
248
|
-
getAppToolIds(appId: string): string[] | undefined;
|
|
249
|
-
/**
|
|
250
|
-
* Remove a provider from this authorization
|
|
251
|
-
*/
|
|
252
|
-
removeProvider(providerId: string): Promise<void>;
|
|
253
|
-
/**
|
|
254
|
-
* Get the issuer (local orchestrator)
|
|
255
|
-
*/
|
|
256
|
-
get issuer(): string | undefined;
|
|
257
|
-
}
|
|
258
|
-
//# sourceMappingURL=orchestrated.authorization.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrated.authorization.d.ts","sourceRoot":"","sources":["../../../src/auth/authorization/orchestrated.authorization.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { AuthorizationBase } from './authorization.class';
|
|
2
|
-
import { AuthMode } from '../../common';
|
|
3
|
-
/**
|
|
4
|
-
* Context for creating a PublicAuthorization
|
|
5
|
-
*/
|
|
6
|
-
export interface PublicAuthorizationCreateCtx {
|
|
7
|
-
/**
|
|
8
|
-
* Anonymous user's identifier prefix
|
|
9
|
-
* @default 'anon'
|
|
10
|
-
*/
|
|
11
|
-
prefix?: string;
|
|
12
|
-
/**
|
|
13
|
-
* Anonymous scopes granted to the user
|
|
14
|
-
* @default ['anonymous']
|
|
15
|
-
*/
|
|
16
|
-
scopes?: string[];
|
|
17
|
-
/**
|
|
18
|
-
* Session TTL in milliseconds
|
|
19
|
-
* @default 3600000 (1 hour)
|
|
20
|
-
*/
|
|
21
|
-
ttlMs?: number;
|
|
22
|
-
/**
|
|
23
|
-
* Issuer identifier for the anonymous JWT
|
|
24
|
-
*/
|
|
25
|
-
issuer?: string;
|
|
26
|
-
/**
|
|
27
|
-
* Allowed tools for anonymous access
|
|
28
|
-
* If 'all', all tools are allowed
|
|
29
|
-
*/
|
|
30
|
-
allowedTools?: 'all' | string[];
|
|
31
|
-
/**
|
|
32
|
-
* Allowed prompts for anonymous access
|
|
33
|
-
* If 'all', all prompts are allowed
|
|
34
|
-
*/
|
|
35
|
-
allowedPrompts?: 'all' | string[];
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* PublicAuthorization - Authorization for public/anonymous access mode
|
|
39
|
-
*
|
|
40
|
-
* In public mode:
|
|
41
|
-
* - No authentication is required
|
|
42
|
-
* - Anonymous sessions are auto-generated
|
|
43
|
-
* - getToken() throws - anonymous users cannot access provider tokens
|
|
44
|
-
* - Ideal for development, docs, public wikis, and read-only resources
|
|
45
|
-
*/
|
|
46
|
-
export declare class PublicAuthorization extends AuthorizationBase {
|
|
47
|
-
readonly mode: AuthMode;
|
|
48
|
-
/**
|
|
49
|
-
* Issuer identifier for the anonymous authorization
|
|
50
|
-
*/
|
|
51
|
-
readonly issuer?: string;
|
|
52
|
-
private constructor();
|
|
53
|
-
/**
|
|
54
|
-
* Create a new PublicAuthorization for anonymous access
|
|
55
|
-
*
|
|
56
|
-
* @param ctx - Creation context with optional configuration
|
|
57
|
-
* @returns A new PublicAuthorization instance
|
|
58
|
-
*
|
|
59
|
-
* @example
|
|
60
|
-
* ```typescript
|
|
61
|
-
* const auth = PublicAuthorization.create({
|
|
62
|
-
* scopes: ['read', 'anonymous'],
|
|
63
|
-
* ttlMs: 3600000,
|
|
64
|
-
* allowedTools: ['search', 'get-docs'],
|
|
65
|
-
* });
|
|
66
|
-
* ```
|
|
67
|
-
*/
|
|
68
|
-
static create(ctx?: PublicAuthorizationCreateCtx): PublicAuthorization;
|
|
69
|
-
/**
|
|
70
|
-
* Anonymous users cannot access provider tokens
|
|
71
|
-
*
|
|
72
|
-
* @throws Error always - anonymous users do not have provider tokens
|
|
73
|
-
*/
|
|
74
|
-
getToken(_providerId?: string): Promise<string>;
|
|
75
|
-
/**
|
|
76
|
-
* Check if all tools are allowed (public access)
|
|
77
|
-
*/
|
|
78
|
-
get allowsAllTools(): boolean;
|
|
79
|
-
/**
|
|
80
|
-
* Check if all prompts are allowed (public access)
|
|
81
|
-
*/
|
|
82
|
-
get allowsAllPrompts(): boolean;
|
|
83
|
-
/**
|
|
84
|
-
* Override canAccessTool to support 'all' mode
|
|
85
|
-
*/
|
|
86
|
-
canAccessTool(toolId: string): boolean;
|
|
87
|
-
/**
|
|
88
|
-
* Override canAccessPrompt to support 'all' mode
|
|
89
|
-
*/
|
|
90
|
-
canAccessPrompt(promptId: string): boolean;
|
|
91
|
-
}
|
|
92
|
-
//# sourceMappingURL=public.authorization.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"public.authorization.d.ts","sourceRoot":"","sources":["../../../src/auth/authorization/public.authorization.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAElB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,YAAY,CAAC,EAAE,KAAK,GAAG,MAAM,EAAE,CAAC;IAEhC;;;OAGG;IACH,cAAc,CAAC,EAAE,KAAK,GAAG,MAAM,EAAE,CAAC;CACnC;AAED;;;;;;;;GAQG;AACH,qBAAa,mBAAoB,SAAQ,iBAAiB;IACxD,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAY;IAEnC;;OAEG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAEzB,OAAO;IAKP;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,MAAM,CAAC,GAAG,GAAE,4BAAiC,GAAG,mBAAmB;IA6D1E;;;;OAIG;IACG,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAOrD;;OAEG;IACH,IAAI,cAAc,IAAI,OAAO,CAE5B;IAED;;OAEG;IACH,IAAI,gBAAgB,IAAI,OAAO,CAE9B;IAED;;OAEG;IACM,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAQ/C;;OAEG;IACM,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;CAOpD"}
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import { AuthorizationBase } from './authorization.class';
|
|
2
|
-
import { AuthorizationCreateCtx } from './authorization.types';
|
|
3
|
-
import { AuthMode } from '../../common';
|
|
4
|
-
/**
|
|
5
|
-
* Verified JWT payload from transparent auth provider
|
|
6
|
-
*/
|
|
7
|
-
export interface TransparentVerifiedPayload {
|
|
8
|
-
/** Subject identifier */
|
|
9
|
-
sub: string;
|
|
10
|
-
/** Issuer */
|
|
11
|
-
iss?: string;
|
|
12
|
-
/** Audience */
|
|
13
|
-
aud?: string | string[];
|
|
14
|
-
/** Expiration (seconds since epoch) */
|
|
15
|
-
exp?: number;
|
|
16
|
-
/** Issued at (seconds since epoch) */
|
|
17
|
-
iat?: number;
|
|
18
|
-
/** Scopes (space-separated or array) */
|
|
19
|
-
scope?: string | string[];
|
|
20
|
-
/** Display name */
|
|
21
|
-
name?: string;
|
|
22
|
-
/** Email */
|
|
23
|
-
email?: string;
|
|
24
|
-
/** Picture URL */
|
|
25
|
-
picture?: string;
|
|
26
|
-
/** Additional claims */
|
|
27
|
-
[key: string]: unknown;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Context for creating a TransparentAuthorization
|
|
31
|
-
*/
|
|
32
|
-
export interface TransparentAuthorizationCreateCtx {
|
|
33
|
-
/**
|
|
34
|
-
* The original bearer token (passed through to downstream)
|
|
35
|
-
*/
|
|
36
|
-
token: string;
|
|
37
|
-
/**
|
|
38
|
-
* Verified JWT payload from the upstream provider
|
|
39
|
-
*/
|
|
40
|
-
payload: TransparentVerifiedPayload;
|
|
41
|
-
/**
|
|
42
|
-
* Provider ID for this authorization
|
|
43
|
-
*/
|
|
44
|
-
providerId: string;
|
|
45
|
-
/**
|
|
46
|
-
* Provider name for display/logging
|
|
47
|
-
*/
|
|
48
|
-
providerName?: string;
|
|
49
|
-
/**
|
|
50
|
-
* Precomputed authorization projections
|
|
51
|
-
*/
|
|
52
|
-
authorizedTools?: AuthorizationCreateCtx['authorizedTools'];
|
|
53
|
-
authorizedToolIds?: string[];
|
|
54
|
-
authorizedPrompts?: AuthorizationCreateCtx['authorizedPrompts'];
|
|
55
|
-
authorizedPromptIds?: string[];
|
|
56
|
-
authorizedApps?: AuthorizationCreateCtx['authorizedApps'];
|
|
57
|
-
authorizedAppIds?: string[];
|
|
58
|
-
authorizedResources?: string[];
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* TransparentAuthorization - Pass-through OAuth tokens
|
|
62
|
-
*
|
|
63
|
-
* In transparent mode:
|
|
64
|
-
* - The client's token is forwarded directly to downstream services
|
|
65
|
-
* - Token validation happens via the upstream provider's JWKS
|
|
66
|
-
* - getToken() returns the original bearer token
|
|
67
|
-
* - Ideal when the auth server is the source of truth
|
|
68
|
-
*/
|
|
69
|
-
export declare class TransparentAuthorization extends AuthorizationBase {
|
|
70
|
-
readonly mode: AuthMode;
|
|
71
|
-
/**
|
|
72
|
-
* Provider ID that issued the token
|
|
73
|
-
*/
|
|
74
|
-
readonly providerId: string;
|
|
75
|
-
/**
|
|
76
|
-
* Provider display name
|
|
77
|
-
*/
|
|
78
|
-
readonly providerName?: string;
|
|
79
|
-
private constructor();
|
|
80
|
-
/**
|
|
81
|
-
* Create a TransparentAuthorization from a verified JWT
|
|
82
|
-
*
|
|
83
|
-
* @param ctx - Creation context with token and verified payload
|
|
84
|
-
* @returns A new TransparentAuthorization instance
|
|
85
|
-
*
|
|
86
|
-
* @example
|
|
87
|
-
* ```typescript
|
|
88
|
-
* const auth = TransparentAuthorization.fromVerifiedToken({
|
|
89
|
-
* token: bearerToken,
|
|
90
|
-
* payload: verifiedClaims,
|
|
91
|
-
* providerId: 'auth0',
|
|
92
|
-
* });
|
|
93
|
-
*
|
|
94
|
-
* // Pass token through to downstream
|
|
95
|
-
* const token = await auth.getToken();
|
|
96
|
-
* ```
|
|
97
|
-
*/
|
|
98
|
-
static fromVerifiedToken(ctx: TransparentAuthorizationCreateCtx): TransparentAuthorization;
|
|
99
|
-
/**
|
|
100
|
-
* Get the original bearer token for pass-through
|
|
101
|
-
*
|
|
102
|
-
* In transparent mode, the same token is returned regardless of providerId
|
|
103
|
-
* since only one provider (the upstream) issued the token.
|
|
104
|
-
*
|
|
105
|
-
* @param _providerId - Ignored in transparent mode
|
|
106
|
-
* @returns The original bearer token
|
|
107
|
-
*/
|
|
108
|
-
getToken(_providerId?: string): Promise<string>;
|
|
109
|
-
/**
|
|
110
|
-
* Parse scope claim from JWT payload
|
|
111
|
-
*/
|
|
112
|
-
private static parseScopes;
|
|
113
|
-
/**
|
|
114
|
-
* Generate authorization ID from token signature
|
|
115
|
-
* Uses SHA-256 fingerprint of the token signature for uniqueness
|
|
116
|
-
*/
|
|
117
|
-
private static generateAuthorizationId;
|
|
118
|
-
/**
|
|
119
|
-
* Get the issuer from the token claims
|
|
120
|
-
*/
|
|
121
|
-
get issuer(): string | undefined;
|
|
122
|
-
/**
|
|
123
|
-
* Get the audience from the token claims
|
|
124
|
-
*/
|
|
125
|
-
get audience(): string | string[] | undefined;
|
|
126
|
-
/**
|
|
127
|
-
* Check if the token was issued for a specific audience
|
|
128
|
-
*/
|
|
129
|
-
hasAudience(aud: string): boolean;
|
|
130
|
-
}
|
|
131
|
-
//# sourceMappingURL=transparent.authorization.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transparent.authorization.d.ts","sourceRoot":"","sources":["../../../src/auth/authorization/transparent.authorization.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAY,MAAM,uBAAuB,CAAC;AAEzE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,yBAAyB;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,aAAa;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,eAAe;IACf,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACxB,uCAAuC;IACvC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,wCAAwC;IACxC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B,mBAAmB;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kBAAkB;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wBAAwB;IACxB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,iCAAiC;IAChD;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,OAAO,EAAE,0BAA0B,CAAC;IAEpC;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,eAAe,CAAC,EAAE,sBAAsB,CAAC,iBAAiB,CAAC,CAAC;IAC5D,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,iBAAiB,CAAC,EAAE,sBAAsB,CAAC,mBAAmB,CAAC,CAAC;IAChE,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B,cAAc,CAAC,EAAE,sBAAsB,CAAC,gBAAgB,CAAC,CAAC;IAC1D,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;CAChC;AAED;;;;;;;;GAQG;AACH,qBAAa,wBAAyB,SAAQ,iBAAiB;IAC7D,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAiB;IAExC;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAE/B,OAAO;IAWP;;;;;;;;;;;;;;;;;OAiBG;IACH,MAAM,CAAC,iBAAiB,CAAC,GAAG,EAAE,iCAAiC,GAAG,wBAAwB;IA8C1F;;;;;;;;OAQG;IACG,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAOrD;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,WAAW;IAM1B;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,uBAAuB;IAMtC;;OAEG;IACH,IAAI,MAAM,IAAI,MAAM,GAAG,SAAS,CAE/B;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAE5C;IAED;;OAEG;IACH,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;CAMlC"}
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Consent Flow Types and Schemas
|
|
3
|
-
*
|
|
4
|
-
* Defines types for the tool consent flow that allows users to select
|
|
5
|
-
* which MCP tools they want to expose to the LLM.
|
|
6
|
-
*/
|
|
7
|
-
import { z } from 'zod';
|
|
8
|
-
import { consentConfigSchema } from '../../common';
|
|
9
|
-
export { consentConfigSchema };
|
|
10
|
-
/**
|
|
11
|
-
* Tool consent item schema - represents a tool available for consent
|
|
12
|
-
*/
|
|
13
|
-
export declare const consentToolItemSchema: z.ZodObject<{
|
|
14
|
-
id: z.ZodString;
|
|
15
|
-
name: z.ZodString;
|
|
16
|
-
description: z.ZodOptional<z.ZodString>;
|
|
17
|
-
appId: z.ZodString;
|
|
18
|
-
appName: z.ZodString;
|
|
19
|
-
defaultSelected: z.ZodDefault<z.ZodBoolean>;
|
|
20
|
-
requiredScopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
21
|
-
category: z.ZodOptional<z.ZodString>;
|
|
22
|
-
}, z.core.$strip>;
|
|
23
|
-
/**
|
|
24
|
-
* Consent selection schema - user's tool selection
|
|
25
|
-
*/
|
|
26
|
-
export declare const consentSelectionSchema: z.ZodObject<{
|
|
27
|
-
selectedTools: z.ZodArray<z.ZodString>;
|
|
28
|
-
allSelected: z.ZodBoolean;
|
|
29
|
-
consentedAt: z.ZodString;
|
|
30
|
-
consentVersion: z.ZodDefault<z.ZodString>;
|
|
31
|
-
}, z.core.$strip>;
|
|
32
|
-
/**
|
|
33
|
-
* Consent page state schema - stored in pending authorization
|
|
34
|
-
*/
|
|
35
|
-
export declare const consentStateSchema: z.ZodObject<{
|
|
36
|
-
enabled: z.ZodBoolean;
|
|
37
|
-
availableTools: z.ZodArray<z.ZodObject<{
|
|
38
|
-
id: z.ZodString;
|
|
39
|
-
name: z.ZodString;
|
|
40
|
-
description: z.ZodOptional<z.ZodString>;
|
|
41
|
-
appId: z.ZodString;
|
|
42
|
-
appName: z.ZodString;
|
|
43
|
-
defaultSelected: z.ZodDefault<z.ZodBoolean>;
|
|
44
|
-
requiredScopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
45
|
-
category: z.ZodOptional<z.ZodString>;
|
|
46
|
-
}, z.core.$strip>>;
|
|
47
|
-
preselectedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
48
|
-
groupByApp: z.ZodDefault<z.ZodBoolean>;
|
|
49
|
-
customMessage: z.ZodOptional<z.ZodString>;
|
|
50
|
-
}, z.core.$strip>;
|
|
51
|
-
/**
|
|
52
|
-
* Auth provider item for federated login UI
|
|
53
|
-
*/
|
|
54
|
-
export declare const federatedProviderItemSchema: z.ZodObject<{
|
|
55
|
-
id: z.ZodString;
|
|
56
|
-
name: z.ZodString;
|
|
57
|
-
description: z.ZodOptional<z.ZodString>;
|
|
58
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
59
|
-
type: z.ZodEnum<{
|
|
60
|
-
remote: "remote";
|
|
61
|
-
transparent: "transparent";
|
|
62
|
-
local: "local";
|
|
63
|
-
}>;
|
|
64
|
-
providerUrl: z.ZodOptional<z.ZodString>;
|
|
65
|
-
appIds: z.ZodArray<z.ZodString>;
|
|
66
|
-
appNames: z.ZodArray<z.ZodString>;
|
|
67
|
-
scopes: z.ZodArray<z.ZodString>;
|
|
68
|
-
isPrimary: z.ZodBoolean;
|
|
69
|
-
isOptional: z.ZodDefault<z.ZodBoolean>;
|
|
70
|
-
}, z.core.$strip>;
|
|
71
|
-
/**
|
|
72
|
-
* Federated login state schema
|
|
73
|
-
*/
|
|
74
|
-
export declare const federatedLoginStateSchema: z.ZodObject<{
|
|
75
|
-
providers: z.ZodArray<z.ZodObject<{
|
|
76
|
-
id: z.ZodString;
|
|
77
|
-
name: z.ZodString;
|
|
78
|
-
description: z.ZodOptional<z.ZodString>;
|
|
79
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
80
|
-
type: z.ZodEnum<{
|
|
81
|
-
remote: "remote";
|
|
82
|
-
transparent: "transparent";
|
|
83
|
-
local: "local";
|
|
84
|
-
}>;
|
|
85
|
-
providerUrl: z.ZodOptional<z.ZodString>;
|
|
86
|
-
appIds: z.ZodArray<z.ZodString>;
|
|
87
|
-
appNames: z.ZodArray<z.ZodString>;
|
|
88
|
-
scopes: z.ZodArray<z.ZodString>;
|
|
89
|
-
isPrimary: z.ZodBoolean;
|
|
90
|
-
isOptional: z.ZodDefault<z.ZodBoolean>;
|
|
91
|
-
}, z.core.$strip>>;
|
|
92
|
-
primaryProviderId: z.ZodOptional<z.ZodString>;
|
|
93
|
-
allowSkip: z.ZodDefault<z.ZodBoolean>;
|
|
94
|
-
preselectedProviders: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
95
|
-
}, z.core.$strip>;
|
|
96
|
-
/**
|
|
97
|
-
* Federated login selection schema
|
|
98
|
-
*/
|
|
99
|
-
export declare const federatedSelectionSchema: z.ZodObject<{
|
|
100
|
-
selectedProviders: z.ZodArray<z.ZodString>;
|
|
101
|
-
skippedProviders: z.ZodArray<z.ZodString>;
|
|
102
|
-
providerMetadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
103
|
-
}, z.core.$strip>;
|
|
104
|
-
export type ConsentToolItem = z.infer<typeof consentToolItemSchema>;
|
|
105
|
-
export type ConsentSelection = z.infer<typeof consentSelectionSchema>;
|
|
106
|
-
export type ConsentState = z.infer<typeof consentStateSchema>;
|
|
107
|
-
export type ConsentConfig = z.infer<typeof consentConfigSchema>;
|
|
108
|
-
export type ConsentConfigInput = z.input<typeof consentConfigSchema>;
|
|
109
|
-
export type FederatedProviderItem = z.infer<typeof federatedProviderItemSchema>;
|
|
110
|
-
export type FederatedLoginState = z.infer<typeof federatedLoginStateSchema>;
|
|
111
|
-
export type FederatedSelection = z.infer<typeof federatedSelectionSchema>;
|
|
112
|
-
//# sourceMappingURL=consent.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"consent.types.d.ts","sourceRoot":"","sources":["../../../src/auth/consent/consent.types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGnD,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAM/B;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;iBAiBhC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;iBASjC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;iBAW7B,CAAC;AAKH;;GAEG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;iBAuBtC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;iBASpC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;iBAOnC,CAAC;AAMH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAErE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAChF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
|
package/auth/consent/index.d.ts
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export { consentToolItemSchema, consentSelectionSchema, consentStateSchema, federatedProviderItemSchema, federatedLoginStateSchema, federatedSelectionSchema, ConsentToolItem, ConsentSelection, ConsentState, ConsentConfig, ConsentConfigInput, FederatedProviderItem, FederatedLoginState, FederatedSelection, } from './consent.types';
|
|
2
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/auth/consent/index.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,qBAAqB,EACrB,sBAAsB,EACtB,kBAAkB,EAClB,2BAA2B,EAC3B,yBAAyB,EACzB,wBAAwB,EAExB,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC"}
|