@frontmcp/auth 1.0.4 → 1.1.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/authorities/authorities.context.d.ts +63 -0
- package/authorities/authorities.context.d.ts.map +1 -0
- package/authorities/authorities.engine.d.ts +65 -0
- package/authorities/authorities.engine.d.ts.map +1 -0
- package/authorities/authorities.errors.d.ts +59 -0
- package/authorities/authorities.errors.d.ts.map +1 -0
- package/authorities/authorities.evaluator.d.ts +28 -0
- package/authorities/authorities.evaluator.d.ts.map +1 -0
- package/authorities/authorities.metadata-augment.d.ts +31 -0
- package/authorities/authorities.metadata-augment.d.ts.map +1 -0
- package/authorities/authorities.profiles.d.ts +75 -0
- package/authorities/authorities.profiles.d.ts.map +1 -0
- package/authorities/authorities.registry.d.ts +86 -0
- package/authorities/authorities.registry.d.ts.map +1 -0
- package/authorities/authorities.schema.d.ts +24 -0
- package/authorities/authorities.schema.d.ts.map +1 -0
- package/authorities/authorities.scope-mapping.d.ts +16 -0
- package/authorities/authorities.scope-mapping.d.ts.map +1 -0
- package/authorities/authorities.types.d.ts +290 -0
- package/authorities/authorities.types.d.ts.map +1 -0
- package/authorities/index.d.ts +17 -0
- package/authorities/index.d.ts.map +1 -0
- package/authorization/authorization.class.d.ts +2 -3
- package/authorization/authorization.class.d.ts.map +1 -1
- package/authorization/authorization.types.d.ts +53 -54
- package/authorization/authorization.types.d.ts.map +1 -1
- package/authorization/index.d.ts +1 -1
- package/authorization/index.d.ts.map +1 -1
- package/cimd/cimd.types.d.ts +90 -90
- package/cimd/cimd.types.d.ts.map +1 -1
- package/common/jwt.types.d.ts +16 -16
- package/common/jwt.types.d.ts.map +1 -1
- package/common/session.types.d.ts +75 -76
- package/common/session.types.d.ts.map +1 -1
- package/common/zod-utils.d.ts +1 -1
- package/common/zod-utils.d.ts.map +1 -1
- package/consent/consent.types.d.ts +69 -69
- package/consent/consent.types.d.ts.map +1 -1
- package/context/frontmcp-auth-context.d.ts +113 -0
- package/context/frontmcp-auth-context.d.ts.map +1 -0
- package/context/frontmcp-auth-context.factory.d.ts +39 -0
- package/context/frontmcp-auth-context.factory.d.ts.map +1 -0
- package/context/frontmcp-auth-context.impl.d.ts +72 -0
- package/context/frontmcp-auth-context.impl.d.ts.map +1 -0
- package/context/index.d.ts +16 -0
- package/context/index.d.ts.map +1 -0
- package/detection/auth-provider-detection.d.ts +25 -25
- package/detection/auth-provider-detection.d.ts.map +1 -1
- package/esm/index.mjs +1036 -120
- package/esm/package.json +5 -5
- package/fetch/fetch-credential-middleware.d.ts +99 -0
- package/fetch/fetch-credential-middleware.d.ts.map +1 -0
- package/fetch/index.d.ts +10 -0
- package/fetch/index.d.ts.map +1 -0
- package/index.d.ts +6 -2
- package/index.d.ts.map +1 -1
- package/index.js +1619 -680
- package/machine-id/index.d.ts +1 -1
- package/machine-id/index.d.ts.map +1 -1
- package/options/app-auth.schema.d.ts +235 -235
- package/options/app-auth.schema.d.ts.map +1 -1
- package/options/orchestrated.schema.d.ts +371 -371
- package/options/orchestrated.schema.d.ts.map +1 -1
- package/options/public.schema.d.ts +16 -16
- package/options/public.schema.d.ts.map +1 -1
- package/options/schema.d.ts +227 -227
- package/options/schema.d.ts.map +1 -1
- package/options/shared.schemas.d.ts +97 -97
- package/options/shared.schemas.d.ts.map +1 -1
- package/options/transparent.schema.d.ts +30 -30
- package/options/transparent.schema.d.ts.map +1 -1
- package/options/typecheck.d.ts.map +1 -1
- package/package.json +5 -5
- package/session/authorization-vault.d.ts +380 -380
- package/session/authorization-vault.d.ts.map +1 -1
- package/session/authorization.store.d.ts +28 -29
- package/session/authorization.store.d.ts.map +1 -1
- package/session/encrypted-authorization-vault.d.ts +21 -21
- package/session/encrypted-authorization-vault.d.ts.map +1 -1
- package/session/transport-session.types.d.ts +166 -167
- package/session/transport-session.types.d.ts.map +1 -1
- package/session/vault-encryption.d.ts +27 -27
- package/session/vault-encryption.d.ts.map +1 -1
- package/vault/auth-providers.types.d.ts +45 -46
- package/vault/auth-providers.types.d.ts.map +1 -1
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Authorities Type Definitions
|
|
3
|
+
*
|
|
4
|
+
* Core types for the built-in RBAC, ABAC, and ReBAC authorization system.
|
|
5
|
+
* These types are used in decorator metadata across all entry types
|
|
6
|
+
* (Tools, Resources, Prompts, Skills, Agents).
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Role-based policy. At least one of `all` or `any` must be specified.
|
|
10
|
+
*
|
|
11
|
+
* - `all`: user must have **every** listed role (AND)
|
|
12
|
+
* - `any`: user must have **at least one** listed role (OR)
|
|
13
|
+
*
|
|
14
|
+
* When both are set, both conditions must be satisfied.
|
|
15
|
+
*/
|
|
16
|
+
export interface RbacRolesPolicy {
|
|
17
|
+
/** User must have ALL of these roles */
|
|
18
|
+
all?: string[];
|
|
19
|
+
/** User must have at least ONE of these roles */
|
|
20
|
+
any?: string[];
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Permission-based policy. Same semantics as {@link RbacRolesPolicy}.
|
|
24
|
+
*/
|
|
25
|
+
export interface RbacPermissionsPolicy {
|
|
26
|
+
/** User must have ALL of these permissions */
|
|
27
|
+
all?: string[];
|
|
28
|
+
/** User must have at least ONE of these permissions */
|
|
29
|
+
any?: string[];
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Operators for ABAC condition evaluation.
|
|
33
|
+
*/
|
|
34
|
+
export type AbacOperator = 'eq' | 'neq' | 'in' | 'notIn' | 'gt' | 'gte' | 'lt' | 'lte' | 'contains' | 'startsWith' | 'endsWith' | 'exists' | 'matches';
|
|
35
|
+
/**
|
|
36
|
+
* Dynamic value reference resolved at evaluation time.
|
|
37
|
+
* Used in ABAC conditions and ReBAC resource IDs.
|
|
38
|
+
*/
|
|
39
|
+
export type DynamicValueRef = {
|
|
40
|
+
fromInput: string;
|
|
41
|
+
} | {
|
|
42
|
+
fromClaims: string;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* A single ABAC condition.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```typescript
|
|
49
|
+
* { path: 'user.department', op: 'eq', value: 'engineering' }
|
|
50
|
+
* { path: 'claims.org_id', op: 'eq', value: { fromInput: 'tenantId' } }
|
|
51
|
+
* { path: 'env.NODE_ENV', op: 'in', value: ['staging', 'production'] }
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
export interface AbacCondition {
|
|
55
|
+
/**
|
|
56
|
+
* Dot-path into the evaluation context envelope.
|
|
57
|
+
* Prefixes: `user.*`, `claims.*`, `input.*`, `env.*`
|
|
58
|
+
*/
|
|
59
|
+
path: string;
|
|
60
|
+
/** Comparison operator */
|
|
61
|
+
op: AbacOperator;
|
|
62
|
+
/**
|
|
63
|
+
* Value to compare against.
|
|
64
|
+
* Can be a literal or a {@link DynamicValueRef} resolved at runtime.
|
|
65
|
+
*/
|
|
66
|
+
value: unknown;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Attribute-based policy. At least one of `match` or `conditions` must be specified.
|
|
70
|
+
*/
|
|
71
|
+
export interface AbacPolicy {
|
|
72
|
+
/**
|
|
73
|
+
* Simple equality checks: each key is a dot-path, value is the expected value.
|
|
74
|
+
* All pairs must match (AND semantics).
|
|
75
|
+
*/
|
|
76
|
+
match?: Record<string, unknown>;
|
|
77
|
+
/**
|
|
78
|
+
* Advanced conditions with operators. All conditions must pass (AND semantics).
|
|
79
|
+
*/
|
|
80
|
+
conditions?: AbacCondition[];
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* How to resolve a resource ID at evaluation time.
|
|
84
|
+
*/
|
|
85
|
+
export type ResourceIdRef = string | {
|
|
86
|
+
fromInput: string;
|
|
87
|
+
} | {
|
|
88
|
+
fromClaims: string;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* A relationship-based access check.
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```typescript
|
|
95
|
+
* { type: 'member', resource: 'site', resourceId: { fromInput: 'siteId' } }
|
|
96
|
+
* { type: 'owner', resource: 'document', resourceId: { fromClaims: 'user.docId' } }
|
|
97
|
+
* ```
|
|
98
|
+
*/
|
|
99
|
+
export interface RebacPolicy {
|
|
100
|
+
/** Relationship type (e.g., 'owner', 'member', 'viewer') */
|
|
101
|
+
type: string;
|
|
102
|
+
/** Resource type (e.g., 'site', 'org', 'document') */
|
|
103
|
+
resource: string;
|
|
104
|
+
/** Resource identifier — literal string, from input, or from claims */
|
|
105
|
+
resourceId: ResourceIdRef;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* A composable authorization policy supporting RBAC, ABAC, ReBAC, and custom evaluators.
|
|
109
|
+
*
|
|
110
|
+
* Multiple fields are combined using `operator` (default `'AND'`).
|
|
111
|
+
* Use `allOf`, `anyOf`, `not` for complex compositions.
|
|
112
|
+
*/
|
|
113
|
+
/**
|
|
114
|
+
* Async guard function for dynamic authorization checks (DB/Redis/API calls).
|
|
115
|
+
* Returns `true` if granted, or a `string` denial message if denied.
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* ```typescript
|
|
119
|
+
* const guard: AuthorityGuardFn = async (ctx) => {
|
|
120
|
+
* const allowed = await redis.sismember('allowed-tenants', ctx.input['tenantId']);
|
|
121
|
+
* return allowed ? true : 'tenant not in allowlist';
|
|
122
|
+
* };
|
|
123
|
+
* ```
|
|
124
|
+
*/
|
|
125
|
+
export type AuthorityGuardFn = (ctx: AuthoritiesEvaluationContext) => boolean | string | Promise<boolean | string>;
|
|
126
|
+
export interface AuthoritiesPolicyMetadata {
|
|
127
|
+
/** RBAC: required roles */
|
|
128
|
+
roles?: RbacRolesPolicy;
|
|
129
|
+
/** RBAC: required permissions */
|
|
130
|
+
permissions?: RbacPermissionsPolicy;
|
|
131
|
+
/** ABAC: attribute-based conditions */
|
|
132
|
+
attributes?: AbacPolicy;
|
|
133
|
+
/** ReBAC: relationship-based checks */
|
|
134
|
+
relationships?: RebacPolicy | RebacPolicy[];
|
|
135
|
+
/** Custom evaluator policies (key = evaluator name, value = evaluator-specific config) */
|
|
136
|
+
custom?: Record<string, unknown>;
|
|
137
|
+
/**
|
|
138
|
+
* Async guard functions for dynamic authorization (DB/Redis/API lookups).
|
|
139
|
+
* Each guard runs in sequence. If any returns `false` or a denial string, access is denied.
|
|
140
|
+
* Guards are combined with other policy fields via `operator` (default AND).
|
|
141
|
+
*/
|
|
142
|
+
guards?: AuthorityGuardFn[];
|
|
143
|
+
/** How to combine top-level fields. Default: `'AND'` */
|
|
144
|
+
operator?: 'AND' | 'OR';
|
|
145
|
+
/** Negate a nested policy */
|
|
146
|
+
not?: AuthoritiesPolicyMetadata;
|
|
147
|
+
/** At least one nested policy must pass (OR combinator) */
|
|
148
|
+
anyOf?: AuthoritiesPolicyMetadata[];
|
|
149
|
+
/** All nested policies must pass (AND combinator) */
|
|
150
|
+
allOf?: AuthoritiesPolicyMetadata[];
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Global extensible interface for authority profile names.
|
|
154
|
+
* Developers augment this to get type-safe profile references.
|
|
155
|
+
*
|
|
156
|
+
* @example
|
|
157
|
+
* ```typescript
|
|
158
|
+
* declare global {
|
|
159
|
+
* interface FrontMcpAuthorityProfiles {
|
|
160
|
+
* admin: true;
|
|
161
|
+
* authenticated: true;
|
|
162
|
+
* matchTenant: true;
|
|
163
|
+
* }
|
|
164
|
+
* }
|
|
165
|
+
* ```
|
|
166
|
+
*/
|
|
167
|
+
declare global {
|
|
168
|
+
interface FrontMcpAuthorityProfiles {
|
|
169
|
+
[key: string]: true;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* A registered authority profile name.
|
|
174
|
+
* Type-safe when {@link FrontMcpAuthorityProfiles} is augmented.
|
|
175
|
+
*/
|
|
176
|
+
export type AuthorityProfileName = string & keyof FrontMcpAuthorityProfiles;
|
|
177
|
+
/**
|
|
178
|
+
* The unified `authorities` field accepted by all entry decorators.
|
|
179
|
+
*
|
|
180
|
+
* Three forms:
|
|
181
|
+
* 1. **String** — reference to a registered profile: `'admin'`
|
|
182
|
+
* 2. **String array** — multiple profiles evaluated as AND: `['authenticated', 'matchTenant']`
|
|
183
|
+
* 3. **Policy object** — inline RBAC/ABAC/ReBAC policy
|
|
184
|
+
*
|
|
185
|
+
* @example
|
|
186
|
+
* ```typescript
|
|
187
|
+
* // Profile reference
|
|
188
|
+
* @Tool({ authorities: 'admin' })
|
|
189
|
+
*
|
|
190
|
+
* // Multiple profiles
|
|
191
|
+
* @Tool({ authorities: ['authenticated', 'matchTenant'] })
|
|
192
|
+
*
|
|
193
|
+
* // Inline policy
|
|
194
|
+
* @Tool({ authorities: { roles: { any: ['admin'] }, permissions: { all: ['users:delete'] } } })
|
|
195
|
+
* ```
|
|
196
|
+
*/
|
|
197
|
+
export type AuthoritiesMetadata = AuthorityProfileName | AuthorityProfileName[] | AuthoritiesPolicyMetadata;
|
|
198
|
+
/**
|
|
199
|
+
* Structured denial data from an authorities evaluation.
|
|
200
|
+
*/
|
|
201
|
+
export interface AuthoritiesDenial {
|
|
202
|
+
/** Which policy type caused the denial */
|
|
203
|
+
kind: 'roles' | 'permissions' | 'attributes' | 'relationships' | 'custom' | 'profile' | 'not' | 'allOf' | 'anyOf';
|
|
204
|
+
/** Dot-path into the policy that failed (e.g., "roles.all", "attributes.conditions[0]") */
|
|
205
|
+
path: string;
|
|
206
|
+
/** Values that were required but missing */
|
|
207
|
+
missing?: string[];
|
|
208
|
+
/** Expected value */
|
|
209
|
+
expected?: unknown;
|
|
210
|
+
/** Actual value found */
|
|
211
|
+
actual?: unknown;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Result of evaluating an authorities policy.
|
|
215
|
+
*/
|
|
216
|
+
export interface AuthoritiesResult {
|
|
217
|
+
/** Whether access was granted */
|
|
218
|
+
granted: boolean;
|
|
219
|
+
/** Human-readable reason for denial (kept for backward compatibility) */
|
|
220
|
+
deniedBy?: string;
|
|
221
|
+
/** Structured denial data (machine-parsable) */
|
|
222
|
+
denial?: AuthoritiesDenial;
|
|
223
|
+
/** List of policy types that were evaluated (for audit) */
|
|
224
|
+
evaluatedPolicies: string[];
|
|
225
|
+
/** Optional detailed message */
|
|
226
|
+
message?: string;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Interface for resolving relationship-based access checks.
|
|
230
|
+
* Implement this to integrate with your authorization backend
|
|
231
|
+
* (e.g., SpiceDB, OpenFGA, custom DB queries).
|
|
232
|
+
*/
|
|
233
|
+
export interface RelationshipResolver {
|
|
234
|
+
/**
|
|
235
|
+
* Check if a user has a relationship to a resource.
|
|
236
|
+
*
|
|
237
|
+
* @param type - Relationship type (e.g., 'member', 'owner')
|
|
238
|
+
* @param resource - Resource type (e.g., 'site', 'org')
|
|
239
|
+
* @param resourceId - Resolved resource identifier
|
|
240
|
+
* @param userSub - User subject identifier
|
|
241
|
+
* @param ctx - Full evaluation context
|
|
242
|
+
*/
|
|
243
|
+
check(type: string, resource: string, resourceId: string, userSub: string, ctx: AuthoritiesEvaluationContext): Promise<boolean>;
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Context provided to the evaluation engine for policy checks.
|
|
247
|
+
* Built from AuthInfo + claimsMapping at request time.
|
|
248
|
+
*/
|
|
249
|
+
export interface AuthoritiesEvaluationContext {
|
|
250
|
+
/** Resolved user information */
|
|
251
|
+
user: {
|
|
252
|
+
/** User subject identifier */
|
|
253
|
+
sub: string;
|
|
254
|
+
/** User roles (extracted via claimsMapping) */
|
|
255
|
+
roles: string[];
|
|
256
|
+
/** User permissions (extracted via claimsMapping) */
|
|
257
|
+
permissions: string[];
|
|
258
|
+
/** Raw JWT claims */
|
|
259
|
+
claims: Record<string, unknown>;
|
|
260
|
+
};
|
|
261
|
+
/** Tool/prompt input arguments */
|
|
262
|
+
input: Record<string, unknown>;
|
|
263
|
+
/** Runtime environment variables */
|
|
264
|
+
env: Record<string, unknown>;
|
|
265
|
+
/** Relationship resolver for ReBAC checks */
|
|
266
|
+
relationships: RelationshipResolver;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Interface for custom authority evaluators.
|
|
270
|
+
* Register via `AuthoritiesPlugin.init({ evaluators: { ... } })`.
|
|
271
|
+
*
|
|
272
|
+
* @example
|
|
273
|
+
* ```typescript
|
|
274
|
+
* const ipAllowListEvaluator: AuthoritiesEvaluator = {
|
|
275
|
+
* name: 'ipAllowList',
|
|
276
|
+
* evaluate: async (policy, ctx) => {
|
|
277
|
+
* const { cidr } = policy as { cidr: string[] };
|
|
278
|
+
* const allowed = cidr.some(c => isInCidr(ctx.env.remoteIp, c));
|
|
279
|
+
* return { granted: allowed, evaluatedPolicies: ['custom.ipAllowList'] };
|
|
280
|
+
* },
|
|
281
|
+
* };
|
|
282
|
+
* ```
|
|
283
|
+
*/
|
|
284
|
+
export interface AuthoritiesEvaluator {
|
|
285
|
+
/** Evaluator name (must match the key under `custom.*` in policies) */
|
|
286
|
+
name: string;
|
|
287
|
+
/** Evaluate the policy against the context */
|
|
288
|
+
evaluate(policy: unknown, ctx: AuthoritiesEvaluationContext): Promise<AuthoritiesResult>;
|
|
289
|
+
}
|
|
290
|
+
//# sourceMappingURL=authorities.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authorities.types.d.ts","sourceRoot":"","sources":["../../src/authorities/authorities.types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC9B,wCAAwC;IACxC,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;IACf,iDAAiD;IACjD,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,8CAA8C;IAC9C,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;IACf,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C,uEAAuE;IACvE,IAAI,EAAE,MAAM,CAAC;IACb,8CAA8C;IAC9C,QAAQ,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,4BAA4B,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAC1F"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Authorities — Built-in RBAC/ABAC/ReBAC authorization for FrontMCP.
|
|
3
|
+
*
|
|
4
|
+
* Importing from this module activates global interface augmentation
|
|
5
|
+
* that adds the `authorities` field to all entry metadata types.
|
|
6
|
+
*/
|
|
7
|
+
import './authorities.metadata-augment';
|
|
8
|
+
export type { RbacRolesPolicy, RbacPermissionsPolicy, AbacOperator, AbacCondition, AbacPolicy, DynamicValueRef, ResourceIdRef, RebacPolicy, AuthoritiesPolicyMetadata, AuthorityProfileName, AuthoritiesMetadata, AuthoritiesDenial, AuthoritiesResult, RelationshipResolver, AuthoritiesEvaluationContext, AuthoritiesEvaluator, AuthorityGuardFn, } from './authorities.types';
|
|
9
|
+
export type { AuthoritiesClaimsMapping, AuthoritiesConfig, AuthoritiesScopeMapping } from './authorities.profiles';
|
|
10
|
+
export { resolveRequiredScopes } from './authorities.scope-mapping';
|
|
11
|
+
export { rbacRolesPolicySchema, rbacPermissionsPolicySchema, abacOperatorSchema, abacConditionSchema, abacPolicySchema, resourceIdRefSchema, rebacPolicySchema, authoritiesPolicySchema, authoritiesMetadataSchema, authoritiesClaimsMappingSchema, authoritiesConfigSchema, } from './authorities.schema';
|
|
12
|
+
export { AuthoritiesEngine } from './authorities.engine';
|
|
13
|
+
export { AuthoritiesContextBuilder } from './authorities.context';
|
|
14
|
+
export type { ClaimsResolverFn } from './authorities.context';
|
|
15
|
+
export { AuthoritiesEvaluatorRegistry, AuthoritiesProfileRegistry } from './authorities.registry';
|
|
16
|
+
export { AuthorityDeniedError } from './authorities.errors';
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/authorities/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,gCAAgC,CAAC;AAGxC,YAAY,EACV,eAAe,EACf,qBAAqB,EACrB,YAAY,EACZ,aAAa,EACb,UAAU,EACV,eAAe,EACf,aAAa,EACb,WAAW,EACX,yBAAyB,EACzB,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,oBAAoB,EACpB,4BAA4B,EAC5B,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAG7B,YAAY,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAGnH,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAGpE,OAAO,EACL,qBAAqB,EACrB,2BAA2B,EAC3B,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,EACvB,yBAAyB,EACzB,8BAA8B,EAC9B,uBAAuB,GACxB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAClE,YAAY,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAG9D,OAAO,EAAE,4BAA4B,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AAGlG,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { Authorization, AuthorizationCreateCtx, AuthorizedPrompt, AuthorizedTool, AuthUser, LLMSafeAuthContext, AuthMode } from './authorization.types';
|
|
2
|
-
import type { TransportSession, TransportProtocol } from '../session/transport-session.types';
|
|
3
1
|
import type { ProviderSnapshot } from '../session/session.types';
|
|
4
|
-
|
|
2
|
+
import type { TransportProtocol, TransportSession } from '../session/transport-session.types';
|
|
3
|
+
import type { AuthMode, Authorization, AuthorizationCreateCtx, AuthorizedPrompt, AuthorizedTool, AuthUser, LLMSafeAuthContext } from './authorization.types';
|
|
5
4
|
/**
|
|
6
5
|
* Base Authorization class - represents authenticated user context
|
|
7
6
|
* Subclasses implement mode-specific behavior (Public, Transparent, Orchestrated)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authorization.class.d.ts","sourceRoot":"","sources":["../../src/authorization/authorization.class.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"authorization.class.d.ts","sourceRoot":"","sources":["../../src/authorization/authorization.class.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAqB,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAEjH,OAAO,KAAK,EACV,QAAQ,EACR,aAAa,EACb,sBAAsB,EACtB,gBAAgB,EAChB,cAAc,EACd,QAAQ,EACR,kBAAkB,EACnB,MAAM,uBAAuB,CAAC;AAE/B;;;GAGG;AACH,8BAAsB,iBAAkB,YAAW,aAAa;;IAC9D,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACjC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC1C,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;IAC1B,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC/D,QAAQ,C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EG;IACH,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO;IAIvC;;OAEG;IACH,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO;IAItC;;OAEG;IACH,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAItC;;OAEG;IACH,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAI1C;;;;OAIG;IACH,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAIvC;;;;;OAKG;IACH,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM;IAI7D;;OAEG;IACH,SAAS,IAAI,OAAO;IAKpB;;;OAGG;IACH,eAAe,IAAI,MAAM,GAAG,SAAS;IAKrC;;;OAGG;IACH,YAAY,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM;IAY/C;;OAEG;IACH,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,GAAG,kBAAkB;IAgB/D;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,WAAW;IAW1B;;;OAGG;IACH,MAAM,CAAC,sBAAsB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI;CAiDnD"}
|
|
@@ -4,9 +4,8 @@
|
|
|
4
4
|
* Core types for authorization, user identity, and progressive auth.
|
|
5
5
|
* These types are portable and can be used across different implementations.
|
|
6
6
|
*/
|
|
7
|
-
import { z } from 'zod';
|
|
8
7
|
import type { ProviderSnapshot } from '../session/session.types';
|
|
9
|
-
import type {
|
|
8
|
+
import type { TransportProtocol, TransportSession } from '../session/transport-session.types';
|
|
10
9
|
/**
|
|
11
10
|
* Authentication mode determining how tokens are handled
|
|
12
11
|
*/
|
|
@@ -14,7 +13,7 @@ export type AuthMode = 'public' | 'transparent' | 'orchestrated';
|
|
|
14
13
|
/**
|
|
15
14
|
* Zod schema for AuthMode
|
|
16
15
|
*/
|
|
17
|
-
export declare const authModeSchema:
|
|
16
|
+
export declare const authModeSchema: import("@frontmcp/lazy-zod").ZodEnum<{
|
|
18
17
|
public: "public";
|
|
19
18
|
transparent: "transparent";
|
|
20
19
|
orchestrated: "orchestrated";
|
|
@@ -37,13 +36,13 @@ export interface AuthUser {
|
|
|
37
36
|
/**
|
|
38
37
|
* Zod schema for AuthUser
|
|
39
38
|
*/
|
|
40
|
-
export declare const authUserSchema:
|
|
41
|
-
sub:
|
|
42
|
-
name:
|
|
43
|
-
email:
|
|
44
|
-
picture:
|
|
45
|
-
anonymous:
|
|
46
|
-
},
|
|
39
|
+
export declare const authUserSchema: import("@frontmcp/lazy-zod").ZodObject<{
|
|
40
|
+
sub: import("@frontmcp/lazy-zod").ZodString;
|
|
41
|
+
name: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodString>;
|
|
42
|
+
email: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodString>;
|
|
43
|
+
picture: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodString>;
|
|
44
|
+
anonymous: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodBoolean>;
|
|
45
|
+
}, import("zod/v4/core").$strip>;
|
|
47
46
|
/**
|
|
48
47
|
* Authorized tool entry
|
|
49
48
|
*/
|
|
@@ -58,11 +57,11 @@ export interface AuthorizedTool {
|
|
|
58
57
|
/**
|
|
59
58
|
* Zod schema for AuthorizedTool
|
|
60
59
|
*/
|
|
61
|
-
export declare const authorizedToolSchema:
|
|
62
|
-
executionPath:
|
|
63
|
-
scopes:
|
|
64
|
-
details:
|
|
65
|
-
},
|
|
60
|
+
export declare const authorizedToolSchema: import("@frontmcp/lazy-zod").ZodObject<{
|
|
61
|
+
executionPath: import("@frontmcp/lazy-zod").ZodTuple<[import("@frontmcp/lazy-zod").ZodString, import("@frontmcp/lazy-zod").ZodString], null>;
|
|
62
|
+
scopes: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodArray<import("@frontmcp/lazy-zod").ZodString>>;
|
|
63
|
+
details: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodRecord<import("@frontmcp/lazy-zod").ZodString, import("@frontmcp/lazy-zod").ZodUnknown>>;
|
|
64
|
+
}, import("zod/v4/core").$strip>;
|
|
66
65
|
/**
|
|
67
66
|
* Authorized prompt entry
|
|
68
67
|
*/
|
|
@@ -77,11 +76,11 @@ export interface AuthorizedPrompt {
|
|
|
77
76
|
/**
|
|
78
77
|
* Zod schema for AuthorizedPrompt
|
|
79
78
|
*/
|
|
80
|
-
export declare const authorizedPromptSchema:
|
|
81
|
-
executionPath:
|
|
82
|
-
scopes:
|
|
83
|
-
details:
|
|
84
|
-
},
|
|
79
|
+
export declare const authorizedPromptSchema: import("@frontmcp/lazy-zod").ZodObject<{
|
|
80
|
+
executionPath: import("@frontmcp/lazy-zod").ZodTuple<[import("@frontmcp/lazy-zod").ZodString, import("@frontmcp/lazy-zod").ZodString], null>;
|
|
81
|
+
scopes: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodArray<import("@frontmcp/lazy-zod").ZodString>>;
|
|
82
|
+
details: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodRecord<import("@frontmcp/lazy-zod").ZodString, import("@frontmcp/lazy-zod").ZodUnknown>>;
|
|
83
|
+
}, import("zod/v4/core").$strip>;
|
|
85
84
|
/**
|
|
86
85
|
* LLM-safe session context (no tokens exposed)
|
|
87
86
|
*/
|
|
@@ -109,23 +108,23 @@ export interface LLMSafeAuthContext {
|
|
|
109
108
|
/**
|
|
110
109
|
* Zod schema for LLMSafeAuthContext
|
|
111
110
|
*/
|
|
112
|
-
export declare const llmSafeAuthContextSchema:
|
|
113
|
-
authorizationId:
|
|
114
|
-
sessionId:
|
|
115
|
-
mode:
|
|
111
|
+
export declare const llmSafeAuthContextSchema: import("@frontmcp/lazy-zod").ZodObject<{
|
|
112
|
+
authorizationId: import("@frontmcp/lazy-zod").ZodString;
|
|
113
|
+
sessionId: import("@frontmcp/lazy-zod").ZodString;
|
|
114
|
+
mode: import("@frontmcp/lazy-zod").ZodEnum<{
|
|
116
115
|
public: "public";
|
|
117
116
|
transparent: "transparent";
|
|
118
117
|
orchestrated: "orchestrated";
|
|
119
118
|
}>;
|
|
120
|
-
isAnonymous:
|
|
121
|
-
user:
|
|
122
|
-
sub:
|
|
123
|
-
name:
|
|
124
|
-
},
|
|
125
|
-
scopes:
|
|
126
|
-
authorizedToolIds:
|
|
127
|
-
authorizedPromptIds:
|
|
128
|
-
},
|
|
119
|
+
isAnonymous: import("@frontmcp/lazy-zod").ZodBoolean;
|
|
120
|
+
user: import("@frontmcp/lazy-zod").ZodObject<{
|
|
121
|
+
sub: import("@frontmcp/lazy-zod").ZodString;
|
|
122
|
+
name: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodString>;
|
|
123
|
+
}, import("zod/v4/core").$strip>;
|
|
124
|
+
scopes: import("@frontmcp/lazy-zod").ZodArray<import("@frontmcp/lazy-zod").ZodString>;
|
|
125
|
+
authorizedToolIds: import("@frontmcp/lazy-zod").ZodArray<import("@frontmcp/lazy-zod").ZodString>;
|
|
126
|
+
authorizedPromptIds: import("@frontmcp/lazy-zod").ZodArray<import("@frontmcp/lazy-zod").ZodString>;
|
|
127
|
+
}, import("zod/v4/core").$strip>;
|
|
129
128
|
/**
|
|
130
129
|
* State of app authorization within a session.
|
|
131
130
|
* Used for progressive authorization flow.
|
|
@@ -141,7 +140,7 @@ export declare enum AppAuthState {
|
|
|
141
140
|
/**
|
|
142
141
|
* Zod schema for AppAuthState enum
|
|
143
142
|
*/
|
|
144
|
-
export declare const appAuthStateSchema:
|
|
143
|
+
export declare const appAuthStateSchema: import("@frontmcp/lazy-zod").ZodEnum<typeof AppAuthState>;
|
|
145
144
|
/**
|
|
146
145
|
* App authorization record with state tracking.
|
|
147
146
|
* Stored server-side, NOT in JWT.
|
|
@@ -163,14 +162,14 @@ export interface AppAuthorizationRecord {
|
|
|
163
162
|
/**
|
|
164
163
|
* Zod schema for AppAuthorizationRecord
|
|
165
164
|
*/
|
|
166
|
-
export declare const appAuthorizationRecordSchema:
|
|
167
|
-
appId:
|
|
168
|
-
state:
|
|
169
|
-
stateChangedAt:
|
|
170
|
-
grantedScopes:
|
|
171
|
-
authProviderId:
|
|
172
|
-
toolIds:
|
|
173
|
-
},
|
|
165
|
+
export declare const appAuthorizationRecordSchema: import("@frontmcp/lazy-zod").ZodObject<{
|
|
166
|
+
appId: import("@frontmcp/lazy-zod").ZodString;
|
|
167
|
+
state: import("@frontmcp/lazy-zod").ZodEnum<typeof AppAuthState>;
|
|
168
|
+
stateChangedAt: import("@frontmcp/lazy-zod").ZodNumber;
|
|
169
|
+
grantedScopes: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodArray<import("@frontmcp/lazy-zod").ZodString>>;
|
|
170
|
+
authProviderId: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodString>;
|
|
171
|
+
toolIds: import("@frontmcp/lazy-zod").ZodArray<import("@frontmcp/lazy-zod").ZodString>;
|
|
172
|
+
}, import("zod/v4/core").$strip>;
|
|
174
173
|
/**
|
|
175
174
|
* Progressive auth session state.
|
|
176
175
|
* Tracks which apps are authorized, skipped, or pending.
|
|
@@ -187,18 +186,18 @@ export interface ProgressiveAuthState {
|
|
|
187
186
|
/**
|
|
188
187
|
* Zod schema for ProgressiveAuthState
|
|
189
188
|
*/
|
|
190
|
-
export declare const progressiveAuthStateSchema:
|
|
191
|
-
apps:
|
|
192
|
-
appId:
|
|
193
|
-
state:
|
|
194
|
-
stateChangedAt:
|
|
195
|
-
grantedScopes:
|
|
196
|
-
authProviderId:
|
|
197
|
-
toolIds:
|
|
198
|
-
},
|
|
199
|
-
initiallyAuthorized:
|
|
200
|
-
initiallySkipped:
|
|
201
|
-
},
|
|
189
|
+
export declare const progressiveAuthStateSchema: import("@frontmcp/lazy-zod").ZodObject<{
|
|
190
|
+
apps: import("@frontmcp/lazy-zod").ZodRecord<import("@frontmcp/lazy-zod").ZodString, import("@frontmcp/lazy-zod").ZodObject<{
|
|
191
|
+
appId: import("@frontmcp/lazy-zod").ZodString;
|
|
192
|
+
state: import("@frontmcp/lazy-zod").ZodEnum<typeof AppAuthState>;
|
|
193
|
+
stateChangedAt: import("@frontmcp/lazy-zod").ZodNumber;
|
|
194
|
+
grantedScopes: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodArray<import("@frontmcp/lazy-zod").ZodString>>;
|
|
195
|
+
authProviderId: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodString>;
|
|
196
|
+
toolIds: import("@frontmcp/lazy-zod").ZodArray<import("@frontmcp/lazy-zod").ZodString>;
|
|
197
|
+
}, import("zod/v4/core").$strip>>;
|
|
198
|
+
initiallyAuthorized: import("@frontmcp/lazy-zod").ZodArray<import("@frontmcp/lazy-zod").ZodString>;
|
|
199
|
+
initiallySkipped: import("@frontmcp/lazy-zod").ZodArray<import("@frontmcp/lazy-zod").ZodString>;
|
|
200
|
+
}, import("zod/v4/core").$strip>;
|
|
202
201
|
/**
|
|
203
202
|
* Context for creating an authorization
|
|
204
203
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authorization.types.d.ts","sourceRoot":"","sources":["../../src/authorization/authorization.types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"authorization.types.d.ts","sourceRoot":"","sources":["../../src/authorization/authorization.types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAM9F;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,aAAa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AC1D,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC/C,4DAA4D;IAC5D,sBAAsB,CAAC,QAAQ,EAAE,iBAAiB,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,gBAAgB,CAAC;IAC5F,2CAA2C;IAC3C,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS,CAAC;IACrE,kCAAkC;IAClC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;IACjC,sCAAsC;IACtC,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IACxC,oCAAoC;IACpC,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IACvC,oCAAoC;IACpC,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;IACvC,sCAAsC;IACtC,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5C"}
|
package/authorization/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
export type { AuthMode, AuthUser, AuthorizedTool, AuthorizedPrompt, LLMSafeAuthContext, AppAuthorizationRecord, ProgressiveAuthState, AuthorizationCreateCtx, Authorization, } from './authorization.types';
|
|
7
7
|
export { AppAuthState } from './authorization.types';
|
|
8
8
|
export { authModeSchema, authUserSchema, authorizedToolSchema, authorizedPromptSchema, llmSafeAuthContextSchema, appAuthStateSchema, appAuthorizationRecordSchema, progressiveAuthStateSchema, } from './authorization.types';
|
|
9
|
-
export { AuthorizationBase
|
|
9
|
+
export { AuthorizationBase } from './authorization.class';
|
|
10
10
|
export { PublicAuthorization } from './public.authorization';
|
|
11
11
|
export type { PublicAuthorizationCreateCtx } from './public.authorization';
|
|
12
12
|
export { TransparentAuthorization } from './transparent.authorization';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/authorization/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,YAAY,EACV,QAAQ,EACR,QAAQ,EACR,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACpB,sBAAsB,EACtB,aAAa,GACd,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGrD,OAAO,EACL,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,sBAAsB,EACtB,wBAAwB,EACxB,kBAAkB,EAClB,4BAA4B,EAC5B,0BAA0B,GAC3B,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/authorization/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,YAAY,EACV,QAAQ,EACR,QAAQ,EACR,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACpB,sBAAsB,EACtB,aAAa,GACd,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGrD,OAAO,EACL,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,sBAAsB,EACtB,wBAAwB,EACxB,kBAAkB,EAClB,4BAA4B,EAC5B,0BAA0B,GAC3B,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,YAAY,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAE3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACvE,YAAY,EAAE,iCAAiC,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AAEjH,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;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