@aws/agentcore 0.3.0-preview.8.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/__tests__/__snapshots__/assets.snapshot.test.ts.snap +8 -337
- package/dist/assets/agents/AGENTS.md +1 -2
- package/dist/assets/cdk/test/cdk.test.ts +2 -1
- package/dist/assets/python/http/langchain_langgraph/base/main.py +4 -1
- package/dist/assets/python/http/langchain_langgraph/base/pyproject.toml +1 -2
- package/dist/cli/index.mjs +352 -337
- package/dist/lib/packaging/index.js +3 -3
- package/dist/lib/packaging/index.js.map +1 -1
- package/dist/lib/packaging/python.js +1 -1
- package/dist/lib/schemas/io/config-io.d.ts +11 -3
- package/dist/lib/schemas/io/config-io.d.ts.map +1 -1
- package/dist/lib/schemas/io/config-io.js +14 -3
- package/dist/lib/schemas/io/config-io.js.map +1 -1
- package/dist/lib/schemas/io/index.d.ts +1 -1
- package/dist/lib/schemas/io/index.d.ts.map +1 -1
- package/dist/lib/schemas/io/index.js +2 -1
- package/dist/lib/schemas/io/index.js.map +1 -1
- package/dist/schema/constants.d.ts +0 -1
- package/dist/schema/constants.d.ts.map +1 -1
- package/dist/schema/constants.js +2 -5
- package/dist/schema/constants.js.map +1 -1
- package/dist/schema/schemas/agent-env.d.ts +47 -7
- package/dist/schema/schemas/agent-env.d.ts.map +1 -1
- package/dist/schema/schemas/agent-env.js +50 -4
- package/dist/schema/schemas/agent-env.js.map +1 -1
- package/dist/schema/schemas/agentcore-project.d.ts +61 -27
- package/dist/schema/schemas/agentcore-project.d.ts.map +1 -1
- package/dist/schema/schemas/agentcore-project.js +24 -14
- package/dist/schema/schemas/agentcore-project.js.map +1 -1
- package/dist/schema/schemas/auth.d.ts +140 -0
- package/dist/schema/schemas/auth.d.ts.map +1 -0
- package/dist/schema/schemas/auth.js +114 -0
- package/dist/schema/schemas/auth.js.map +1 -0
- package/dist/schema/schemas/deployed-state.d.ts +4 -4
- package/dist/schema/schemas/deployed-state.js +3 -3
- package/dist/schema/schemas/deployed-state.js.map +1 -1
- package/dist/schema/schemas/index.d.ts +1 -0
- package/dist/schema/schemas/index.d.ts.map +1 -1
- package/dist/schema/schemas/index.js +1 -0
- package/dist/schema/schemas/index.js.map +1 -1
- package/dist/schema/schemas/mcp.d.ts +4 -107
- package/dist/schema/schemas/mcp.d.ts.map +1 -1
- package/dist/schema/schemas/mcp.js +9 -108
- package/dist/schema/schemas/mcp.js.map +1 -1
- package/dist/schema/schemas/primitives/index.d.ts +1 -1
- package/dist/schema/schemas/primitives/index.d.ts.map +1 -1
- package/dist/schema/schemas/primitives/index.js +2 -1
- package/dist/schema/schemas/primitives/index.js.map +1 -1
- package/dist/schema/schemas/primitives/memory.d.ts +9 -0
- package/dist/schema/schemas/primitives/memory.d.ts.map +1 -1
- package/dist/schema/schemas/primitives/memory.js +26 -3
- package/dist/schema/schemas/primitives/memory.js.map +1 -1
- package/dist/schema/schemas/primitives/online-eval-config.d.ts +0 -1
- package/dist/schema/schemas/primitives/online-eval-config.d.ts.map +1 -1
- package/dist/schema/schemas/primitives/online-eval-config.js +0 -1
- package/dist/schema/schemas/primitives/online-eval-config.js.map +1 -1
- package/package.json +4 -1
- package/scripts/generate-schema.mjs +40 -0
- package/dist/assets/python/http/crewai/base/README.md +0 -39
- package/dist/assets/python/http/crewai/base/gitignore.template +0 -41
- package/dist/assets/python/http/crewai/base/main.py +0 -55
- package/dist/assets/python/http/crewai/base/model/__init__.py +0 -1
- package/dist/assets/python/http/crewai/base/model/load.py +0 -133
- package/dist/assets/python/http/crewai/base/pyproject.toml +0 -31
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { EvaluationLevelSchema } from './primitives/evaluator';
|
|
2
|
-
import { DEFAULT_STRATEGY_NAMESPACES, MemoryStrategySchema, MemoryStrategyTypeSchema } from './primitives/memory';
|
|
2
|
+
import { DEFAULT_EPISODIC_REFLECTION_NAMESPACES, DEFAULT_STRATEGY_NAMESPACES, MemoryStrategySchema, MemoryStrategyTypeSchema } from './primitives/memory';
|
|
3
3
|
import { PolicyEngineSchema } from './primitives/policy';
|
|
4
4
|
import { TagsSchema } from './primitives/tags';
|
|
5
5
|
import { z } from 'zod';
|
|
6
|
-
export { DEFAULT_STRATEGY_NAMESPACES, MemoryStrategySchema, MemoryStrategyTypeSchema };
|
|
6
|
+
export { DEFAULT_EPISODIC_REFLECTION_NAMESPACES, DEFAULT_STRATEGY_NAMESPACES, MemoryStrategySchema, MemoryStrategyTypeSchema, };
|
|
7
7
|
export { EvaluationLevelSchema };
|
|
8
8
|
export type { MemoryStrategy, MemoryStrategyType } from './primitives/memory';
|
|
9
9
|
export type { OnlineEvalConfig } from './primitives/online-eval-config';
|
|
@@ -15,6 +15,10 @@ export type { Policy, PolicyEngine, ValidationMode } from './primitives/policy';
|
|
|
15
15
|
export { PolicyEngineNameSchema, PolicyNameSchema, PolicySchema, ValidationModeSchema } from './primitives/policy';
|
|
16
16
|
export { TagsSchema };
|
|
17
17
|
export type { Tags } from './primitives/tags';
|
|
18
|
+
export declare const ManagedBySchema: z.ZodDefault<z.ZodEnum<{
|
|
19
|
+
CDK: "CDK";
|
|
20
|
+
}>>;
|
|
21
|
+
export type ManagedBy = z.infer<typeof ManagedBySchema>;
|
|
18
22
|
export type { AgentCoreGateway, AgentCoreGatewayTarget, AgentCoreMcpRuntimeTool } from './mcp';
|
|
19
23
|
export { AgentCoreGatewaySchema, AgentCoreGatewayTargetSchema, AgentCoreMcpRuntimeToolSchema } from './mcp';
|
|
20
24
|
export declare const ProjectNameSchema: z.ZodString;
|
|
@@ -22,7 +26,6 @@ export declare const MemoryTypeSchema: z.ZodLiteral<"AgentCoreMemory">;
|
|
|
22
26
|
export type MemoryType = z.infer<typeof MemoryTypeSchema>;
|
|
23
27
|
export declare const MemoryNameSchema: z.ZodString;
|
|
24
28
|
export declare const MemorySchema: z.ZodObject<{
|
|
25
|
-
type: z.ZodLiteral<"AgentCoreMemory">;
|
|
26
29
|
name: z.ZodString;
|
|
27
30
|
eventExpiryDuration: z.ZodNumber;
|
|
28
31
|
strategies: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
@@ -30,10 +33,12 @@ export declare const MemorySchema: z.ZodObject<{
|
|
|
30
33
|
SEMANTIC: "SEMANTIC";
|
|
31
34
|
SUMMARIZATION: "SUMMARIZATION";
|
|
32
35
|
USER_PREFERENCE: "USER_PREFERENCE";
|
|
36
|
+
EPISODIC: "EPISODIC";
|
|
33
37
|
}>;
|
|
34
38
|
name: z.ZodOptional<z.ZodString>;
|
|
35
39
|
description: z.ZodOptional<z.ZodString>;
|
|
36
40
|
namespaces: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
41
|
+
reflectionNamespaces: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
37
42
|
}, z.core.$strip>>>;
|
|
38
43
|
tags: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
39
44
|
}, z.core.$strip>;
|
|
@@ -45,14 +50,14 @@ export declare const CredentialTypeSchema: z.ZodEnum<{
|
|
|
45
50
|
}>;
|
|
46
51
|
export type CredentialType = z.infer<typeof CredentialTypeSchema>;
|
|
47
52
|
export declare const ApiKeyCredentialSchema: z.ZodObject<{
|
|
48
|
-
|
|
53
|
+
authorizerType: z.ZodLiteral<"ApiKeyCredentialProvider">;
|
|
49
54
|
name: z.ZodString;
|
|
50
55
|
}, z.core.$strip>;
|
|
51
56
|
export type ApiKeyCredential = z.infer<typeof ApiKeyCredentialSchema>;
|
|
52
57
|
export declare const OAuthCredentialSchema: z.ZodObject<{
|
|
53
|
-
|
|
58
|
+
authorizerType: z.ZodLiteral<"OAuthCredentialProvider">;
|
|
54
59
|
name: z.ZodString;
|
|
55
|
-
discoveryUrl: z.ZodString
|
|
60
|
+
discoveryUrl: z.ZodOptional<z.ZodString>;
|
|
56
61
|
scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
57
62
|
vendor: z.ZodDefault<z.ZodString>;
|
|
58
63
|
managed: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -63,12 +68,12 @@ export declare const OAuthCredentialSchema: z.ZodObject<{
|
|
|
63
68
|
}, z.core.$strip>;
|
|
64
69
|
export type OAuthCredential = z.infer<typeof OAuthCredentialSchema>;
|
|
65
70
|
export declare const CredentialSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
66
|
-
|
|
71
|
+
authorizerType: z.ZodLiteral<"ApiKeyCredentialProvider">;
|
|
67
72
|
name: z.ZodString;
|
|
68
73
|
}, z.core.$strip>, z.ZodObject<{
|
|
69
|
-
|
|
74
|
+
authorizerType: z.ZodLiteral<"OAuthCredentialProvider">;
|
|
70
75
|
name: z.ZodString;
|
|
71
|
-
discoveryUrl: z.ZodString
|
|
76
|
+
discoveryUrl: z.ZodOptional<z.ZodString>;
|
|
72
77
|
scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
73
78
|
vendor: z.ZodDefault<z.ZodString>;
|
|
74
79
|
managed: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -76,12 +81,11 @@ export declare const CredentialSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
76
81
|
inbound: "inbound";
|
|
77
82
|
outbound: "outbound";
|
|
78
83
|
}>>;
|
|
79
|
-
}, z.core.$strip>], "
|
|
84
|
+
}, z.core.$strip>], "authorizerType">;
|
|
80
85
|
export type Credential = z.infer<typeof CredentialSchema>;
|
|
81
86
|
export declare const EvaluatorTypeSchema: z.ZodLiteral<"CustomEvaluator">;
|
|
82
87
|
export type EvaluatorType = z.infer<typeof EvaluatorTypeSchema>;
|
|
83
88
|
export declare const EvaluatorSchema: z.ZodObject<{
|
|
84
|
-
type: z.ZodLiteral<"CustomEvaluator">;
|
|
85
89
|
name: z.ZodString;
|
|
86
90
|
level: z.ZodEnum<{
|
|
87
91
|
SESSION: "SESSION";
|
|
@@ -110,11 +114,14 @@ export declare const EvaluatorSchema: z.ZodObject<{
|
|
|
110
114
|
}, z.core.$strip>;
|
|
111
115
|
export type Evaluator = z.infer<typeof EvaluatorSchema>;
|
|
112
116
|
export declare const AgentCoreProjectSpecSchema: z.ZodObject<{
|
|
117
|
+
$schema: z.ZodOptional<z.ZodString>;
|
|
113
118
|
name: z.ZodString;
|
|
114
119
|
version: z.ZodNumber;
|
|
120
|
+
managedBy: z.ZodDefault<z.ZodEnum<{
|
|
121
|
+
CDK: "CDK";
|
|
122
|
+
}>>;
|
|
115
123
|
tags: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
116
|
-
|
|
117
|
-
type: z.ZodLiteral<"AgentCoreRuntime">;
|
|
124
|
+
runtimes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
118
125
|
name: z.ZodString;
|
|
119
126
|
build: z.ZodEnum<{
|
|
120
127
|
CodeZip: "CodeZip";
|
|
@@ -147,22 +154,49 @@ export declare const AgentCoreProjectSpecSchema: z.ZodObject<{
|
|
|
147
154
|
instrumentation: z.ZodOptional<z.ZodObject<{
|
|
148
155
|
enableOtel: z.ZodDefault<z.ZodBoolean>;
|
|
149
156
|
}, z.core.$strip>>;
|
|
150
|
-
modelProvider: z.ZodOptional<z.ZodEnum<{
|
|
151
|
-
Bedrock: "Bedrock";
|
|
152
|
-
Gemini: "Gemini";
|
|
153
|
-
OpenAI: "OpenAI";
|
|
154
|
-
Anthropic: "Anthropic";
|
|
155
|
-
}>>;
|
|
156
157
|
protocol: z.ZodOptional<z.ZodEnum<{
|
|
157
158
|
HTTP: "HTTP";
|
|
158
159
|
MCP: "MCP";
|
|
159
160
|
A2A: "A2A";
|
|
160
161
|
}>>;
|
|
161
162
|
requestHeaderAllowlist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
163
|
+
authorizerType: z.ZodOptional<z.ZodEnum<{
|
|
164
|
+
AWS_IAM: "AWS_IAM";
|
|
165
|
+
CUSTOM_JWT: "CUSTOM_JWT";
|
|
166
|
+
}>>;
|
|
167
|
+
authorizerConfiguration: z.ZodOptional<z.ZodObject<{
|
|
168
|
+
customJwtAuthorizer: z.ZodOptional<z.ZodObject<{
|
|
169
|
+
discoveryUrl: z.ZodString;
|
|
170
|
+
allowedAudience: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
171
|
+
allowedClients: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
172
|
+
allowedScopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
173
|
+
customClaims: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
174
|
+
inboundTokenClaimName: z.ZodString;
|
|
175
|
+
inboundTokenClaimValueType: z.ZodEnum<{
|
|
176
|
+
STRING: "STRING";
|
|
177
|
+
STRING_ARRAY: "STRING_ARRAY";
|
|
178
|
+
}>;
|
|
179
|
+
authorizingClaimMatchValue: z.ZodObject<{
|
|
180
|
+
claimMatchOperator: z.ZodEnum<{
|
|
181
|
+
EQUALS: "EQUALS";
|
|
182
|
+
CONTAINS: "CONTAINS";
|
|
183
|
+
CONTAINS_ANY: "CONTAINS_ANY";
|
|
184
|
+
}>;
|
|
185
|
+
claimMatchValue: z.ZodObject<{
|
|
186
|
+
matchValueString: z.ZodOptional<z.ZodString>;
|
|
187
|
+
matchValueStringList: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
188
|
+
}, z.core.$strip>;
|
|
189
|
+
}, z.core.$strip>;
|
|
190
|
+
}, z.core.$strict>>>;
|
|
191
|
+
}, z.core.$strict>>;
|
|
192
|
+
}, z.core.$strip>>;
|
|
162
193
|
tags: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
194
|
+
lifecycleConfiguration: z.ZodOptional<z.ZodObject<{
|
|
195
|
+
idleRuntimeSessionTimeout: z.ZodOptional<z.ZodNumber>;
|
|
196
|
+
maxLifetime: z.ZodOptional<z.ZodNumber>;
|
|
197
|
+
}, z.core.$strip>>;
|
|
163
198
|
}, z.core.$strip>>>;
|
|
164
199
|
memories: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
165
|
-
type: z.ZodLiteral<"AgentCoreMemory">;
|
|
166
200
|
name: z.ZodString;
|
|
167
201
|
eventExpiryDuration: z.ZodNumber;
|
|
168
202
|
strategies: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
@@ -170,20 +204,22 @@ export declare const AgentCoreProjectSpecSchema: z.ZodObject<{
|
|
|
170
204
|
SEMANTIC: "SEMANTIC";
|
|
171
205
|
SUMMARIZATION: "SUMMARIZATION";
|
|
172
206
|
USER_PREFERENCE: "USER_PREFERENCE";
|
|
207
|
+
EPISODIC: "EPISODIC";
|
|
173
208
|
}>;
|
|
174
209
|
name: z.ZodOptional<z.ZodString>;
|
|
175
210
|
description: z.ZodOptional<z.ZodString>;
|
|
176
211
|
namespaces: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
212
|
+
reflectionNamespaces: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
177
213
|
}, z.core.$strip>>>;
|
|
178
214
|
tags: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
179
215
|
}, z.core.$strip>>>;
|
|
180
216
|
credentials: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
181
|
-
|
|
217
|
+
authorizerType: z.ZodLiteral<"ApiKeyCredentialProvider">;
|
|
182
218
|
name: z.ZodString;
|
|
183
219
|
}, z.core.$strip>, z.ZodObject<{
|
|
184
|
-
|
|
220
|
+
authorizerType: z.ZodLiteral<"OAuthCredentialProvider">;
|
|
185
221
|
name: z.ZodString;
|
|
186
|
-
discoveryUrl: z.ZodString
|
|
222
|
+
discoveryUrl: z.ZodOptional<z.ZodString>;
|
|
187
223
|
scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
188
224
|
vendor: z.ZodDefault<z.ZodString>;
|
|
189
225
|
managed: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -191,9 +227,8 @@ export declare const AgentCoreProjectSpecSchema: z.ZodObject<{
|
|
|
191
227
|
inbound: "inbound";
|
|
192
228
|
outbound: "outbound";
|
|
193
229
|
}>>;
|
|
194
|
-
}, z.core.$strip>], "
|
|
230
|
+
}, z.core.$strip>], "authorizerType">>>;
|
|
195
231
|
evaluators: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
196
|
-
type: z.ZodLiteral<"CustomEvaluator">;
|
|
197
232
|
name: z.ZodString;
|
|
198
233
|
level: z.ZodEnum<{
|
|
199
234
|
SESSION: "SESSION";
|
|
@@ -221,7 +256,6 @@ export declare const AgentCoreProjectSpecSchema: z.ZodObject<{
|
|
|
221
256
|
tags: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
222
257
|
}, z.core.$strip>>>;
|
|
223
258
|
onlineEvalConfigs: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
224
|
-
type: z.ZodLiteral<"OnlineEvaluationConfig">;
|
|
225
259
|
name: z.ZodString;
|
|
226
260
|
agent: z.ZodString;
|
|
227
261
|
evaluators: z.ZodArray<z.ZodString>;
|
|
@@ -457,7 +491,7 @@ export declare const AgentCoreProjectSpecSchema: z.ZodObject<{
|
|
|
457
491
|
}, z.core.$loose>>;
|
|
458
492
|
}, z.core.$strict>;
|
|
459
493
|
bindings: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
460
|
-
|
|
494
|
+
runtimeName: z.ZodString;
|
|
461
495
|
envVarName: z.ZodString;
|
|
462
496
|
}, z.core.$strict>>>;
|
|
463
497
|
}, z.core.$strict>>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentcore-project.d.ts","sourceRoot":"","sources":["../../../src/schema/schemas/agentcore-project.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,qBAAqB,EAA8C,MAAM,wBAAwB,CAAC;AAC3G,OAAO,
|
|
1
|
+
{"version":3,"file":"agentcore-project.d.ts","sourceRoot":"","sources":["../../../src/schema/schemas/agentcore-project.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,qBAAqB,EAA8C,MAAM,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CAAC,OAAO,eAAe,CAAC,CAAC;AASxD,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA+HnC,CAAC;AAEL,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AgentCoreProjectSpecSchema = exports.EvaluatorSchema = exports.EvaluatorTypeSchema = exports.CredentialSchema = exports.OAuthCredentialSchema = exports.ApiKeyCredentialSchema = exports.CredentialTypeSchema = exports.CredentialNameSchema = exports.MemorySchema = exports.MemoryNameSchema = exports.MemoryTypeSchema = exports.ProjectNameSchema = exports.AgentCoreMcpRuntimeToolSchema = exports.AgentCoreGatewayTargetSchema = exports.AgentCoreGatewaySchema = exports.TagsSchema = exports.ValidationModeSchema = exports.PolicySchema = exports.PolicyNameSchema = exports.PolicyEngineNameSchema = exports.PolicyEngineSchema = exports.EvaluatorNameSchema = exports.isValidBedrockModelId = exports.BedrockModelIdSchema = exports.OnlineEvalConfigNameSchema = exports.OnlineEvalConfigSchema = exports.EvaluationLevelSchema = exports.MemoryStrategyTypeSchema = exports.MemoryStrategySchema = exports.DEFAULT_STRATEGY_NAMESPACES = void 0;
|
|
3
|
+
exports.AgentCoreProjectSpecSchema = exports.EvaluatorSchema = exports.EvaluatorTypeSchema = exports.CredentialSchema = exports.OAuthCredentialSchema = exports.ApiKeyCredentialSchema = exports.CredentialTypeSchema = exports.CredentialNameSchema = exports.MemorySchema = exports.MemoryNameSchema = exports.MemoryTypeSchema = exports.ProjectNameSchema = exports.AgentCoreMcpRuntimeToolSchema = exports.AgentCoreGatewayTargetSchema = exports.AgentCoreGatewaySchema = exports.ManagedBySchema = exports.TagsSchema = exports.ValidationModeSchema = exports.PolicySchema = exports.PolicyNameSchema = exports.PolicyEngineNameSchema = exports.PolicyEngineSchema = exports.EvaluatorNameSchema = exports.isValidBedrockModelId = exports.BedrockModelIdSchema = exports.OnlineEvalConfigNameSchema = exports.OnlineEvalConfigSchema = exports.EvaluationLevelSchema = exports.MemoryStrategyTypeSchema = exports.MemoryStrategySchema = exports.DEFAULT_STRATEGY_NAMESPACES = exports.DEFAULT_EPISODIC_REFLECTION_NAMESPACES = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* AgentCore Project Schema - Resource-centric model
|
|
6
6
|
*
|
|
@@ -15,6 +15,7 @@ const mcp_1 = require("./mcp");
|
|
|
15
15
|
const evaluator_1 = require("./primitives/evaluator");
|
|
16
16
|
Object.defineProperty(exports, "EvaluationLevelSchema", { enumerable: true, get: function () { return evaluator_1.EvaluationLevelSchema; } });
|
|
17
17
|
const memory_1 = require("./primitives/memory");
|
|
18
|
+
Object.defineProperty(exports, "DEFAULT_EPISODIC_REFLECTION_NAMESPACES", { enumerable: true, get: function () { return memory_1.DEFAULT_EPISODIC_REFLECTION_NAMESPACES; } });
|
|
18
19
|
Object.defineProperty(exports, "DEFAULT_STRATEGY_NAMESPACES", { enumerable: true, get: function () { return memory_1.DEFAULT_STRATEGY_NAMESPACES; } });
|
|
19
20
|
Object.defineProperty(exports, "MemoryStrategySchema", { enumerable: true, get: function () { return memory_1.MemoryStrategySchema; } });
|
|
20
21
|
Object.defineProperty(exports, "MemoryStrategyTypeSchema", { enumerable: true, get: function () { return memory_1.MemoryStrategyTypeSchema; } });
|
|
@@ -37,6 +38,10 @@ Object.defineProperty(exports, "PolicyEngineNameSchema", { enumerable: true, get
|
|
|
37
38
|
Object.defineProperty(exports, "PolicyNameSchema", { enumerable: true, get: function () { return policy_2.PolicyNameSchema; } });
|
|
38
39
|
Object.defineProperty(exports, "PolicySchema", { enumerable: true, get: function () { return policy_2.PolicySchema; } });
|
|
39
40
|
Object.defineProperty(exports, "ValidationModeSchema", { enumerable: true, get: function () { return policy_2.ValidationModeSchema; } });
|
|
41
|
+
// ============================================================================
|
|
42
|
+
// ManagedBy Schema
|
|
43
|
+
// ============================================================================
|
|
44
|
+
exports.ManagedBySchema = zod_1.z.enum(['CDK']).default('CDK');
|
|
40
45
|
var mcp_2 = require("./mcp");
|
|
41
46
|
Object.defineProperty(exports, "AgentCoreGatewaySchema", { enumerable: true, get: function () { return mcp_2.AgentCoreGatewaySchema; } });
|
|
42
47
|
Object.defineProperty(exports, "AgentCoreGatewayTargetSchema", { enumerable: true, get: function () { return mcp_2.AgentCoreGatewayTargetSchema; } });
|
|
@@ -44,6 +49,8 @@ Object.defineProperty(exports, "AgentCoreMcpRuntimeToolSchema", { enumerable: tr
|
|
|
44
49
|
// ============================================================================
|
|
45
50
|
// Project Name Schema
|
|
46
51
|
// ============================================================================
|
|
52
|
+
// Project name is a CLI-only concept (combined with agent name to form the runtime name).
|
|
53
|
+
// Max 23 so that projectName + "_" + agentName fits within the 48-char runtime name limit.
|
|
47
54
|
exports.ProjectNameSchema = zod_1.z
|
|
48
55
|
.string()
|
|
49
56
|
.min(1, 'Project name is required')
|
|
@@ -56,13 +63,14 @@ exports.ProjectNameSchema = zod_1.z
|
|
|
56
63
|
// Memory Schema
|
|
57
64
|
// ============================================================================
|
|
58
65
|
exports.MemoryTypeSchema = zod_1.z.literal('AgentCoreMemory');
|
|
66
|
+
// Memory names follow the same constraints as agent runtime names.
|
|
67
|
+
// https://docs.aws.amazon.com/bedrock-agentcore-control/latest/APIReference/API_CreateMemory.html
|
|
59
68
|
exports.MemoryNameSchema = zod_1.z
|
|
60
69
|
.string()
|
|
61
70
|
.min(1, 'Name is required')
|
|
62
71
|
.max(48)
|
|
63
72
|
.regex(/^[a-zA-Z][a-zA-Z0-9_]{0,47}$/, 'Must begin with a letter and contain only alphanumeric characters and underscores (max 48 chars)');
|
|
64
73
|
exports.MemorySchema = zod_1.z.object({
|
|
65
|
-
type: exports.MemoryTypeSchema,
|
|
66
74
|
name: exports.MemoryNameSchema,
|
|
67
75
|
eventExpiryDuration: zod_1.z.number().int().min(7).max(365),
|
|
68
76
|
// Strategies array can be empty for short-term memory (just base memory with expiration)
|
|
@@ -76,21 +84,22 @@ exports.MemorySchema = zod_1.z.object({
|
|
|
76
84
|
// ============================================================================
|
|
77
85
|
// Credential Schema
|
|
78
86
|
// ============================================================================
|
|
87
|
+
// https://docs.aws.amazon.com/bedrock-agentcore-control/latest/APIReference/API_CreateApiKeyCredentialProvider.html
|
|
79
88
|
exports.CredentialNameSchema = zod_1.z
|
|
80
89
|
.string()
|
|
81
|
-
.min(
|
|
82
|
-
.max(
|
|
83
|
-
.regex(/^[
|
|
90
|
+
.min(1, 'Credential name is required')
|
|
91
|
+
.max(128, 'Credential name must be 128 characters or less')
|
|
92
|
+
.regex(/^[a-zA-Z0-9\-_]+$/, 'Must contain only alphanumeric characters, hyphens, and underscores (1-128 chars)');
|
|
84
93
|
exports.CredentialTypeSchema = zod_1.z.enum(['ApiKeyCredentialProvider', 'OAuthCredentialProvider']);
|
|
85
94
|
exports.ApiKeyCredentialSchema = zod_1.z.object({
|
|
86
|
-
|
|
95
|
+
authorizerType: zod_1.z.literal('ApiKeyCredentialProvider'),
|
|
87
96
|
name: exports.CredentialNameSchema,
|
|
88
97
|
});
|
|
89
98
|
exports.OAuthCredentialSchema = zod_1.z.object({
|
|
90
|
-
|
|
99
|
+
authorizerType: zod_1.z.literal('OAuthCredentialProvider'),
|
|
91
100
|
name: exports.CredentialNameSchema,
|
|
92
|
-
/** OIDC discovery URL for the OAuth provider */
|
|
93
|
-
discoveryUrl: zod_1.z.string().url(),
|
|
101
|
+
/** OIDC discovery URL for the OAuth provider (optional for imported providers that already exist in Identity service) */
|
|
102
|
+
discoveryUrl: zod_1.z.string().url().optional(),
|
|
94
103
|
/** Scopes this credential provider supports */
|
|
95
104
|
scopes: zod_1.z.array(zod_1.z.string()).optional(),
|
|
96
105
|
/** Credential provider vendor type */
|
|
@@ -100,13 +109,12 @@ exports.OAuthCredentialSchema = zod_1.z.object({
|
|
|
100
109
|
/** Whether this credential is used for inbound or outbound auth */
|
|
101
110
|
usage: zod_1.z.enum(['inbound', 'outbound']).optional(),
|
|
102
111
|
});
|
|
103
|
-
exports.CredentialSchema = zod_1.z.discriminatedUnion('
|
|
112
|
+
exports.CredentialSchema = zod_1.z.discriminatedUnion('authorizerType', [exports.ApiKeyCredentialSchema, exports.OAuthCredentialSchema]);
|
|
104
113
|
// ============================================================================
|
|
105
114
|
// Evaluator Schema
|
|
106
115
|
// ============================================================================
|
|
107
116
|
exports.EvaluatorTypeSchema = zod_1.z.literal('CustomEvaluator');
|
|
108
117
|
exports.EvaluatorSchema = zod_1.z.object({
|
|
109
|
-
type: exports.EvaluatorTypeSchema,
|
|
110
118
|
name: evaluator_1.EvaluatorNameSchema,
|
|
111
119
|
level: evaluator_1.EvaluationLevelSchema,
|
|
112
120
|
description: zod_1.z.string().optional(),
|
|
@@ -120,10 +128,12 @@ const BUILTIN_EVALUATOR_PREFIX = 'Builtin.';
|
|
|
120
128
|
const ARN_PREFIX = 'arn:';
|
|
121
129
|
exports.AgentCoreProjectSpecSchema = zod_1.z
|
|
122
130
|
.object({
|
|
131
|
+
$schema: zod_1.z.string().optional(),
|
|
123
132
|
name: exports.ProjectNameSchema,
|
|
124
|
-
version: zod_1.z.number().int(),
|
|
133
|
+
version: zod_1.z.number().int().min(1),
|
|
134
|
+
managedBy: exports.ManagedBySchema,
|
|
125
135
|
tags: tags_1.TagsSchema.optional(),
|
|
126
|
-
|
|
136
|
+
runtimes: zod_1.z
|
|
127
137
|
.array(agent_env_1.AgentEnvSpecSchema)
|
|
128
138
|
.default([])
|
|
129
139
|
.superRefine((0, zod_util_1.uniqueBy)(agent => agent.name, name => `Duplicate agent name: ${name}`)),
|
|
@@ -171,7 +181,7 @@ exports.AgentCoreProjectSpecSchema = zod_1.z
|
|
|
171
181
|
})
|
|
172
182
|
.strict()
|
|
173
183
|
.superRefine((spec, ctx) => {
|
|
174
|
-
const agentNames = new Set(spec.
|
|
184
|
+
const agentNames = new Set(spec.runtimes.map(a => a.name));
|
|
175
185
|
const evaluatorNames = new Set(spec.evaluators.map(e => e.name));
|
|
176
186
|
for (const config of spec.onlineEvalConfigs) {
|
|
177
187
|
// Validate agent reference
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentcore-project.js","sourceRoot":"","sources":["../../../src/schema/schemas/agentcore-project.ts"],"names":[],"mappings":";;;AAAA;;;;;;;GAOG;AACH,4CAAqD;AACrD,2CAAiD;AACjD,+BAA4G;AAC5G,sDAA2G;
|
|
1
|
+
{"version":3,"file":"agentcore-project.js","sourceRoot":"","sources":["../../../src/schema/schemas/agentcore-project.ts"],"names":[],"mappings":";;;AAAA;;;;;;;GAOG;AACH,4CAAqD;AACrD,2CAAiD;AACjD,+BAA4G;AAC5G,sDAA2G;AAoBlG,sGApBA,iCAAqB,OAoBA;AAnB9B,gDAK6B;AAS3B,uHAbA,+CAAsC,OAaA;AACtC,4GAbA,oCAA2B,OAaA;AAC3B,qGAbA,6BAAoB,OAaA;AACpB,yGAbA,iCA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AAM,CAAC,IAAI,mCAAmC,QAAQ,GAAG;iBAC1F,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const GatewayAuthorizerTypeSchema: z.ZodEnum<{
|
|
3
|
+
NONE: "NONE";
|
|
4
|
+
AWS_IAM: "AWS_IAM";
|
|
5
|
+
CUSTOM_JWT: "CUSTOM_JWT";
|
|
6
|
+
}>;
|
|
7
|
+
export type GatewayAuthorizerType = z.infer<typeof GatewayAuthorizerTypeSchema>;
|
|
8
|
+
export declare const RuntimeAuthorizerTypeSchema: z.ZodEnum<{
|
|
9
|
+
AWS_IAM: "AWS_IAM";
|
|
10
|
+
CUSTOM_JWT: "CUSTOM_JWT";
|
|
11
|
+
}>;
|
|
12
|
+
export type RuntimeAuthorizerType = z.infer<typeof RuntimeAuthorizerTypeSchema>;
|
|
13
|
+
export declare const ClaimMatchOperatorSchema: z.ZodEnum<{
|
|
14
|
+
EQUALS: "EQUALS";
|
|
15
|
+
CONTAINS: "CONTAINS";
|
|
16
|
+
CONTAINS_ANY: "CONTAINS_ANY";
|
|
17
|
+
}>;
|
|
18
|
+
export type ClaimMatchOperator = z.infer<typeof ClaimMatchOperatorSchema>;
|
|
19
|
+
export declare const ClaimMatchValueSchema: z.ZodObject<{
|
|
20
|
+
matchValueString: z.ZodOptional<z.ZodString>;
|
|
21
|
+
matchValueStringList: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
export type ClaimMatchValue = z.infer<typeof ClaimMatchValueSchema>;
|
|
24
|
+
export declare const InboundTokenClaimValueTypeSchema: z.ZodEnum<{
|
|
25
|
+
STRING: "STRING";
|
|
26
|
+
STRING_ARRAY: "STRING_ARRAY";
|
|
27
|
+
}>;
|
|
28
|
+
export type InboundTokenClaimValueType = z.infer<typeof InboundTokenClaimValueTypeSchema>;
|
|
29
|
+
export declare const CustomClaimValidationSchema: z.ZodObject<{
|
|
30
|
+
inboundTokenClaimName: z.ZodString;
|
|
31
|
+
inboundTokenClaimValueType: z.ZodEnum<{
|
|
32
|
+
STRING: "STRING";
|
|
33
|
+
STRING_ARRAY: "STRING_ARRAY";
|
|
34
|
+
}>;
|
|
35
|
+
authorizingClaimMatchValue: z.ZodObject<{
|
|
36
|
+
claimMatchOperator: z.ZodEnum<{
|
|
37
|
+
EQUALS: "EQUALS";
|
|
38
|
+
CONTAINS: "CONTAINS";
|
|
39
|
+
CONTAINS_ANY: "CONTAINS_ANY";
|
|
40
|
+
}>;
|
|
41
|
+
claimMatchValue: z.ZodObject<{
|
|
42
|
+
matchValueString: z.ZodOptional<z.ZodString>;
|
|
43
|
+
matchValueStringList: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
44
|
+
}, z.core.$strip>;
|
|
45
|
+
}, z.core.$strip>;
|
|
46
|
+
}, z.core.$strict>;
|
|
47
|
+
export type CustomClaimValidation = z.infer<typeof CustomClaimValidationSchema>;
|
|
48
|
+
/**
|
|
49
|
+
* Custom JWT authorizer configuration.
|
|
50
|
+
* Used when authorizerType is 'CUSTOM_JWT'.
|
|
51
|
+
*
|
|
52
|
+
* At least one of allowedAudience, allowedClients, allowedScopes, or customClaims
|
|
53
|
+
* must be provided. Only discoveryUrl is unconditionally required.
|
|
54
|
+
*/
|
|
55
|
+
export declare const CustomJwtAuthorizerConfigSchema: z.ZodObject<{
|
|
56
|
+
discoveryUrl: z.ZodString;
|
|
57
|
+
allowedAudience: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
58
|
+
allowedClients: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
59
|
+
allowedScopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
60
|
+
customClaims: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
61
|
+
inboundTokenClaimName: z.ZodString;
|
|
62
|
+
inboundTokenClaimValueType: z.ZodEnum<{
|
|
63
|
+
STRING: "STRING";
|
|
64
|
+
STRING_ARRAY: "STRING_ARRAY";
|
|
65
|
+
}>;
|
|
66
|
+
authorizingClaimMatchValue: z.ZodObject<{
|
|
67
|
+
claimMatchOperator: z.ZodEnum<{
|
|
68
|
+
EQUALS: "EQUALS";
|
|
69
|
+
CONTAINS: "CONTAINS";
|
|
70
|
+
CONTAINS_ANY: "CONTAINS_ANY";
|
|
71
|
+
}>;
|
|
72
|
+
claimMatchValue: z.ZodObject<{
|
|
73
|
+
matchValueString: z.ZodOptional<z.ZodString>;
|
|
74
|
+
matchValueStringList: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
75
|
+
}, z.core.$strip>;
|
|
76
|
+
}, z.core.$strip>;
|
|
77
|
+
}, z.core.$strict>>>;
|
|
78
|
+
}, z.core.$strict>;
|
|
79
|
+
export type CustomJwtAuthorizerConfig = z.infer<typeof CustomJwtAuthorizerConfigSchema>;
|
|
80
|
+
/**
|
|
81
|
+
* Resource-agnostic authorizer configuration container.
|
|
82
|
+
* Used by both Gateway and Runtime resources.
|
|
83
|
+
*/
|
|
84
|
+
export declare const AuthorizerConfigSchema: z.ZodObject<{
|
|
85
|
+
customJwtAuthorizer: z.ZodOptional<z.ZodObject<{
|
|
86
|
+
discoveryUrl: z.ZodString;
|
|
87
|
+
allowedAudience: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
88
|
+
allowedClients: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
89
|
+
allowedScopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
90
|
+
customClaims: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
91
|
+
inboundTokenClaimName: z.ZodString;
|
|
92
|
+
inboundTokenClaimValueType: z.ZodEnum<{
|
|
93
|
+
STRING: "STRING";
|
|
94
|
+
STRING_ARRAY: "STRING_ARRAY";
|
|
95
|
+
}>;
|
|
96
|
+
authorizingClaimMatchValue: z.ZodObject<{
|
|
97
|
+
claimMatchOperator: z.ZodEnum<{
|
|
98
|
+
EQUALS: "EQUALS";
|
|
99
|
+
CONTAINS: "CONTAINS";
|
|
100
|
+
CONTAINS_ANY: "CONTAINS_ANY";
|
|
101
|
+
}>;
|
|
102
|
+
claimMatchValue: z.ZodObject<{
|
|
103
|
+
matchValueString: z.ZodOptional<z.ZodString>;
|
|
104
|
+
matchValueStringList: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
105
|
+
}, z.core.$strip>;
|
|
106
|
+
}, z.core.$strip>;
|
|
107
|
+
}, z.core.$strict>>>;
|
|
108
|
+
}, z.core.$strict>>;
|
|
109
|
+
}, z.core.$strip>;
|
|
110
|
+
export type AuthorizerConfig = z.infer<typeof AuthorizerConfigSchema>;
|
|
111
|
+
/** @deprecated Use AuthorizerConfigSchema. Backwards-compatible alias for Gateway. */
|
|
112
|
+
export declare const GatewayAuthorizerConfigSchema: z.ZodObject<{
|
|
113
|
+
customJwtAuthorizer: z.ZodOptional<z.ZodObject<{
|
|
114
|
+
discoveryUrl: z.ZodString;
|
|
115
|
+
allowedAudience: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
116
|
+
allowedClients: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
117
|
+
allowedScopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
118
|
+
customClaims: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
119
|
+
inboundTokenClaimName: z.ZodString;
|
|
120
|
+
inboundTokenClaimValueType: z.ZodEnum<{
|
|
121
|
+
STRING: "STRING";
|
|
122
|
+
STRING_ARRAY: "STRING_ARRAY";
|
|
123
|
+
}>;
|
|
124
|
+
authorizingClaimMatchValue: z.ZodObject<{
|
|
125
|
+
claimMatchOperator: z.ZodEnum<{
|
|
126
|
+
EQUALS: "EQUALS";
|
|
127
|
+
CONTAINS: "CONTAINS";
|
|
128
|
+
CONTAINS_ANY: "CONTAINS_ANY";
|
|
129
|
+
}>;
|
|
130
|
+
claimMatchValue: z.ZodObject<{
|
|
131
|
+
matchValueString: z.ZodOptional<z.ZodString>;
|
|
132
|
+
matchValueStringList: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
133
|
+
}, z.core.$strip>;
|
|
134
|
+
}, z.core.$strip>;
|
|
135
|
+
}, z.core.$strict>>>;
|
|
136
|
+
}, z.core.$strict>>;
|
|
137
|
+
}, z.core.$strip>;
|
|
138
|
+
/** @deprecated Use AuthorizerConfig. Backwards-compatible alias for Gateway. */
|
|
139
|
+
export type GatewayAuthorizerConfig = AuthorizerConfig;
|
|
140
|
+
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/schema/schemas/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,2BAA2B;;;;EAA4C,CAAC;AACrF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,eAAO,MAAM,2BAA2B;;;EAAoC,CAAC;AAC7E,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AA4BhF,eAAO,MAAM,wBAAwB;;;;EAAiD,CAAC;AACvF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,eAAO,MAAM,qBAAqB;;;iBAmB9B,CAAC;AACL,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,gCAAgC;;;EAAqC,CAAC;AACnF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAE1F,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;kBAgB7B,CAAC;AACZ,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAIhF;;;;;;GAMG;AACH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;kBA0BxC,CAAC;AAEL,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAExF;;;GAGG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;iBAEjC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,sFAAsF;AACtF,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;iBAAyB,CAAC;AACpE,gFAAgF;AAChF,MAAM,MAAM,uBAAuB,GAAG,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GatewayAuthorizerConfigSchema = exports.AuthorizerConfigSchema = exports.CustomJwtAuthorizerConfigSchema = exports.CustomClaimValidationSchema = exports.InboundTokenClaimValueTypeSchema = exports.ClaimMatchValueSchema = exports.ClaimMatchOperatorSchema = exports.RuntimeAuthorizerTypeSchema = exports.GatewayAuthorizerTypeSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
// ============================================================================
|
|
6
|
+
// Shared Authorization Schemas
|
|
7
|
+
// ============================================================================
|
|
8
|
+
exports.GatewayAuthorizerTypeSchema = zod_1.z.enum(['NONE', 'AWS_IAM', 'CUSTOM_JWT']);
|
|
9
|
+
exports.RuntimeAuthorizerTypeSchema = zod_1.z.enum(['AWS_IAM', 'CUSTOM_JWT']);
|
|
10
|
+
/** OIDC well-known configuration endpoint suffix (per OpenID Connect Discovery 1.0 spec) */
|
|
11
|
+
const OIDC_WELL_KNOWN_SUFFIX = '/.well-known/openid-configuration';
|
|
12
|
+
/**
|
|
13
|
+
* OIDC Discovery URL schema.
|
|
14
|
+
* Must be a valid URL ending with the standard OIDC well-known endpoint.
|
|
15
|
+
* @see https://openid.net/specs/openid-connect-discovery-1_0.html
|
|
16
|
+
*/
|
|
17
|
+
const OidcDiscoveryUrlSchema = zod_1.z
|
|
18
|
+
.string()
|
|
19
|
+
.url('Must be a valid URL')
|
|
20
|
+
.refine(url => url.startsWith('https://'), {
|
|
21
|
+
message: 'OIDC discovery URL must use HTTPS',
|
|
22
|
+
})
|
|
23
|
+
.refine(url => url.endsWith(OIDC_WELL_KNOWN_SUFFIX), {
|
|
24
|
+
message: `OIDC discovery URL must end with '${OIDC_WELL_KNOWN_SUFFIX}'`,
|
|
25
|
+
});
|
|
26
|
+
// ── Custom Claims Schemas (matches CFN CustomClaimValidationType) ──
|
|
27
|
+
// API-documented patterns (from ClaimMatchValueType and CustomClaimValidationType)
|
|
28
|
+
const MATCH_VALUE_PATTERN = /^[A-Za-z0-9_.-]+$/;
|
|
29
|
+
const CLAIM_NAME_PATTERN = /^[A-Za-z0-9_.:-]+$/;
|
|
30
|
+
// Server-side reserved claim names (not regex-documented; API rejects these at deploy time)
|
|
31
|
+
const RESERVED_CLAIM_NAMES = ['client_id'];
|
|
32
|
+
exports.ClaimMatchOperatorSchema = zod_1.z.enum(['EQUALS', 'CONTAINS', 'CONTAINS_ANY']);
|
|
33
|
+
exports.ClaimMatchValueSchema = zod_1.z
|
|
34
|
+
.object({
|
|
35
|
+
matchValueString: zod_1.z
|
|
36
|
+
.string()
|
|
37
|
+
.min(1)
|
|
38
|
+
.max(255)
|
|
39
|
+
.regex(MATCH_VALUE_PATTERN, 'Match value must match [A-Za-z0-9_.-]+')
|
|
40
|
+
.optional(),
|
|
41
|
+
matchValueStringList: zod_1.z
|
|
42
|
+
.array(zod_1.z.string().min(1).max(255).regex(MATCH_VALUE_PATTERN, 'Each match value must match [A-Za-z0-9_.-]+'))
|
|
43
|
+
.min(1)
|
|
44
|
+
.max(255)
|
|
45
|
+
.optional(),
|
|
46
|
+
})
|
|
47
|
+
.refine(data => data.matchValueString !== undefined || data.matchValueStringList !== undefined, {
|
|
48
|
+
message: 'Either matchValueString or matchValueStringList must be provided',
|
|
49
|
+
})
|
|
50
|
+
.refine(data => !(data.matchValueString !== undefined && data.matchValueStringList !== undefined), {
|
|
51
|
+
message: 'Only one of matchValueString or matchValueStringList may be provided',
|
|
52
|
+
});
|
|
53
|
+
exports.InboundTokenClaimValueTypeSchema = zod_1.z.enum(['STRING', 'STRING_ARRAY']);
|
|
54
|
+
exports.CustomClaimValidationSchema = zod_1.z
|
|
55
|
+
.object({
|
|
56
|
+
inboundTokenClaimName: zod_1.z
|
|
57
|
+
.string()
|
|
58
|
+
.min(1)
|
|
59
|
+
.max(255)
|
|
60
|
+
.regex(CLAIM_NAME_PATTERN, 'Claim name must match [A-Za-z0-9_.-:]+')
|
|
61
|
+
.refine(name => !RESERVED_CLAIM_NAMES.includes(name), {
|
|
62
|
+
message: `Claim name cannot be a reserved name (${RESERVED_CLAIM_NAMES.join(', ')})`,
|
|
63
|
+
}),
|
|
64
|
+
inboundTokenClaimValueType: exports.InboundTokenClaimValueTypeSchema,
|
|
65
|
+
authorizingClaimMatchValue: zod_1.z.object({
|
|
66
|
+
claimMatchOperator: exports.ClaimMatchOperatorSchema,
|
|
67
|
+
claimMatchValue: exports.ClaimMatchValueSchema,
|
|
68
|
+
}),
|
|
69
|
+
})
|
|
70
|
+
.strict();
|
|
71
|
+
// ── Custom JWT Authorizer Configuration ──
|
|
72
|
+
/**
|
|
73
|
+
* Custom JWT authorizer configuration.
|
|
74
|
+
* Used when authorizerType is 'CUSTOM_JWT'.
|
|
75
|
+
*
|
|
76
|
+
* At least one of allowedAudience, allowedClients, allowedScopes, or customClaims
|
|
77
|
+
* must be provided. Only discoveryUrl is unconditionally required.
|
|
78
|
+
*/
|
|
79
|
+
exports.CustomJwtAuthorizerConfigSchema = zod_1.z
|
|
80
|
+
.object({
|
|
81
|
+
/** OIDC discovery URL (e.g., https://cognito-idp.{region}.amazonaws.com/{userPoolId}/.well-known/openid-configuration) */
|
|
82
|
+
discoveryUrl: OidcDiscoveryUrlSchema,
|
|
83
|
+
/** List of allowed audiences (typically client IDs) */
|
|
84
|
+
allowedAudience: zod_1.z.array(zod_1.z.string().min(1)).optional(),
|
|
85
|
+
/** List of allowed client IDs */
|
|
86
|
+
allowedClients: zod_1.z.array(zod_1.z.string().min(1)).optional(),
|
|
87
|
+
/** List of allowed scopes */
|
|
88
|
+
allowedScopes: zod_1.z.array(zod_1.z.string().min(1)).optional(),
|
|
89
|
+
/** Custom claim validations */
|
|
90
|
+
customClaims: zod_1.z.array(exports.CustomClaimValidationSchema).min(1).optional(),
|
|
91
|
+
})
|
|
92
|
+
.strict()
|
|
93
|
+
.superRefine((data, ctx) => {
|
|
94
|
+
const hasAudience = data.allowedAudience && data.allowedAudience.length > 0;
|
|
95
|
+
const hasClients = data.allowedClients && data.allowedClients.length > 0;
|
|
96
|
+
const hasScopes = data.allowedScopes && data.allowedScopes.length > 0;
|
|
97
|
+
const hasClaims = data.customClaims && data.customClaims.length > 0;
|
|
98
|
+
if (!hasAudience && !hasClients && !hasScopes && !hasClaims) {
|
|
99
|
+
ctx.addIssue({
|
|
100
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
101
|
+
message: 'At least one of allowedAudience, allowedClients, allowedScopes, or customClaims must be provided',
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
/**
|
|
106
|
+
* Resource-agnostic authorizer configuration container.
|
|
107
|
+
* Used by both Gateway and Runtime resources.
|
|
108
|
+
*/
|
|
109
|
+
exports.AuthorizerConfigSchema = zod_1.z.object({
|
|
110
|
+
customJwtAuthorizer: exports.CustomJwtAuthorizerConfigSchema.optional(),
|
|
111
|
+
});
|
|
112
|
+
/** @deprecated Use AuthorizerConfigSchema. Backwards-compatible alias for Gateway. */
|
|
113
|
+
exports.GatewayAuthorizerConfigSchema = exports.AuthorizerConfigSchema;
|
|
114
|
+
//# sourceMappingURL=auth.js.map
|