@frontmcp/auth 1.3.0 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/authorities/authorities.profiles.d.ts +14 -1
- package/authorities/authorities.profiles.d.ts.map +1 -1
- package/authorization/dcr-client.registry.d.ts +83 -0
- package/authorization/dcr-client.registry.d.ts.map +1 -0
- package/authorization/index.d.ts +2 -0
- package/authorization/index.d.ts.map +1 -1
- package/cimd/cimd.service.d.ts +2 -9
- package/cimd/cimd.service.d.ts.map +1 -1
- package/common/session.types.d.ts +4 -4
- package/esm/index.mjs +1821 -214
- package/esm/package.json +8 -8
- package/index.d.ts +5 -5
- package/index.d.ts.map +1 -1
- package/index.js +2030 -383
- package/jwks/jwks.service.d.ts +2 -4
- package/jwks/jwks.service.d.ts.map +1 -1
- package/options/app-auth.schema.d.ts +226 -0
- package/options/app-auth.schema.d.ts.map +1 -1
- package/options/index.d.ts +4 -4
- package/options/index.d.ts.map +1 -1
- package/options/interfaces.d.ts +580 -4
- package/options/interfaces.d.ts.map +1 -1
- package/options/orchestrated.schema.d.ts +492 -1
- package/options/orchestrated.schema.d.ts.map +1 -1
- package/options/schema.d.ts +226 -0
- package/options/schema.d.ts.map +1 -1
- package/options/shared.schemas.d.ts +237 -2
- package/options/shared.schemas.d.ts.map +1 -1
- package/package.json +8 -8
- package/session/authorization.store.d.ts +117 -47
- package/session/authorization.store.d.ts.map +1 -1
- package/session/consent.store.d.ts +86 -0
- package/session/consent.store.d.ts.map +1 -0
- package/session/credential-resume-link.d.ts +64 -0
- package/session/credential-resume-link.d.ts.map +1 -0
- package/session/credentials-accessor.d.ts +102 -0
- package/session/credentials-accessor.d.ts.map +1 -0
- package/session/credentials-accessor.impl.d.ts +46 -0
- package/session/credentials-accessor.impl.d.ts.map +1 -0
- package/session/index.d.ts +32 -2
- package/session/index.d.ts.map +1 -1
- package/session/orchestrated-token.crypto.d.ts +33 -0
- package/session/orchestrated-token.crypto.d.ts.map +1 -0
- package/session/secure-store-accessor.d.ts +77 -0
- package/session/secure-store-accessor.d.ts.map +1 -0
- package/session/secure-store-accessor.impl.d.ts +61 -0
- package/session/secure-store-accessor.impl.d.ts.map +1 -0
- package/session/secure-store-backends.d.ts +75 -0
- package/session/secure-store-backends.d.ts.map +1 -0
- package/session/secure-store.d.ts +89 -0
- package/session/secure-store.d.ts.map +1 -0
- package/session/secure-store.factory.d.ts +62 -0
- package/session/secure-store.factory.d.ts.map +1 -0
- package/session/session-credential-vault.d.ts +153 -0
- package/session/session-credential-vault.d.ts.map +1 -0
- package/session/session-credential-vault.factory.d.ts +50 -0
- package/session/session-credential-vault.factory.d.ts.map +1 -0
- package/session/storage-authorization.store.d.ts +51 -0
- package/session/storage-authorization.store.d.ts.map +1 -0
- package/session/storage-consent.store.d.ts +33 -0
- package/session/storage-consent.store.d.ts.map +1 -0
- package/session/storage-federated-auth.session.d.ts +36 -0
- package/session/storage-federated-auth.session.d.ts.map +1 -0
- package/session/storage-orchestrated-token.store.d.ts +72 -0
- package/session/storage-orchestrated-token.store.d.ts.map +1 -0
- package/session/token-storage.factory.d.ts +46 -0
- package/session/token-storage.factory.d.ts.map +1 -0
- package/ui/index.d.ts +3 -2
- package/ui/index.d.ts.map +1 -1
- package/ui/local-login.helper.d.ts +31 -0
- package/ui/local-login.helper.d.ts.map +1 -0
- package/ui/templates.d.ts +118 -2
- package/ui/templates.d.ts.map +1 -1
- package/vault/auth-providers.types.d.ts +3 -3
package/ui/templates.d.ts
CHANGED
|
@@ -97,7 +97,33 @@ export declare function buildFederatedLoginPage(params: {
|
|
|
97
97
|
callbackPath: string;
|
|
98
98
|
}): string;
|
|
99
99
|
/**
|
|
100
|
-
*
|
|
100
|
+
* A hidden field to round-trip on the consent form (identity / federated
|
|
101
|
+
* context) so the consent POST back to `/oauth/callback` carries everything the
|
|
102
|
+
* mint step needs.
|
|
103
|
+
*/
|
|
104
|
+
export interface ConsentHiddenField {
|
|
105
|
+
/** Form field name. */
|
|
106
|
+
name: string;
|
|
107
|
+
/** Field value (rendered escaped). */
|
|
108
|
+
value: string;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Build consent page for tool selection.
|
|
112
|
+
*
|
|
113
|
+
* The form GETs/POSTs back to `callbackPath` (`/oauth/callback`) carrying
|
|
114
|
+
* `pending_auth_id`, the chosen `tools=` checkboxes, and any caller-supplied
|
|
115
|
+
* {@link ConsentHiddenField hidden context} (identity / `federated=true` /
|
|
116
|
+
* `providers=`). Honors the `auth.consent` config flags:
|
|
117
|
+
*
|
|
118
|
+
* - `groupByApp` — group tools under per-app cards (default) or render a flat list.
|
|
119
|
+
* - `showDescriptions`— show tool descriptions (default) or hide them.
|
|
120
|
+
* - `customMessage` — replace the default subtitle.
|
|
121
|
+
* - `allowSelectAll` — render the select-all + per-app toggle controls (default).
|
|
122
|
+
* - `requireSelection`— require ≥1 tool; disables the submit button at 0 selected.
|
|
123
|
+
* - `defaultSelectedTools` — the set of tool ids to pre-check (others unchecked).
|
|
124
|
+
* When omitted, ALL tools are pre-checked (the historical default).
|
|
125
|
+
*
|
|
126
|
+
* Note: `excludedTools` are filtered out by the caller and never appear here.
|
|
101
127
|
*/
|
|
102
128
|
export declare function buildToolConsentPage(params: {
|
|
103
129
|
tools: ToolCard[];
|
|
@@ -107,15 +133,105 @@ export declare function buildToolConsentPage(params: {
|
|
|
107
133
|
callbackPath: string;
|
|
108
134
|
userName?: string;
|
|
109
135
|
userEmail?: string;
|
|
136
|
+
/** Group tools by app (default true). When false, a single flat list is rendered. */
|
|
137
|
+
groupByApp?: boolean;
|
|
138
|
+
/** Show per-tool descriptions (default true). */
|
|
139
|
+
showDescriptions?: boolean;
|
|
140
|
+
/** Replace the default subtitle with a custom message. */
|
|
141
|
+
customMessage?: string;
|
|
142
|
+
/** Render the select-all / toggle-all controls (default true). */
|
|
143
|
+
allowSelectAll?: boolean;
|
|
144
|
+
/** Require at least one tool to be selected (default true). */
|
|
145
|
+
requireSelection?: boolean;
|
|
146
|
+
/**
|
|
147
|
+
* Tool ids to pre-check. When omitted, every tool is pre-checked (historical
|
|
148
|
+
* default). When provided, only listed ids are checked.
|
|
149
|
+
*/
|
|
150
|
+
defaultSelectedTools?: string[];
|
|
151
|
+
/** Optional error banner (e.g. re-render after an empty `requireSelection` submit). */
|
|
152
|
+
error?: string;
|
|
153
|
+
/** Hidden fields to round-trip (identity / federated context) back to the callback. */
|
|
154
|
+
hiddenFields?: ConsentHiddenField[];
|
|
110
155
|
}): string;
|
|
111
156
|
/**
|
|
112
|
-
*
|
|
157
|
+
* A custom login field rendered on the built-in login page (Checkpoint 3a).
|
|
158
|
+
* Mirrors `LoginFieldConfig` from `@frontmcp/auth` options, plus the field `name`.
|
|
159
|
+
*/
|
|
160
|
+
export interface LoginExtraField {
|
|
161
|
+
/** Field name (form key submitted to the callback). */
|
|
162
|
+
name: string;
|
|
163
|
+
/** HTML input type. `hidden` is submitted but not shown. */
|
|
164
|
+
type: 'text' | 'password' | 'email' | 'select' | 'hidden';
|
|
165
|
+
/** Field label. Defaults to the field name. */
|
|
166
|
+
label?: string;
|
|
167
|
+
/** Whether the field is required. */
|
|
168
|
+
required?: boolean;
|
|
169
|
+
/** Placeholder text. */
|
|
170
|
+
placeholder?: string;
|
|
171
|
+
/** Options for a `select` field. */
|
|
172
|
+
options?: Array<{
|
|
173
|
+
value: string;
|
|
174
|
+
label: string;
|
|
175
|
+
}>;
|
|
176
|
+
/** Pre-filled value (e.g. when re-rendering after an error). */
|
|
177
|
+
value?: string;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Build simple login page.
|
|
181
|
+
*
|
|
182
|
+
* The default email/name form is rendered when no `extraFields` are supplied —
|
|
183
|
+
* byte-for-byte identical to the historical page (the optional params below all
|
|
184
|
+
* default to falsy). When `extraFields` is provided (Checkpoint 3a local-login
|
|
185
|
+
* customization), the built-in email/name fields are REPLACED by the supplied
|
|
186
|
+
* fields and `title`/`subtitle`/`logoUri`/`error` customize the chrome.
|
|
113
187
|
*/
|
|
114
188
|
export declare function buildLoginPage(params: {
|
|
115
189
|
clientName: string;
|
|
116
190
|
scope: string;
|
|
117
191
|
pendingAuthId: string;
|
|
118
192
|
callbackPath: string;
|
|
193
|
+
/** Optional page heading override. Defaults to "Sign In". */
|
|
194
|
+
title?: string;
|
|
195
|
+
/** Optional sub-heading. Defaults to "Authorize access to {clientName}". */
|
|
196
|
+
subtitle?: string;
|
|
197
|
+
/** Optional logo image URL shown above the form. */
|
|
198
|
+
logoUri?: string;
|
|
199
|
+
/** Optional error banner shown above the form (re-render after failed authenticate()). */
|
|
200
|
+
error?: string;
|
|
201
|
+
/**
|
|
202
|
+
* Optional custom fields. When provided, these REPLACE the default
|
|
203
|
+
* email/name inputs and are submitted to the callback as form values.
|
|
204
|
+
*/
|
|
205
|
+
extraFields?: LoginExtraField[];
|
|
206
|
+
}): string;
|
|
207
|
+
/**
|
|
208
|
+
* Build the mid-session "connect credential" page (Checkpoint 3b).
|
|
209
|
+
*
|
|
210
|
+
* Renders a single-field form (reusing the {@link LoginExtraField} renderer) that
|
|
211
|
+
* POSTs the framework-signed `token` plus the credential field value back to the
|
|
212
|
+
* `/oauth/connect` handler. Mirrors the login page chrome so the experience is
|
|
213
|
+
* consistent with the initial sign-in.
|
|
214
|
+
*
|
|
215
|
+
* @param params.token The framework-signed resume token (round-tripped as a hidden field).
|
|
216
|
+
* @param params.field The single credential field to render (e.g. an API key / password input).
|
|
217
|
+
* @param params.action The connect endpoint path the form submits to.
|
|
218
|
+
*/
|
|
219
|
+
export declare function buildConnectPage(params: {
|
|
220
|
+
token: string;
|
|
221
|
+
field: LoginExtraField;
|
|
222
|
+
action: string;
|
|
223
|
+
title?: string;
|
|
224
|
+
subtitle?: string;
|
|
225
|
+
logoUri?: string;
|
|
226
|
+
error?: string;
|
|
227
|
+
}): string;
|
|
228
|
+
/**
|
|
229
|
+
* Build the success page shown after a credential is connected mid-session
|
|
230
|
+
* (Checkpoint 3b). No secrets are rendered — only a confirmation message.
|
|
231
|
+
*/
|
|
232
|
+
export declare function buildConnectSuccessPage(params: {
|
|
233
|
+
key: string;
|
|
234
|
+
message?: string;
|
|
119
235
|
}): string;
|
|
120
236
|
/**
|
|
121
237
|
* Build error page
|
package/ui/templates.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/ui/templates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/ui/templates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,UAAU,IAAI,cAAc,EAAmD,MAAM,eAAe,CAAC;AAM9G;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,qBAAqB;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,mBAAmB;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,sBAAsB;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sDAAsD;IACtD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kCAAkC;IAClC,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,0BAA0B;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,0CAA0C;IAC1C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,kDAAkD;IAClD,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,sBAAsB;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,mBAAmB;IACnB,QAAQ,EAAE,MAAM,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AAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0FAA0F;IAC1F,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,WAAW,CAAC,EAAE,eAAe,EAAE,CAAC;CACjC,GAAG,MAAM,CA2ET;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,eAAe,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,MAAM,CAoCT;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAezF;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAsBrF;AAMD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAEhF"}
|
|
@@ -14,8 +14,8 @@ import type { AuthorizationVault, Credential } from '../session';
|
|
|
14
14
|
*/
|
|
15
15
|
export type CredentialScope = 'global' | 'user' | 'session';
|
|
16
16
|
export declare const credentialScopeSchema: import("@frontmcp/lazy-zod").ZodEnum<{
|
|
17
|
-
session: "session";
|
|
18
17
|
user: "user";
|
|
18
|
+
session: "session";
|
|
19
19
|
global: "global";
|
|
20
20
|
}>;
|
|
21
21
|
/**
|
|
@@ -140,8 +140,8 @@ export declare const credentialProviderConfigSchema: import("@frontmcp/lazy-zod"
|
|
|
140
140
|
name: import("@frontmcp/lazy-zod").ZodString;
|
|
141
141
|
description: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodString>;
|
|
142
142
|
scope: import("@frontmcp/lazy-zod").ZodEnum<{
|
|
143
|
-
session: "session";
|
|
144
143
|
user: "user";
|
|
144
|
+
session: "session";
|
|
145
145
|
global: "global";
|
|
146
146
|
}>;
|
|
147
147
|
loading: import("@frontmcp/lazy-zod").ZodEnum<{
|
|
@@ -226,8 +226,8 @@ export declare const authProvidersVaultOptionsSchema: import("@frontmcp/lazy-zod
|
|
|
226
226
|
name: import("@frontmcp/lazy-zod").ZodString;
|
|
227
227
|
description: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodString>;
|
|
228
228
|
scope: import("@frontmcp/lazy-zod").ZodEnum<{
|
|
229
|
-
session: "session";
|
|
230
229
|
user: "user";
|
|
230
|
+
session: "session";
|
|
231
231
|
global: "global";
|
|
232
232
|
}>;
|
|
233
233
|
loading: import("@frontmcp/lazy-zod").ZodEnum<{
|