@aws/agentcore-cdk 0.1.0-alpha.2 → 0.1.0-alpha.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -12
- package/dist/cdk/constants.d.ts +1 -0
- package/dist/cdk/constants.d.ts.map +1 -1
- package/dist/cdk/constants.js +5 -1
- package/dist/cdk/constants.js.map +1 -1
- package/dist/cdk/constructs/components/base-props.d.ts +2 -0
- package/dist/cdk/constructs/components/base-props.d.ts.map +1 -1
- package/dist/cdk/constructs/components/container/ContainerBuildProject.d.ts.map +1 -1
- package/dist/cdk/constructs/components/container/ContainerBuildProject.js +5 -1
- package/dist/cdk/constructs/components/container/ContainerBuildProject.js.map +1 -1
- package/dist/cdk/constructs/components/container/ContainerImageBuilder.js +1 -1
- package/dist/cdk/constructs/components/container/container-build-handler.d.ts +1 -1
- package/dist/cdk/constructs/components/container/container-build-handler.d.ts.map +1 -1
- package/dist/cdk/constructs/components/container/container-build-handler.js +2 -3
- package/dist/cdk/constructs/components/container/container-build-handler.js.map +1 -1
- package/dist/cdk/constructs/components/mcp/Gateway.d.ts +55 -0
- package/dist/cdk/constructs/components/mcp/Gateway.d.ts.map +1 -0
- package/dist/cdk/constructs/components/mcp/Gateway.js +480 -0
- package/dist/cdk/constructs/components/mcp/Gateway.js.map +1 -0
- package/dist/cdk/constructs/components/mcp/McpLambdaCompute.js +2 -2
- package/dist/cdk/constructs/components/mcp/McpLambdaCompute.js.map +1 -1
- package/dist/cdk/constructs/components/mcp/McpRuntimeCompute.js +1 -1
- package/dist/cdk/constructs/components/mcp/McpRuntimeCompute.js.map +1 -1
- package/dist/cdk/constructs/components/mcp/index.d.ts +1 -1
- package/dist/cdk/constructs/components/mcp/index.d.ts.map +1 -1
- package/dist/cdk/constructs/components/mcp/index.js +3 -3
- package/dist/cdk/constructs/components/mcp/index.js.map +1 -1
- package/dist/cdk/constructs/components/mcp/mcp-utils.js +1 -1
- package/dist/cdk/constructs/components/primitives/BasePrimitiveConstruct.d.ts +51 -0
- package/dist/cdk/constructs/components/primitives/BasePrimitiveConstruct.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/BasePrimitiveConstruct.js +54 -0
- package/dist/cdk/constructs/components/primitives/BasePrimitiveConstruct.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/evaluator/AgentCoreEvaluator.d.ts +47 -0
- package/dist/cdk/constructs/components/primitives/evaluator/AgentCoreEvaluator.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/evaluator/AgentCoreEvaluator.js +204 -0
- package/dist/cdk/constructs/components/primitives/evaluator/AgentCoreEvaluator.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/evaluator/AgentCoreOnlineEvaluationConfig.d.ts +28 -0
- package/dist/cdk/constructs/components/primitives/evaluator/AgentCoreOnlineEvaluationConfig.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/evaluator/AgentCoreOnlineEvaluationConfig.js +161 -0
- package/dist/cdk/constructs/components/primitives/evaluator/AgentCoreOnlineEvaluationConfig.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/evaluator/index.d.ts +3 -0
- package/dist/cdk/constructs/components/primitives/evaluator/index.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/evaluator/index.js +8 -0
- package/dist/cdk/constructs/components/primitives/evaluator/index.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/harness/AgentCoreHarnessRole.d.ts +38 -0
- package/dist/cdk/constructs/components/primitives/harness/AgentCoreHarnessRole.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/harness/AgentCoreHarnessRole.js +249 -0
- package/dist/cdk/constructs/components/primitives/harness/AgentCoreHarnessRole.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/harness/__tests__/AgentCoreHarnessRole.test.d.ts +2 -0
- package/dist/cdk/constructs/components/primitives/harness/__tests__/AgentCoreHarnessRole.test.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/harness/__tests__/AgentCoreHarnessRole.test.js +182 -0
- package/dist/cdk/constructs/components/primitives/harness/__tests__/AgentCoreHarnessRole.test.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/harness/index.d.ts +2 -0
- package/dist/cdk/constructs/components/primitives/harness/index.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/harness/index.js +6 -0
- package/dist/cdk/constructs/components/primitives/harness/index.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/index.d.ts +5 -0
- package/dist/cdk/constructs/components/primitives/index.d.ts.map +1 -1
- package/dist/cdk/constructs/components/primitives/index.js +11 -1
- package/dist/cdk/constructs/components/primitives/index.js.map +1 -1
- package/dist/cdk/constructs/components/primitives/memory/AgentCoreMemory.d.ts +10 -2
- package/dist/cdk/constructs/components/primitives/memory/AgentCoreMemory.d.ts.map +1 -1
- package/dist/cdk/constructs/components/primitives/memory/AgentCoreMemory.js +68 -28
- package/dist/cdk/constructs/components/primitives/memory/AgentCoreMemory.js.map +1 -1
- package/dist/cdk/constructs/components/primitives/memory/__tests__/AgentCoreMemory.test.d.ts +2 -0
- package/dist/cdk/constructs/components/primitives/memory/__tests__/AgentCoreMemory.test.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/memory/__tests__/AgentCoreMemory.test.js +146 -0
- package/dist/cdk/constructs/components/primitives/memory/__tests__/AgentCoreMemory.test.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/policy/AgentCorePolicyEngine.d.ts +28 -0
- package/dist/cdk/constructs/components/primitives/policy/AgentCorePolicyEngine.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/policy/AgentCorePolicyEngine.js +57 -0
- package/dist/cdk/constructs/components/primitives/policy/AgentCorePolicyEngine.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/policy/index.d.ts +2 -0
- package/dist/cdk/constructs/components/primitives/policy/index.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/policy/index.js +6 -0
- package/dist/cdk/constructs/components/primitives/policy/index.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/runtime/AgentCoreRuntime.d.ts +14 -1
- package/dist/cdk/constructs/components/primitives/runtime/AgentCoreRuntime.d.ts.map +1 -1
- package/dist/cdk/constructs/components/primitives/runtime/AgentCoreRuntime.js +163 -79
- package/dist/cdk/constructs/components/primitives/runtime/AgentCoreRuntime.js.map +1 -1
- package/dist/cdk/constructs/components/primitives/runtime/__tests__/AgentCoreRuntime.test.d.ts +2 -0
- package/dist/cdk/constructs/components/primitives/runtime/__tests__/AgentCoreRuntime.test.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/runtime/__tests__/AgentCoreRuntime.test.js +113 -0
- package/dist/cdk/constructs/components/primitives/runtime/__tests__/AgentCoreRuntime.test.js.map +1 -0
- package/dist/cdk/constructs/components/shared/__tests__/build-authorizer-config.test.d.ts +2 -0
- package/dist/cdk/constructs/components/shared/__tests__/build-authorizer-config.test.d.ts.map +1 -0
- package/dist/cdk/constructs/components/shared/__tests__/build-authorizer-config.test.js +99 -0
- package/dist/cdk/constructs/components/shared/__tests__/build-authorizer-config.test.js.map +1 -0
- package/dist/cdk/constructs/components/shared/build-authorizer-config.d.ts +28 -0
- package/dist/cdk/constructs/components/shared/build-authorizer-config.d.ts.map +1 -0
- package/dist/cdk/constructs/components/shared/build-authorizer-config.js +39 -0
- package/dist/cdk/constructs/components/shared/build-authorizer-config.js.map +1 -0
- package/dist/cdk/constructs/index.d.ts +1 -1
- package/dist/cdk/constructs/index.d.ts.map +1 -1
- package/dist/cdk/constructs/index.js +3 -1
- package/dist/cdk/constructs/index.js.map +1 -1
- package/dist/cdk/constructs/l3/AgentCoreApplication.d.ts +43 -1
- package/dist/cdk/constructs/l3/AgentCoreApplication.d.ts.map +1 -1
- package/dist/cdk/constructs/l3/AgentCoreApplication.js +226 -9
- package/dist/cdk/constructs/l3/AgentCoreApplication.js.map +1 -1
- package/dist/cdk/constructs/l3/AgentCoreMcp.d.ts +21 -3
- package/dist/cdk/constructs/l3/AgentCoreMcp.d.ts.map +1 -1
- package/dist/cdk/constructs/l3/AgentCoreMcp.js +106 -15
- package/dist/cdk/constructs/l3/AgentCoreMcp.js.map +1 -1
- package/dist/cdk/constructs/l3/AgentEnvironment.d.ts +2 -0
- package/dist/cdk/constructs/l3/AgentEnvironment.d.ts.map +1 -1
- package/dist/cdk/constructs/l3/AgentEnvironment.js +3 -1
- package/dist/cdk/constructs/l3/AgentEnvironment.js.map +1 -1
- package/dist/cdk/index.d.ts +1 -1
- package/dist/cdk/index.d.ts.map +1 -1
- package/dist/cdk/index.js +4 -1
- package/dist/cdk/index.js.map +1 -1
- package/dist/cdk/utils/__tests__/tags.test.d.ts +2 -0
- package/dist/cdk/utils/__tests__/tags.test.d.ts.map +1 -0
- package/dist/cdk/utils/__tests__/tags.test.js +57 -0
- package/dist/cdk/utils/__tests__/tags.test.js.map +1 -0
- package/dist/cdk/utils/tags.d.ts +11 -0
- package/dist/cdk/utils/tags.d.ts.map +1 -0
- package/dist/cdk/utils/tags.js +22 -0
- package/dist/cdk/utils/tags.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/errors/config.js +1 -1
- package/dist/lib/errors/config.js.map +1 -1
- package/dist/lib/packaging/helpers.d.ts.map +1 -1
- package/dist/lib/packaging/helpers.js +5 -1
- package/dist/lib/packaging/helpers.js.map +1 -1
- package/dist/lib/packaging/index.js +2 -2
- package/dist/lib/packaging/index.js.map +1 -1
- package/dist/lib/packaging/uv.d.ts.map +1 -1
- package/dist/lib/packaging/uv.js +1 -1
- package/dist/lib/packaging/uv.js.map +1 -1
- package/dist/schema/constants.d.ts +23 -1
- package/dist/schema/constants.d.ts.map +1 -1
- package/dist/schema/constants.js +37 -3
- package/dist/schema/constants.js.map +1 -1
- package/dist/schema/schemas/agent-env.d.ts +99 -5
- package/dist/schema/schemas/agent-env.d.ts.map +1 -1
- package/dist/schema/schemas/agent-env.js +135 -7
- package/dist/schema/schemas/agent-env.js.map +1 -1
- package/dist/schema/schemas/agentcore-project.d.ts +655 -13
- package/dist/schema/schemas/agentcore-project.d.ts.map +1 -1
- package/dist/schema/schemas/agentcore-project.js +133 -7
- 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/aws-targets.d.ts +18 -0
- package/dist/schema/schemas/aws-targets.d.ts.map +1 -1
- package/dist/schema/schemas/aws-targets.js +7 -0
- package/dist/schema/schemas/aws-targets.js.map +1 -1
- package/dist/schema/schemas/deployed-state.d.ts +219 -16
- package/dist/schema/schemas/deployed-state.d.ts.map +1 -1
- package/dist/schema/schemas/deployed-state.js +51 -4
- 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 +437 -46
- package/dist/schema/schemas/mcp.d.ts.map +1 -1
- package/dist/schema/schemas/mcp.js +317 -37
- package/dist/schema/schemas/mcp.js.map +1 -1
- package/dist/schema/schemas/primitives/evaluator.d.ts +100 -0
- package/dist/schema/schemas/primitives/evaluator.d.ts.map +1 -0
- package/dist/schema/schemas/primitives/evaluator.js +73 -0
- package/dist/schema/schemas/primitives/evaluator.js.map +1 -0
- package/dist/schema/schemas/primitives/harness.d.ts +256 -0
- package/dist/schema/schemas/primitives/harness.d.ts.map +1 -0
- package/dist/schema/schemas/primitives/harness.js +206 -0
- package/dist/schema/schemas/primitives/harness.js.map +1 -0
- package/dist/schema/schemas/primitives/index.d.ts +6 -0
- package/dist/schema/schemas/primitives/index.d.ts.map +1 -1
- package/dist/schema/schemas/primitives/index.js +21 -1
- package/dist/schema/schemas/primitives/index.js.map +1 -1
- package/dist/schema/schemas/primitives/memory.d.ts +4 -0
- package/dist/schema/schemas/primitives/memory.d.ts.map +1 -1
- package/dist/schema/schemas/primitives/memory.js +4 -1
- package/dist/schema/schemas/primitives/memory.js.map +1 -1
- package/dist/schema/schemas/primitives/online-evaluation-config.d.ts +13 -0
- package/dist/schema/schemas/primitives/online-evaluation-config.d.ts.map +1 -0
- package/dist/schema/schemas/primitives/online-evaluation-config.js +28 -0
- package/dist/schema/schemas/primitives/online-evaluation-config.js.map +1 -0
- package/dist/schema/schemas/primitives/policy.d.ts +49 -0
- package/dist/schema/schemas/primitives/policy.d.ts.map +1 -0
- package/dist/schema/schemas/primitives/policy.js +62 -0
- package/dist/schema/schemas/primitives/policy.js.map +1 -0
- package/dist/schema/schemas/primitives/tags.d.ts +6 -0
- package/dist/schema/schemas/primitives/tags.d.ts.map +1 -0
- package/dist/schema/schemas/primitives/tags.js +20 -0
- package/dist/schema/schemas/primitives/tags.js.map +1 -0
- package/package.json +19 -12
- package/dist/cdk/constructs/components/mcp/McpGateway.d.ts +0 -37
- package/dist/cdk/constructs/components/mcp/McpGateway.d.ts.map +0 -1
- package/dist/cdk/constructs/components/mcp/McpGateway.js +0 -154
- package/dist/cdk/constructs/components/mcp/McpGateway.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentcore-project.d.ts","sourceRoot":"","sources":["../../../src/schema/schemas/agentcore-project.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"agentcore-project.d.ts","sourceRoot":"","sources":["../../../src/schema/schemas/agentcore-project.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAErF,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAG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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmHnC,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.CredentialSchema = exports.
|
|
3
|
+
exports.AgentCoreProjectSpecSchema = exports.HarnessRegistryEntrySchema = exports.EvaluatorSchema = exports.EvaluatorTypeSchema = exports.CredentialSchema = exports.OAuthCredentialSchema = exports.ApiKeyCredentialSchema = exports.CredentialTypeSchema = exports.CredentialNameSchema = exports.MemorySchema = exports.StreamDeliveryResourcesSchema = exports.StreamContentLevelSchema = exports.MemoryNameSchema = exports.MemoryTypeSchema = exports.ProjectNameSchema = exports.ManagedBySchema = exports.TagsSchema = exports.ValidationModeSchema = exports.PolicySchema = exports.PolicyNameSchema = exports.PolicyEngineNameSchema = exports.PolicyEngineSchema = exports.MemoryStrategyTypeSchema = exports.MemoryStrategySchema = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* AgentCore Project Schema - Resource-centric model
|
|
6
6
|
*
|
|
@@ -11,11 +11,28 @@ exports.AgentCoreProjectSpecSchema = exports.CredentialSchema = exports.Credenti
|
|
|
11
11
|
*/
|
|
12
12
|
const constants_1 = require("../constants");
|
|
13
13
|
const agent_env_1 = require("./agent-env");
|
|
14
|
+
const mcp_1 = require("./mcp");
|
|
15
|
+
const evaluator_1 = require("./primitives/evaluator");
|
|
16
|
+
const harness_1 = require("./primitives/harness");
|
|
14
17
|
const memory_1 = require("./primitives/memory");
|
|
15
18
|
Object.defineProperty(exports, "MemoryStrategySchema", { enumerable: true, get: function () { return memory_1.MemoryStrategySchema; } });
|
|
16
19
|
Object.defineProperty(exports, "MemoryStrategyTypeSchema", { enumerable: true, get: function () { return memory_1.MemoryStrategyTypeSchema; } });
|
|
20
|
+
const online_evaluation_config_1 = require("./primitives/online-evaluation-config");
|
|
21
|
+
const policy_1 = require("./primitives/policy");
|
|
22
|
+
Object.defineProperty(exports, "PolicyEngineSchema", { enumerable: true, get: function () { return policy_1.PolicyEngineSchema; } });
|
|
23
|
+
const tags_1 = require("./primitives/tags");
|
|
24
|
+
Object.defineProperty(exports, "TagsSchema", { enumerable: true, get: function () { return tags_1.TagsSchema; } });
|
|
17
25
|
const zod_util_1 = require("./zod-util");
|
|
18
26
|
const zod_1 = require("zod");
|
|
27
|
+
var policy_2 = require("./primitives/policy");
|
|
28
|
+
Object.defineProperty(exports, "PolicyEngineNameSchema", { enumerable: true, get: function () { return policy_2.PolicyEngineNameSchema; } });
|
|
29
|
+
Object.defineProperty(exports, "PolicyNameSchema", { enumerable: true, get: function () { return policy_2.PolicyNameSchema; } });
|
|
30
|
+
Object.defineProperty(exports, "PolicySchema", { enumerable: true, get: function () { return policy_2.PolicySchema; } });
|
|
31
|
+
Object.defineProperty(exports, "ValidationModeSchema", { enumerable: true, get: function () { return policy_2.ValidationModeSchema; } });
|
|
32
|
+
// ============================================================================
|
|
33
|
+
// ManagedBy Schema
|
|
34
|
+
// ============================================================================
|
|
35
|
+
exports.ManagedBySchema = zod_1.z.enum(['CDK']).default('CDK');
|
|
19
36
|
// ============================================================================
|
|
20
37
|
// Project Name Schema
|
|
21
38
|
// ============================================================================
|
|
@@ -36,8 +53,19 @@ exports.MemoryNameSchema = zod_1.z
|
|
|
36
53
|
.min(1, 'Name is required')
|
|
37
54
|
.max(48)
|
|
38
55
|
.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)');
|
|
56
|
+
exports.StreamContentLevelSchema = zod_1.z.enum(['FULL_CONTENT', 'METADATA_ONLY']);
|
|
57
|
+
exports.StreamDeliveryResourcesSchema = zod_1.z.object({
|
|
58
|
+
resources: zod_1.z.array(zod_1.z.object({
|
|
59
|
+
kinesis: zod_1.z.object({
|
|
60
|
+
dataStreamArn: zod_1.z.string(),
|
|
61
|
+
contentConfigurations: zod_1.z.array(zod_1.z.object({
|
|
62
|
+
type: zod_1.z.literal('MEMORY_RECORDS'),
|
|
63
|
+
level: exports.StreamContentLevelSchema,
|
|
64
|
+
})),
|
|
65
|
+
}),
|
|
66
|
+
})),
|
|
67
|
+
});
|
|
39
68
|
exports.MemorySchema = zod_1.z.object({
|
|
40
|
-
type: exports.MemoryTypeSchema,
|
|
41
69
|
name: exports.MemoryNameSchema,
|
|
42
70
|
eventExpiryDuration: zod_1.z.number().int().min(7).max(365),
|
|
43
71
|
// Strategies array can be empty for short-term memory (just base memory with expiration)
|
|
@@ -46,27 +74,68 @@ exports.MemorySchema = zod_1.z.object({
|
|
|
46
74
|
.array(memory_1.MemoryStrategySchema)
|
|
47
75
|
.default([])
|
|
48
76
|
.superRefine((0, zod_util_1.uniqueBy)(strategy => strategy.type, type => `Duplicate memory strategy type: ${type}`)),
|
|
77
|
+
tags: tags_1.TagsSchema.optional(),
|
|
78
|
+
encryptionKeyArn: zod_1.z.string().optional(),
|
|
79
|
+
executionRoleArn: zod_1.z.string().optional(),
|
|
80
|
+
streamDeliveryResources: exports.StreamDeliveryResourcesSchema.optional(),
|
|
49
81
|
});
|
|
50
82
|
// ============================================================================
|
|
51
83
|
// Credential Schema
|
|
52
84
|
// ============================================================================
|
|
53
|
-
exports.CredentialTypeSchema = zod_1.z.literal('ApiKeyCredentialProvider');
|
|
54
85
|
exports.CredentialNameSchema = zod_1.z
|
|
55
86
|
.string()
|
|
56
87
|
.min(3, 'Credential name must be at least 3 characters')
|
|
57
88
|
.max(255)
|
|
58
89
|
.regex(/^[A-Za-z0-9_.-]+$/, 'Must contain only alphanumeric characters, underscores, dots, and hyphens (3-255 chars)');
|
|
59
|
-
exports.
|
|
60
|
-
|
|
90
|
+
exports.CredentialTypeSchema = zod_1.z.enum(['ApiKeyCredentialProvider', 'OAuthCredentialProvider']);
|
|
91
|
+
exports.ApiKeyCredentialSchema = zod_1.z.object({
|
|
92
|
+
authorizerType: zod_1.z.literal('ApiKeyCredentialProvider'),
|
|
61
93
|
name: exports.CredentialNameSchema,
|
|
62
94
|
});
|
|
95
|
+
exports.OAuthCredentialSchema = zod_1.z.object({
|
|
96
|
+
authorizerType: zod_1.z.literal('OAuthCredentialProvider'),
|
|
97
|
+
name: exports.CredentialNameSchema,
|
|
98
|
+
/** OIDC discovery URL for the OAuth provider (optional for imported providers that already exist in Identity service) */
|
|
99
|
+
discoveryUrl: zod_1.z.string().url().optional(),
|
|
100
|
+
/** Scopes this credential provider supports */
|
|
101
|
+
scopes: zod_1.z.array(zod_1.z.string()).optional(),
|
|
102
|
+
/** Credential provider vendor type */
|
|
103
|
+
vendor: zod_1.z.string().default('CustomOauth2'),
|
|
104
|
+
/** Whether this credential was auto-created by the CLI (e.g., for CUSTOM_JWT inbound auth) */
|
|
105
|
+
managed: zod_1.z.boolean().optional(),
|
|
106
|
+
});
|
|
107
|
+
exports.CredentialSchema = zod_1.z.discriminatedUnion('authorizerType', [exports.ApiKeyCredentialSchema, exports.OAuthCredentialSchema]);
|
|
108
|
+
// ============================================================================
|
|
109
|
+
// Evaluator Schema
|
|
110
|
+
// ============================================================================
|
|
111
|
+
exports.EvaluatorTypeSchema = zod_1.z.literal('CustomEvaluator');
|
|
112
|
+
exports.EvaluatorSchema = zod_1.z.object({
|
|
113
|
+
name: evaluator_1.EvaluatorNameSchema,
|
|
114
|
+
level: evaluator_1.EvaluationLevelSchema,
|
|
115
|
+
description: zod_1.z.string().optional(),
|
|
116
|
+
config: evaluator_1.EvaluatorConfigSchema,
|
|
117
|
+
tags: tags_1.TagsSchema.optional(),
|
|
118
|
+
});
|
|
119
|
+
// ============================================================================
|
|
120
|
+
// Harness Registry Schema
|
|
121
|
+
// ============================================================================
|
|
122
|
+
exports.HarnessRegistryEntrySchema = zod_1.z.object({
|
|
123
|
+
name: harness_1.HarnessNameSchema,
|
|
124
|
+
path: zod_1.z.string().min(1, 'Path to harness config directory is required'),
|
|
125
|
+
});
|
|
63
126
|
// ============================================================================
|
|
64
127
|
// Project Schema (Top Level)
|
|
65
128
|
// ============================================================================
|
|
66
|
-
|
|
129
|
+
/** Must match BUILTIN_EVALUATOR_PREFIX in src/cdk/constants.ts */
|
|
130
|
+
const BUILTIN_EVALUATOR_PREFIX = 'Builtin.';
|
|
131
|
+
const ARN_PREFIX = 'arn:';
|
|
132
|
+
exports.AgentCoreProjectSpecSchema = zod_1.z
|
|
133
|
+
.object({
|
|
67
134
|
name: exports.ProjectNameSchema,
|
|
68
135
|
version: zod_1.z.number().int(),
|
|
69
|
-
|
|
136
|
+
managedBy: exports.ManagedBySchema,
|
|
137
|
+
tags: tags_1.TagsSchema.optional(),
|
|
138
|
+
runtimes: zod_1.z
|
|
70
139
|
.array(agent_env_1.AgentEnvSpecSchema)
|
|
71
140
|
.default([])
|
|
72
141
|
.superRefine((0, zod_util_1.uniqueBy)(agent => agent.name, name => `Duplicate agent name: ${name}`)),
|
|
@@ -78,5 +147,62 @@ exports.AgentCoreProjectSpecSchema = zod_1.z.object({
|
|
|
78
147
|
.array(exports.CredentialSchema)
|
|
79
148
|
.default([])
|
|
80
149
|
.superRefine((0, zod_util_1.uniqueBy)(credential => credential.name, name => `Duplicate credential name: ${name}`)),
|
|
150
|
+
evaluators: zod_1.z
|
|
151
|
+
.array(exports.EvaluatorSchema)
|
|
152
|
+
.default([])
|
|
153
|
+
.superRefine((0, zod_util_1.uniqueBy)(evaluator => evaluator.name, name => `Duplicate evaluator name: ${name}`)),
|
|
154
|
+
onlineEvalConfigs: zod_1.z
|
|
155
|
+
.array(online_evaluation_config_1.OnlineEvaluationConfigSchema)
|
|
156
|
+
.default([])
|
|
157
|
+
.superRefine((0, zod_util_1.uniqueBy)(config => config.name, name => `Duplicate online evaluation config name: ${name}`)),
|
|
158
|
+
policyEngines: zod_1.z
|
|
159
|
+
.array(policy_1.PolicyEngineSchema)
|
|
160
|
+
.default([])
|
|
161
|
+
.superRefine((0, zod_util_1.uniqueBy)(engine => engine.name, name => `Duplicate policy engine name: ${name}`)),
|
|
162
|
+
// MCP / Gateway resources (merged from former mcp.json)
|
|
163
|
+
agentCoreGateways: zod_1.z.array(mcp_1.AgentCoreGatewaySchema).default([]),
|
|
164
|
+
mcpRuntimeTools: zod_1.z.array(mcp_1.AgentCoreMcpRuntimeToolSchema).optional(),
|
|
165
|
+
unassignedTargets: zod_1.z.array(mcp_1.AgentCoreGatewayTargetSchema).optional(),
|
|
166
|
+
harnesses: zod_1.z
|
|
167
|
+
.array(exports.HarnessRegistryEntrySchema)
|
|
168
|
+
.optional()
|
|
169
|
+
.superRefine((harnesses, ctx) => {
|
|
170
|
+
if (!harnesses)
|
|
171
|
+
return;
|
|
172
|
+
const seen = new Set();
|
|
173
|
+
for (const harness of harnesses) {
|
|
174
|
+
if (seen.has(harness.name)) {
|
|
175
|
+
ctx.addIssue({
|
|
176
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
177
|
+
message: `Duplicate harness name: ${harness.name}`,
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
seen.add(harness.name);
|
|
181
|
+
}
|
|
182
|
+
}),
|
|
183
|
+
})
|
|
184
|
+
.superRefine((spec, ctx) => {
|
|
185
|
+
const agentNames = new Set(spec.runtimes.map(a => a.name));
|
|
186
|
+
const evaluatorNames = new Set(spec.evaluators.map(e => e.name));
|
|
187
|
+
for (const config of spec.onlineEvalConfigs) {
|
|
188
|
+
// Validate agent reference
|
|
189
|
+
if (!agentNames.has(config.agent)) {
|
|
190
|
+
ctx.addIssue({
|
|
191
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
192
|
+
message: `Online evaluation config "${config.name}" references unknown agent "${config.agent}"`,
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
// Validate evaluator references
|
|
196
|
+
for (const evalName of config.evaluators) {
|
|
197
|
+
if (evalName.startsWith(BUILTIN_EVALUATOR_PREFIX) || evalName.startsWith(ARN_PREFIX))
|
|
198
|
+
continue;
|
|
199
|
+
if (!evaluatorNames.has(evalName)) {
|
|
200
|
+
ctx.addIssue({
|
|
201
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
202
|
+
message: `Online evaluation config "${config.name}" references unknown evaluator "${evalName}"`,
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
81
207
|
});
|
|
82
208
|
//# sourceMappingURL=agentcore-project.js.map
|
|
@@ -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,gDAAqF;
|
|
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;AAC3G,kDAAyD;AACzD,gDAAqF;AAQ5E,qGARA,6BAAoB,OAQA;AAAE,yGARA,iCA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AU,CAAC;gBAAE,SAAS;YAC/F,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;gBAClC,GAAG,CAAC,QAAQ,CAAC;oBACX,IAAI,EAAE,OAAC,CAAC,YAAY,CAAC,MAAM;oBAC3B,OAAO,EAAE,6BAA6B,MAAM,CAAC,IAAI,mCAAmC,QAAQ,GAAG;iBAChG,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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/schema/schemas/auth.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,+EAA+E;AAC/E,+BAA+B;AAC/B,+EAA+E;AAElE,QAAA,2BAA2B,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC;AAGxE,QAAA,2BAA2B,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC;AAG7E,4FAA4F;AAC5F,MAAM,sBAAsB,GAAG,mCAAmC,CAAC;AAEnE;;;;GAIG;AACH,MAAM,sBAAsB,GAAG,OAAC;KAC7B,MAAM,EAAE;KACR,GAAG,CAAC,qBAAqB,CAAC;KAC1B,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE;IACzC,OAAO,EAAE,mCAAmC;CAC7C,CAAC;KACD,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,sBAAsB,CAAC,EAAE;IACnD,OAAO,EAAE,qCAAqC,sBAAsB,GAAG;CACxE,CAAC,CAAC;AAEL,sEAAsE;AAEtE,mFAAmF;AACnF,MAAM,mBAAmB,GAAG,mBAAmB,CAAC;AAChD,MAAM,kBAAkB,GAAG,oBAAoB,CAAC;AAChD,4FAA4F;AAC5F,MAAM,oBAAoB,GAAG,CAAC,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,CAAC,cAAc,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC;IACzE,MAAM,SAAS,GAAG,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC;IACtE,MAAM,SAAS,GAAG,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC;IAEpE,IAAI,CAAC,WAAW,IAAI,CAAC,UAAU,IAAI,CAAC,SAAS,IAAI,CAAC,SAAS,EAAE,CAAC;QAC5D,GAAG,CAAC,QAAQ,CAAC;YACX,IAAI,EAAE,OAAC,CAAC,YAAY,CAAC,MAAM;YAC3B,OAAO,EAAE,kGAAkG;SAC5G,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC,CAAC;AAIL;;;GAGG;AACU,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,mBAAmB,EAAE,uCAA+B,CAAC,QAAQ,EAAE;CAChE,CAAC,CAAC;AAIH,sFAAsF;AACzE,QAAA,6BAA6B,GAAG,8BAAsB,CAAC"}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const AgentCoreRegionSchema: z.ZodEnum<{
|
|
3
3
|
"ap-northeast-1": "ap-northeast-1";
|
|
4
|
+
"ap-northeast-2": "ap-northeast-2";
|
|
4
5
|
"ap-south-1": "ap-south-1";
|
|
5
6
|
"ap-southeast-1": "ap-southeast-1";
|
|
6
7
|
"ap-southeast-2": "ap-southeast-2";
|
|
8
|
+
"ca-central-1": "ca-central-1";
|
|
7
9
|
"eu-central-1": "eu-central-1";
|
|
10
|
+
"eu-north-1": "eu-north-1";
|
|
8
11
|
"eu-west-1": "eu-west-1";
|
|
12
|
+
"eu-west-2": "eu-west-2";
|
|
13
|
+
"eu-west-3": "eu-west-3";
|
|
14
|
+
"sa-east-1": "sa-east-1";
|
|
9
15
|
"us-east-1": "us-east-1";
|
|
10
16
|
"us-east-2": "us-east-2";
|
|
11
17
|
"us-west-2": "us-west-2";
|
|
@@ -19,11 +25,17 @@ export declare const AwsDeploymentTargetSchema: z.ZodObject<{
|
|
|
19
25
|
account: z.ZodString;
|
|
20
26
|
region: z.ZodEnum<{
|
|
21
27
|
"ap-northeast-1": "ap-northeast-1";
|
|
28
|
+
"ap-northeast-2": "ap-northeast-2";
|
|
22
29
|
"ap-south-1": "ap-south-1";
|
|
23
30
|
"ap-southeast-1": "ap-southeast-1";
|
|
24
31
|
"ap-southeast-2": "ap-southeast-2";
|
|
32
|
+
"ca-central-1": "ca-central-1";
|
|
25
33
|
"eu-central-1": "eu-central-1";
|
|
34
|
+
"eu-north-1": "eu-north-1";
|
|
26
35
|
"eu-west-1": "eu-west-1";
|
|
36
|
+
"eu-west-2": "eu-west-2";
|
|
37
|
+
"eu-west-3": "eu-west-3";
|
|
38
|
+
"sa-east-1": "sa-east-1";
|
|
27
39
|
"us-east-1": "us-east-1";
|
|
28
40
|
"us-east-2": "us-east-2";
|
|
29
41
|
"us-west-2": "us-west-2";
|
|
@@ -36,11 +48,17 @@ export declare const AwsDeploymentTargetsSchema: z.ZodArray<z.ZodObject<{
|
|
|
36
48
|
account: z.ZodString;
|
|
37
49
|
region: z.ZodEnum<{
|
|
38
50
|
"ap-northeast-1": "ap-northeast-1";
|
|
51
|
+
"ap-northeast-2": "ap-northeast-2";
|
|
39
52
|
"ap-south-1": "ap-south-1";
|
|
40
53
|
"ap-southeast-1": "ap-southeast-1";
|
|
41
54
|
"ap-southeast-2": "ap-southeast-2";
|
|
55
|
+
"ca-central-1": "ca-central-1";
|
|
42
56
|
"eu-central-1": "eu-central-1";
|
|
57
|
+
"eu-north-1": "eu-north-1";
|
|
43
58
|
"eu-west-1": "eu-west-1";
|
|
59
|
+
"eu-west-2": "eu-west-2";
|
|
60
|
+
"eu-west-3": "eu-west-3";
|
|
61
|
+
"sa-east-1": "sa-east-1";
|
|
44
62
|
"us-east-1": "us-east-1";
|
|
45
63
|
"us-east-2": "us-east-2";
|
|
46
64
|
"us-west-2": "us-west-2";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aws-targets.d.ts","sourceRoot":"","sources":["../../../src/schema/schemas/aws-targets.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"aws-targets.d.ts","sourceRoot":"","sources":["../../../src/schema/schemas/aws-targets.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;EAgBhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAMpE,eAAO,MAAM,0BAA0B,aAQmB,CAAC;AAM3D,eAAO,MAAM,kBAAkB,aAGF,CAAC;AAM9B,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;iBAKpC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAM5E,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;kBAKtC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
|
|
@@ -5,14 +5,21 @@ const zod_util_1 = require("./zod-util");
|
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
6
|
// ============================================================================
|
|
7
7
|
// AgentCore Regions
|
|
8
|
+
// Keep in sync with: https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/agentcore-regions.html
|
|
8
9
|
// ============================================================================
|
|
9
10
|
exports.AgentCoreRegionSchema = zod_1.z.enum([
|
|
10
11
|
'ap-northeast-1',
|
|
12
|
+
'ap-northeast-2',
|
|
11
13
|
'ap-south-1',
|
|
12
14
|
'ap-southeast-1',
|
|
13
15
|
'ap-southeast-2',
|
|
16
|
+
'ca-central-1',
|
|
14
17
|
'eu-central-1',
|
|
18
|
+
'eu-north-1',
|
|
15
19
|
'eu-west-1',
|
|
20
|
+
'eu-west-2',
|
|
21
|
+
'eu-west-3',
|
|
22
|
+
'sa-east-1',
|
|
16
23
|
'us-east-1',
|
|
17
24
|
'us-east-2',
|
|
18
25
|
'us-west-2',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aws-targets.js","sourceRoot":"","sources":["../../../src/schema/schemas/aws-targets.ts"],"names":[],"mappings":";;;AAAA,yCAAsC;AACtC,6BAAwB;AAExB,+EAA+E;AAC/E,oBAAoB;AACpB,+EAA+E;AAElE,QAAA,qBAAqB,GAAG,OAAC,CAAC,IAAI,CAAC;IAC1C,gBAAgB;IAChB,YAAY;IACZ,gBAAgB;IAChB,gBAAgB;IAChB,cAAc;IACd,WAAW;IACX,WAAW;IACX,WAAW;IACX,WAAW;CACZ,CAAC,CAAC;AAGH,+EAA+E;AAC/E,yBAAyB;AACzB,+EAA+E;AAElE,QAAA,0BAA0B,GAAG,OAAC;KACxC,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,GAAG,CAAC,EAAE,CAAC;KACP,KAAK,CACJ,0BAA0B,EAC1B,kGAAkG,CACnG;KACA,QAAQ,CAAC,6CAA6C,CAAC,CAAC;AAE3D,+EAA+E;AAC/E,iBAAiB;AACjB,+EAA+E;AAElE,QAAA,kBAAkB,GAAG,OAAC;KAChC,MAAM,EAAE;KACR,KAAK,CAAC,aAAa,EAAE,0CAA0C,CAAC;KAChE,QAAQ,CAAC,gBAAgB,CAAC,CAAC;AAE9B,+EAA+E;AAC/E,wBAAwB;AACxB,+EAA+E;AAElE,QAAA,yBAAyB,GAAG,OAAC,CAAC,MAAM,CAAC;IAChD,IAAI,EAAE,kCAA0B;IAChC,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CA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