@aws/nx-plugin 0.119.0 → 0.120.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/package.json +1 -1
- package/src/preset/generator.js +1 -0
- package/src/preset/generator.js.map +1 -1
- package/src/py/agent/generator.js +4 -1
- package/src/py/agent/generator.js.map +1 -1
- package/src/py/agent/schema.json +1 -1
- package/src/py/fast-api/__snapshots__/generator.spec.ts.snap +197 -12
- package/src/py/fast-api/generator.js +9 -0
- package/src/py/fast-api/generator.js.map +1 -1
- package/src/py/fast-api/schema.d.ts +1 -1
- package/src/py/fast-api/schema.json +2 -2
- package/src/py/mcp-server/generator.js +3 -0
- package/src/py/mcp-server/generator.js.map +1 -1
- package/src/py/mcp-server/schema.json +1 -1
- package/src/smithy/ts/api/__snapshots__/generator.spec.ts.snap +195 -11
- package/src/smithy/ts/api/generator.js +18 -0
- package/src/smithy/ts/api/generator.js.map +1 -1
- package/src/smithy/ts/api/schema.d.ts +1 -1
- package/src/smithy/ts/api/schema.json +2 -2
- package/src/trpc/backend/__snapshots__/generator.spec.ts.snap +258 -25
- package/src/trpc/backend/generator.js +19 -0
- package/src/trpc/backend/generator.js.map +1 -1
- package/src/trpc/backend/schema.d.ts +1 -1
- package/src/trpc/backend/schema.json +2 -2
- package/src/trpc/react/__snapshots__/generator.spec.ts.snap +28 -18
- package/src/trpc/react/files/src/components/__apiNameClassName__ClientProvider.tsx.template +9 -6
- package/src/trpc/react/generator.js +2 -6
- package/src/trpc/react/generator.js.map +1 -1
- package/src/ts/agent/generator.js +4 -1
- package/src/ts/agent/generator.js.map +1 -1
- package/src/ts/agent/schema.json +1 -1
- package/src/ts/mcp-server/generator.js +3 -0
- package/src/ts/mcp-server/generator.js.map +1 -1
- package/src/ts/mcp-server/schema.json +1 -1
- package/src/utils/api-constructs/api-constructs.d.ts +3 -1
- package/src/utils/api-constructs/api-constructs.js.map +1 -1
- package/src/utils/api-constructs/files/cdk/app/apis/http/__apiNameKebabCase__.ts.template +38 -6
- package/src/utils/api-constructs/files/cdk/app/apis/rest/__apiNameKebabCase__.ts.template +39 -3
- package/src/utils/api-constructs/files/cdk/authorizer/http/authorizer.ts.template +34 -0
- package/src/utils/api-constructs/files/cdk/authorizer/rest/authorizer.ts.template +52 -0
- package/src/utils/api-constructs/files/py-authorizer/http/authorizer.py.template +25 -0
- package/src/utils/api-constructs/files/py-authorizer/rest/authorizer.py.template +39 -0
- package/src/utils/api-constructs/files/terraform/app/apis/http/__apiNameKebabCase__/__apiNameKebabCase__.tf.template +112 -5
- package/src/utils/api-constructs/files/terraform/app/apis/rest/__apiNameKebabCase__/__apiNameKebabCase__.tf.template +114 -6
- package/src/utils/connection/open-api/react.d.ts +1 -1
|
@@ -899,6 +899,98 @@ resource "aws_cloudwatch_log_group" "lambda_logs" {
|
|
|
899
899
|
}
|
|
900
900
|
|
|
901
901
|
|
|
902
|
+
# Custom Lambda Authorizer
|
|
903
|
+
resource "aws_lambda_function" "authorizer_lambda" {
|
|
904
|
+
#checkov:skip=CKV_AWS_117:Lambda function does not need to be in VPC for this use case
|
|
905
|
+
#checkov:skip=CKV_AWS_116:Dead Letter Queue not required for authorizer
|
|
906
|
+
#checkov:skip=CKV_AWS_272:Code signing not required for this use case
|
|
907
|
+
#checkov:skip=CKV_AWS_115:Concurrent execution limit not required for this use case
|
|
908
|
+
#checkov:skip=CKV_AWS_173:Lambda environment variables encrypted by managed key
|
|
909
|
+
s3_bucket = aws_s3_object.authorizer_zip.bucket
|
|
910
|
+
s3_key = aws_s3_object.authorizer_zip.key
|
|
911
|
+
s3_object_version = aws_s3_object.authorizer_zip.version_id
|
|
912
|
+
function_name = "TestApiAuthorizer-\${random_string.suffix.result}"
|
|
913
|
+
role = aws_iam_role.authorizer_execution_role.arn
|
|
914
|
+
handler = "index.handler"
|
|
915
|
+
runtime = "nodejs22.x"
|
|
916
|
+
timeout = 10
|
|
917
|
+
memory_size = 128
|
|
918
|
+
|
|
919
|
+
source_code_hash = data.archive_file.authorizer_zip.output_base64sha256
|
|
920
|
+
|
|
921
|
+
tracing_config {
|
|
922
|
+
mode = "Active"
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
tags = var.tags
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
resource "aws_iam_role" "authorizer_execution_role" {
|
|
929
|
+
name = "TestApiAuthorizer-role-\${random_string.suffix.result}"
|
|
930
|
+
|
|
931
|
+
assume_role_policy = jsonencode({
|
|
932
|
+
Version = "2012-10-17"
|
|
933
|
+
Statement = [
|
|
934
|
+
{
|
|
935
|
+
Action = "sts:AssumeRole"
|
|
936
|
+
Effect = "Allow"
|
|
937
|
+
Principal = {
|
|
938
|
+
Service = "lambda.amazonaws.com"
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
]
|
|
942
|
+
})
|
|
943
|
+
|
|
944
|
+
tags = var.tags
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
resource "aws_iam_role_policy_attachment" "authorizer_basic_execution" {
|
|
948
|
+
policy_arn = "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
|
|
949
|
+
role = aws_iam_role.authorizer_execution_role.name
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
resource "aws_iam_role_policy_attachment" "authorizer_xray_execution" {
|
|
953
|
+
policy_arn = "arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess"
|
|
954
|
+
role = aws_iam_role.authorizer_execution_role.name
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
resource "aws_cloudwatch_log_group" "authorizer_logs" {
|
|
958
|
+
#checkov:skip=CKV_AWS_158:Using default CloudWatch log encryption
|
|
959
|
+
#checkov:skip=CKV_AWS_338:Log retention set to forever
|
|
960
|
+
#checkov:skip=CKV_AWS_66:Log retention set to forever
|
|
961
|
+
name = "/aws/lambda/TestApiAuthorizer-\${random_string.suffix.result}"
|
|
962
|
+
tags = var.tags
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
data "archive_file" "authorizer_zip" {
|
|
966
|
+
type = "zip"
|
|
967
|
+
source_dir = "\${path.module}/../../../../../../../dist/test-api/backend/bundle/authorizer"
|
|
968
|
+
output_path = "\${path.module}/../../../../../../../dist/packages/common/terraform/apis/test-api/authorizer.zip"
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
resource "aws_s3_object" "authorizer_zip" {
|
|
972
|
+
bucket = var.asset_bucket_name
|
|
973
|
+
key = "apis/test-api/authorizer-\${data.archive_file.authorizer_zip.output_sha256}.zip"
|
|
974
|
+
source = data.archive_file.authorizer_zip.output_path
|
|
975
|
+
source_hash = data.archive_file.authorizer_zip.output_base64sha256
|
|
976
|
+
etag = data.archive_file.authorizer_zip.output_md5
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
resource "aws_api_gateway_authorizer" "custom_authorizer" {
|
|
980
|
+
name = "TestApiAuthorizer-\${random_string.suffix.result}"
|
|
981
|
+
rest_api_id = module.rest_api.api_id
|
|
982
|
+
type = "TOKEN"
|
|
983
|
+
authorizer_uri = aws_lambda_function.authorizer_lambda.invoke_arn
|
|
984
|
+
identity_source = "method.request.header.Authorization"
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
resource "aws_lambda_permission" "authorizer_invoke" {
|
|
988
|
+
statement_id = "AllowAPIGatewayInvokeAuthorizer"
|
|
989
|
+
action = "lambda:InvokeFunction"
|
|
990
|
+
function_name = aws_lambda_function.authorizer_lambda.function_name
|
|
991
|
+
principal = "apigateway.amazonaws.com"
|
|
992
|
+
source_arn = "\${module.rest_api.api_execution_arn}/authorizers/\${aws_api_gateway_authorizer.custom_authorizer.id}"
|
|
993
|
+
}
|
|
902
994
|
|
|
903
995
|
# Create proxy resource (captures all paths)
|
|
904
996
|
resource "aws_api_gateway_resource" "proxy_resource" {
|
|
@@ -927,15 +1019,14 @@ resource "aws_api_gateway_method" "proxy_method" {
|
|
|
927
1019
|
resource_id = aws_api_gateway_resource.proxy_resource.id
|
|
928
1020
|
http_method = "ANY"
|
|
929
1021
|
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
authorization = "NONE"
|
|
1022
|
+
authorization = "CUSTOM"
|
|
1023
|
+
authorizer_id = aws_api_gateway_authorizer.custom_authorizer.id
|
|
933
1024
|
|
|
934
1025
|
request_parameters = {
|
|
935
1026
|
"method.request.path.proxy" = true
|
|
936
1027
|
}
|
|
937
1028
|
|
|
938
|
-
depends_on = []
|
|
1029
|
+
depends_on = [aws_api_gateway_authorizer.custom_authorizer]
|
|
939
1030
|
}
|
|
940
1031
|
|
|
941
1032
|
# OPTIONS method for CORS preflight
|
|
@@ -1013,6 +1104,7 @@ resource "aws_api_gateway_deployment" "api_deployment" {
|
|
|
1013
1104
|
aws_api_gateway_integration.options_integration,
|
|
1014
1105
|
aws_api_gateway_method_response.options_response,
|
|
1015
1106
|
aws_api_gateway_integration_response.options_integration_response,
|
|
1107
|
+
aws_api_gateway_authorizer.custom_authorizer,
|
|
1016
1108
|
]
|
|
1017
1109
|
}
|
|
1018
1110
|
|
|
@@ -1041,7 +1133,7 @@ resource "aws_api_gateway_rest_api_policy" "api_policy" {
|
|
|
1041
1133
|
Version = "2012-10-17"
|
|
1042
1134
|
Statement = [
|
|
1043
1135
|
{
|
|
1044
|
-
# Allow all callers to invoke the API in the resource policy
|
|
1136
|
+
# Allow all callers to invoke the API in the resource policy, since auth is handled by the Lambda Authorizer
|
|
1045
1137
|
Effect = "Allow"
|
|
1046
1138
|
Principal = "*"
|
|
1047
1139
|
Action = "execute-api:Invoke"
|
|
@@ -1231,7 +1323,7 @@ exports[`tsSmithyApiGenerator > should generate smithy ts api with default optio
|
|
|
1231
1323
|
"metadata": {
|
|
1232
1324
|
"generator": "ts#smithy-api",
|
|
1233
1325
|
"apiName": "test-api",
|
|
1234
|
-
"auth": "
|
|
1326
|
+
"auth": "Custom",
|
|
1235
1327
|
"modelProject": "@proj/test-api-model",
|
|
1236
1328
|
"ports": [3001]
|
|
1237
1329
|
},
|
|
@@ -3399,6 +3491,98 @@ resource "aws_cloudwatch_log_group" "lambda_logs" {
|
|
|
3399
3491
|
}
|
|
3400
3492
|
|
|
3401
3493
|
|
|
3494
|
+
# Custom Lambda Authorizer
|
|
3495
|
+
resource "aws_lambda_function" "authorizer_lambda" {
|
|
3496
|
+
#checkov:skip=CKV_AWS_117:Lambda function does not need to be in VPC for this use case
|
|
3497
|
+
#checkov:skip=CKV_AWS_116:Dead Letter Queue not required for authorizer
|
|
3498
|
+
#checkov:skip=CKV_AWS_272:Code signing not required for this use case
|
|
3499
|
+
#checkov:skip=CKV_AWS_115:Concurrent execution limit not required for this use case
|
|
3500
|
+
#checkov:skip=CKV_AWS_173:Lambda environment variables encrypted by managed key
|
|
3501
|
+
s3_bucket = aws_s3_object.authorizer_zip.bucket
|
|
3502
|
+
s3_key = aws_s3_object.authorizer_zip.key
|
|
3503
|
+
s3_object_version = aws_s3_object.authorizer_zip.version_id
|
|
3504
|
+
function_name = "CustomApiAuthorizer-\${random_string.suffix.result}"
|
|
3505
|
+
role = aws_iam_role.authorizer_execution_role.arn
|
|
3506
|
+
handler = "index.handler"
|
|
3507
|
+
runtime = "nodejs22.x"
|
|
3508
|
+
timeout = 10
|
|
3509
|
+
memory_size = 128
|
|
3510
|
+
|
|
3511
|
+
source_code_hash = data.archive_file.authorizer_zip.output_base64sha256
|
|
3512
|
+
|
|
3513
|
+
tracing_config {
|
|
3514
|
+
mode = "Active"
|
|
3515
|
+
}
|
|
3516
|
+
|
|
3517
|
+
tags = var.tags
|
|
3518
|
+
}
|
|
3519
|
+
|
|
3520
|
+
resource "aws_iam_role" "authorizer_execution_role" {
|
|
3521
|
+
name = "CustomApiAuthorizer-role-\${random_string.suffix.result}"
|
|
3522
|
+
|
|
3523
|
+
assume_role_policy = jsonencode({
|
|
3524
|
+
Version = "2012-10-17"
|
|
3525
|
+
Statement = [
|
|
3526
|
+
{
|
|
3527
|
+
Action = "sts:AssumeRole"
|
|
3528
|
+
Effect = "Allow"
|
|
3529
|
+
Principal = {
|
|
3530
|
+
Service = "lambda.amazonaws.com"
|
|
3531
|
+
}
|
|
3532
|
+
}
|
|
3533
|
+
]
|
|
3534
|
+
})
|
|
3535
|
+
|
|
3536
|
+
tags = var.tags
|
|
3537
|
+
}
|
|
3538
|
+
|
|
3539
|
+
resource "aws_iam_role_policy_attachment" "authorizer_basic_execution" {
|
|
3540
|
+
policy_arn = "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
|
|
3541
|
+
role = aws_iam_role.authorizer_execution_role.name
|
|
3542
|
+
}
|
|
3543
|
+
|
|
3544
|
+
resource "aws_iam_role_policy_attachment" "authorizer_xray_execution" {
|
|
3545
|
+
policy_arn = "arn:aws:iam::aws:policy/AWSXRayDaemonWriteAccess"
|
|
3546
|
+
role = aws_iam_role.authorizer_execution_role.name
|
|
3547
|
+
}
|
|
3548
|
+
|
|
3549
|
+
resource "aws_cloudwatch_log_group" "authorizer_logs" {
|
|
3550
|
+
#checkov:skip=CKV_AWS_158:Using default CloudWatch log encryption
|
|
3551
|
+
#checkov:skip=CKV_AWS_338:Log retention set to forever
|
|
3552
|
+
#checkov:skip=CKV_AWS_66:Log retention set to forever
|
|
3553
|
+
name = "/aws/lambda/CustomApiAuthorizer-\${random_string.suffix.result}"
|
|
3554
|
+
tags = var.tags
|
|
3555
|
+
}
|
|
3556
|
+
|
|
3557
|
+
data "archive_file" "authorizer_zip" {
|
|
3558
|
+
type = "zip"
|
|
3559
|
+
source_dir = "\${path.module}/../../../../../../../dist/custom-api/backend/bundle/authorizer"
|
|
3560
|
+
output_path = "\${path.module}/../../../../../../../dist/packages/common/terraform/apis/custom-api/authorizer.zip"
|
|
3561
|
+
}
|
|
3562
|
+
|
|
3563
|
+
resource "aws_s3_object" "authorizer_zip" {
|
|
3564
|
+
bucket = var.asset_bucket_name
|
|
3565
|
+
key = "apis/custom-api/authorizer-\${data.archive_file.authorizer_zip.output_sha256}.zip"
|
|
3566
|
+
source = data.archive_file.authorizer_zip.output_path
|
|
3567
|
+
source_hash = data.archive_file.authorizer_zip.output_base64sha256
|
|
3568
|
+
etag = data.archive_file.authorizer_zip.output_md5
|
|
3569
|
+
}
|
|
3570
|
+
|
|
3571
|
+
resource "aws_api_gateway_authorizer" "custom_authorizer" {
|
|
3572
|
+
name = "CustomApiAuthorizer-\${random_string.suffix.result}"
|
|
3573
|
+
rest_api_id = module.rest_api.api_id
|
|
3574
|
+
type = "TOKEN"
|
|
3575
|
+
authorizer_uri = aws_lambda_function.authorizer_lambda.invoke_arn
|
|
3576
|
+
identity_source = "method.request.header.Authorization"
|
|
3577
|
+
}
|
|
3578
|
+
|
|
3579
|
+
resource "aws_lambda_permission" "authorizer_invoke" {
|
|
3580
|
+
statement_id = "AllowAPIGatewayInvokeAuthorizer"
|
|
3581
|
+
action = "lambda:InvokeFunction"
|
|
3582
|
+
function_name = aws_lambda_function.authorizer_lambda.function_name
|
|
3583
|
+
principal = "apigateway.amazonaws.com"
|
|
3584
|
+
source_arn = "\${module.rest_api.api_execution_arn}/authorizers/\${aws_api_gateway_authorizer.custom_authorizer.id}"
|
|
3585
|
+
}
|
|
3402
3586
|
|
|
3403
3587
|
# Create proxy resource (captures all paths)
|
|
3404
3588
|
resource "aws_api_gateway_resource" "proxy_resource" {
|
|
@@ -3427,15 +3611,14 @@ resource "aws_api_gateway_method" "proxy_method" {
|
|
|
3427
3611
|
resource_id = aws_api_gateway_resource.proxy_resource.id
|
|
3428
3612
|
http_method = "ANY"
|
|
3429
3613
|
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
authorization = "NONE"
|
|
3614
|
+
authorization = "CUSTOM"
|
|
3615
|
+
authorizer_id = aws_api_gateway_authorizer.custom_authorizer.id
|
|
3433
3616
|
|
|
3434
3617
|
request_parameters = {
|
|
3435
3618
|
"method.request.path.proxy" = true
|
|
3436
3619
|
}
|
|
3437
3620
|
|
|
3438
|
-
depends_on = []
|
|
3621
|
+
depends_on = [aws_api_gateway_authorizer.custom_authorizer]
|
|
3439
3622
|
}
|
|
3440
3623
|
|
|
3441
3624
|
# OPTIONS method for CORS preflight
|
|
@@ -3513,6 +3696,7 @@ resource "aws_api_gateway_deployment" "api_deployment" {
|
|
|
3513
3696
|
aws_api_gateway_integration.options_integration,
|
|
3514
3697
|
aws_api_gateway_method_response.options_response,
|
|
3515
3698
|
aws_api_gateway_integration_response.options_integration_response,
|
|
3699
|
+
aws_api_gateway_authorizer.custom_authorizer,
|
|
3516
3700
|
]
|
|
3517
3701
|
}
|
|
3518
3702
|
|
|
@@ -3541,7 +3725,7 @@ resource "aws_api_gateway_rest_api_policy" "api_policy" {
|
|
|
3541
3725
|
Version = "2012-10-17"
|
|
3542
3726
|
Statement = [
|
|
3543
3727
|
{
|
|
3544
|
-
# Allow all callers to invoke the API in the resource policy
|
|
3728
|
+
# Allow all callers to invoke the API in the resource policy, since auth is handled by the Lambda Authorizer
|
|
3545
3729
|
Effect = "Allow"
|
|
3546
3730
|
Principal = "*"
|
|
3547
3731
|
Action = "execute-api:Invoke"
|
|
@@ -66,6 +66,11 @@ const tsSmithyApiGenerator = async (tree, options) => {
|
|
|
66
66
|
apiNameClassName,
|
|
67
67
|
port,
|
|
68
68
|
});
|
|
69
|
+
if (options.auth === 'Custom') {
|
|
70
|
+
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '..', '..', '..', 'utils', 'api-constructs', 'files', 'cdk', 'authorizer', 'rest'), backendProjectConfig.sourceRoot, {}, {
|
|
71
|
+
overwriteStrategy: devkit_1.OverwriteStrategy.KeepExisting,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
69
74
|
// Add infrastructure
|
|
70
75
|
const iacProvider = await (0, iac_1.resolveIacProvider)(tree, options.iacProvider);
|
|
71
76
|
await (0, shared_constructs_1.sharedConstructsGenerator)(tree, {
|
|
@@ -82,6 +87,9 @@ const tsSmithyApiGenerator = async (tree, options) => {
|
|
|
82
87
|
type: 'smithy',
|
|
83
88
|
bundleOutputDir: (0, devkit_1.joinPathFragments)('dist', backendProjectConfig.root, 'bundle'),
|
|
84
89
|
integrationPattern,
|
|
90
|
+
...(options.auth === 'Custom' && {
|
|
91
|
+
authorizerBundleOutputDir: (0, devkit_1.joinPathFragments)('dist', backendProjectConfig.root, 'bundle', 'authorizer'),
|
|
92
|
+
}),
|
|
85
93
|
},
|
|
86
94
|
});
|
|
87
95
|
(0, open_api_metadata_1.addSharedConstructsOpenApiMetadataGenerateTarget)(tree, {
|
|
@@ -95,6 +103,13 @@ const tsSmithyApiGenerator = async (tree, options) => {
|
|
|
95
103
|
targetFilePath: 'src/handler.ts',
|
|
96
104
|
external: [/@aws-sdk\/.*/], // lambda runtime provides aws sdk
|
|
97
105
|
});
|
|
106
|
+
if (options.auth === 'Custom') {
|
|
107
|
+
await (0, bundle_1.addTypeScriptBundleTarget)(tree, backendProjectConfig, {
|
|
108
|
+
targetFilePath: 'src/authorizer.ts',
|
|
109
|
+
bundleOutputDir: 'authorizer',
|
|
110
|
+
external: [/@aws-sdk\/.*/],
|
|
111
|
+
});
|
|
112
|
+
}
|
|
98
113
|
const cmd = new fs_1.FsCommands(tree);
|
|
99
114
|
const generatedSrcDirFromRoot = '{projectRoot}/src/generated';
|
|
100
115
|
// Target for copying the ssdk built by the model
|
|
@@ -162,6 +177,9 @@ const tsSmithyApiGenerator = async (tree, options) => {
|
|
|
162
177
|
'@aws-lambda-powertools/tracer',
|
|
163
178
|
'@aws-lambda-powertools/metrics',
|
|
164
179
|
'@aws-sdk/client-appconfigdata',
|
|
180
|
+
...(options.auth === 'Custom'
|
|
181
|
+
? ['@aws-lambda-powertools/parser']
|
|
182
|
+
: []),
|
|
165
183
|
]), (0, versions_1.withVersions)(['@types/aws-lambda']));
|
|
166
184
|
await (0, metrics_1.addGeneratorMetricsIfApplicable)(tree, [exports.TS_SMITHY_API_GENERATOR_INFO]);
|
|
167
185
|
await (0, format_1.formatFilesInSubtree)(tree);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/nx-plugin/src/smithy/ts/api/generator.ts"],"names":[],"mappings":";;;;AAAA;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../packages/nx-plugin/src/smithy/ts/api/generator.ts"],"names":[],"mappings":";;;;AAAA;;;GAGG;AACH,uCASoB;AAEpB,0CAM2B;AAC3B,oDAAyE;AACzE,kDAA6D;AAC7D,4CAAwD;AACxD,wEAA6E;AAC7E,gDAAgE;AAChE,+EAAgF;AAChF,8CAAiD;AACjD,sDAAuD;AACvD,gFAA6D;AAC7D,yDAAyE;AACzE,4CAAqD;AACrD,mDAAkE;AAClE,0CAA+C;AAC/C,iFAAkF;AAClF,uFAAmH;AAEtG,QAAA,4BAA4B,GACvC,IAAA,qBAAgB,EAAC,UAAU,CAAC,CAAC;AAExB,MAAM,oBAAoB,GAAG,KAAK,EACvC,IAAU,EACV,OAAmC,EACP,EAAE;IAC9B,MAAM,kBAAkB,GAAG,qBAAqB,CAAC,OAAO,CAAC,CAAC;IAC1D,MAAM,gBAAgB,GAAG,IAAA,mBAAW,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACnD,MAAM,gBAAgB,GAAG,IAAA,mBAAW,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACnD,MAAM,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,GAAG,EAAE,GAC1D,IAAA,2BAAe,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACjC,MAAM,gBAAgB,GAAG,GAAG,gBAAgB,QAAQ,CAAC;IAErD,6BAA6B;IAC7B,MAAM,IAAA,mBAAsB,EAAC,IAAI,EAAE;QACjC,IAAI,EAAE,gBAAgB;QACtB,WAAW,EAAE,gBAAgB;QAC7B,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,SAAS,EAAE,GAAG;QACd,YAAY,EAAE,OAAO;KACtB,CAAC,CAAC;IAEH,+DAA+D;IAC/D,MAAM,kBAA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KACR,CAAC,EACF,IAAA,uBAAY,EAAC,CAAC,mBAAmB,CAAC,CAAC,CACpC,CAAC;IAEF,MAAM,IAAA,yCAA+B,EAAC,IAAI,EAAE,CAAC,oCAA4B,CAAC,CAAC,CAAC;IAE5E,MAAM,IAAA,6BAAoB,EAAC,IAAI,CAAC,CAAC;IACjC,OAAO,GAAG,EAAE;QACV,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC;AACJ,CAAC,CAAC;AA9PW,QAAA,oBAAoB,wBA8P/B;AAEF,MAAM,qBAAqB,GAAG,CAC5B,OAAmC,EACZ,EAAE,CAAC,OAAO,CAAC,kBAAkB,IAAI,UAAU,CAAC;AAErE,kBAAe,4BAAoB,CAAC"}
|
|
@@ -12,7 +12,7 @@ export interface TsSmithyApiGeneratorSchema {
|
|
|
12
12
|
// https://smithy.io/2.0/languages/typescript/ts-ssdk/supported-endpoints.html#amazon-api-gateway-rest-apis-and-aws-lambda
|
|
13
13
|
computeType: 'ServerlessApiGatewayRestApi';
|
|
14
14
|
integrationPattern?: 'isolated' | 'shared';
|
|
15
|
-
auth: 'IAM' | 'Cognito' | '
|
|
15
|
+
auth: 'IAM' | 'Cognito' | 'Custom';
|
|
16
16
|
directory?: TsProjectGeneratorSchema['directory'];
|
|
17
17
|
subDirectory?: TsProjectGeneratorSchema['subDirectory'];
|
|
18
18
|
iacProvider: IacProviderOption;
|
|
@@ -51,9 +51,9 @@
|
|
|
51
51
|
},
|
|
52
52
|
"auth": {
|
|
53
53
|
"type": "string",
|
|
54
|
-
"description": "The method used to authenticate with your API. Choose between IAM (default), Cognito or
|
|
54
|
+
"description": "The method used to authenticate with your API. Choose between IAM (default), Cognito or Custom.",
|
|
55
55
|
"default": "IAM",
|
|
56
|
-
"enum": ["IAM", "Cognito", "
|
|
56
|
+
"enum": ["IAM", "Cognito", "Custom"],
|
|
57
57
|
"x-prompt": "How would you like users to authenticate with your API?",
|
|
58
58
|
"x-priority": "important"
|
|
59
59
|
},
|