cdk-factory 0.8.0__py3-none-any.whl → 0.8.1__py3-none-any.whl
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.
Potentially problematic release.
This version of cdk-factory might be problematic. Click here for more details.
- cdk_factory/configurations/enhanced_ssm_config.py +3 -1
- cdk_factory/stack_library/api_gateway/api_gateway_stack.py +20 -1
- cdk_factory/utilities/api_gateway_integration_utility.py +7 -0
- cdk_factory/version.py +1 -1
- {cdk_factory-0.8.0.dist-info → cdk_factory-0.8.1.dist-info}/METADATA +1 -1
- {cdk_factory-0.8.0.dist-info → cdk_factory-0.8.1.dist-info}/RECORD +8 -8
- {cdk_factory-0.8.0.dist-info → cdk_factory-0.8.1.dist-info}/WHEEL +0 -0
- {cdk_factory-0.8.0.dist-info → cdk_factory-0.8.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -86,7 +86,9 @@ class EnhancedSsmConfig:
|
|
|
86
86
|
self, attribute: str, custom_path: Optional[str] = None
|
|
87
87
|
) -> str:
|
|
88
88
|
"""Generate SSM parameter path using pattern or custom path"""
|
|
89
|
-
|
|
89
|
+
# Handle custom_path - must be a string starting with "/"
|
|
90
|
+
# Protect against incorrect config like: "exports": {"enabled": true}
|
|
91
|
+
if custom_path and isinstance(custom_path, str) and custom_path.startswith("/"):
|
|
90
92
|
return custom_path
|
|
91
93
|
|
|
92
94
|
# Convert underscore attribute names to hyphen format for consistent SSM paths
|
|
@@ -304,9 +304,28 @@ class ApiGatewayStack(IStack, EnhancedSsmParameterMixin):
|
|
|
304
304
|
)
|
|
305
305
|
|
|
306
306
|
def _setup_cognito_authorizer(self, api_gateway, api_id):
|
|
307
|
-
"""Setup Cognito authorizer if configured"""
|
|
307
|
+
"""Setup Cognito authorizer if configured AND if any routes need it"""
|
|
308
308
|
if not self.api_config.cognito_authorizer:
|
|
309
309
|
return None
|
|
310
|
+
|
|
311
|
+
# Check if any routes actually need the authorizer
|
|
312
|
+
# Don't create it if all routes are public (authorization_type: NONE)
|
|
313
|
+
routes = self.api_config.routes or []
|
|
314
|
+
needs_authorizer = any(
|
|
315
|
+
route.get("authorization_type") != "NONE"
|
|
316
|
+
for route in routes
|
|
317
|
+
)
|
|
318
|
+
|
|
319
|
+
# If we're not creating an authorizer but Cognito is configured,
|
|
320
|
+
# inform the integration utility so it can still perform security validations
|
|
321
|
+
if not needs_authorizer:
|
|
322
|
+
logger.info(
|
|
323
|
+
"Cognito authorizer configured but no routes require authorization. "
|
|
324
|
+
"Skipping authorizer creation but maintaining security validation context."
|
|
325
|
+
)
|
|
326
|
+
# Set a flag so the integration utility knows Cognito was available
|
|
327
|
+
self.integration_utility.cognito_configured = True
|
|
328
|
+
return None
|
|
310
329
|
|
|
311
330
|
route_config = ApiGatewayConfigRouteConfig({})
|
|
312
331
|
return self.integration_utility.get_or_create_authorizer(
|
|
@@ -40,6 +40,7 @@ class ApiGatewayIntegrationUtility:
|
|
|
40
40
|
self.account = scope.account
|
|
41
41
|
self.api_gateway = None
|
|
42
42
|
self.authorizer = None
|
|
43
|
+
self.cognito_configured = False # Flag for when Cognito is configured but authorizer not created
|
|
43
44
|
self._log_group = None
|
|
44
45
|
self._log_role = None
|
|
45
46
|
|
|
@@ -55,8 +56,10 @@ class ApiGatewayIntegrationUtility:
|
|
|
55
56
|
raise ValueError("API Gateway config is missing in Lambda function config")
|
|
56
57
|
|
|
57
58
|
# Validate authorization configuration for security
|
|
59
|
+
# Check if Cognito is available (either authorizer created OR configured but not created)
|
|
58
60
|
has_cognito_authorizer = (
|
|
59
61
|
self.authorizer is not None
|
|
62
|
+
or self.cognito_configured
|
|
60
63
|
or self._get_existing_authorizer_id_with_ssm_fallback(
|
|
61
64
|
api_config, stack_config
|
|
62
65
|
)
|
|
@@ -614,6 +617,10 @@ class ApiGatewayIntegrationUtility:
|
|
|
614
617
|
authorizer_name=authorizer_name,
|
|
615
618
|
identity_source=identity_source,
|
|
616
619
|
)
|
|
620
|
+
|
|
621
|
+
# The authorizer is automatically attached to the API Gateway when used in a method
|
|
622
|
+
# But we need to ensure it's created in the context of the API's scope
|
|
623
|
+
# The actual attachment happens when the authorizer is referenced in method creation
|
|
617
624
|
|
|
618
625
|
return self.authorizer
|
|
619
626
|
|
cdk_factory/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.8.
|
|
1
|
+
__version__ = "0.8.1"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
cdk_factory/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
cdk_factory/app.py,sha256=xv863N7O6HPKznB68_t7O4la9JacrkG87t9TjoDUk7s,2827
|
|
3
3
|
cdk_factory/cdk.json,sha256=SKZKhJ2PBpFH78j-F8S3VDYW-lf76--Q2I3ON-ZIQfw,3106
|
|
4
|
-
cdk_factory/version.py,sha256=
|
|
4
|
+
cdk_factory/version.py,sha256=Ocl79hbbH8_jdr5dGC90VR1cAvZc05Rc0tkZttUnMjo,22
|
|
5
5
|
cdk_factory/builds/README.md,sha256=9BBWd7bXpyKdMU_g2UljhQwrC9i5O_Tvkb6oPvndoZk,90
|
|
6
6
|
cdk_factory/commands/command_loader.py,sha256=QbLquuP_AdxtlxlDy-2IWCQ6D-7qa58aphnDPtp_uTs,3744
|
|
7
7
|
cdk_factory/configurations/base_config.py,sha256=JKjhNsy0RCUZy1s8n5D_aXXI-upR9izaLtCTfKYiV9k,9624
|
|
@@ -10,7 +10,7 @@ cdk_factory/configurations/deployment.py,sha256=LO2gd1yv1nqlX_2MIjRXptylFybWiTKs
|
|
|
10
10
|
cdk_factory/configurations/deployment_wave.py,sha256=TFX7CYgr5SmLyziEb-R_OTteFWtlMHB4pT53ekV3d1Y,233
|
|
11
11
|
cdk_factory/configurations/devops.py,sha256=PG-s2ldZmMULheWdKf2lf2LSugLoKiOKyLELTZJJxu8,2506
|
|
12
12
|
cdk_factory/configurations/enhanced_base_config.py,sha256=Y1gcGZxyf_O2KFnVpCBORSGHWHqHxw0vNx_ijMad_QA,6654
|
|
13
|
-
cdk_factory/configurations/enhanced_ssm_config.py,sha256=
|
|
13
|
+
cdk_factory/configurations/enhanced_ssm_config.py,sha256=VDmIUSrj8nYS6fE9DdOp5yi9jUfMfitz5A7kCuPS-kI,12895
|
|
14
14
|
cdk_factory/configurations/management.py,sha256=TSOIyxO9hGNxbgiTsS8a3pz03ungXiNqPPtZtfOpr8M,1373
|
|
15
15
|
cdk_factory/configurations/pipeline.py,sha256=3RmRP1GIk42rjYZ-A9H3357RcO13IA47N-2IQcBkySQ,4939
|
|
16
16
|
cdk_factory/configurations/pipeline_stage.py,sha256=eAT-FoIepIuv5tObk4TXlCN47FaatQO2rrFchgbMdXU,3415
|
|
@@ -73,7 +73,7 @@ cdk_factory/stack/stack_module_registry.py,sha256=J14-A75VZESzRQa8p-Fepdap7Z8T7m
|
|
|
73
73
|
cdk_factory/stack/stack_modules.py,sha256=kgEK-j0smZPozVwTCfM1g1V17EyTBT0TXAQZq4vZz0o,784
|
|
74
74
|
cdk_factory/stack_library/__init__.py,sha256=5Y9TpIe8ZK1688G60PGcuP-hM0RvYEY_3Hl2qJCJJrw,581
|
|
75
75
|
cdk_factory/stack_library/stack_base.py,sha256=tTleSFmlf26DuKVF_ytftf8P7IVWb5iex8cYfYupfvQ,4940
|
|
76
|
-
cdk_factory/stack_library/api_gateway/api_gateway_stack.py,sha256=
|
|
76
|
+
cdk_factory/stack_library/api_gateway/api_gateway_stack.py,sha256=5rWHwLc6kI99YHUA1xqLtzcEhDmMB4p-xB9gLQ6o8JE,37916
|
|
77
77
|
cdk_factory/stack_library/auto_scaling/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
78
78
|
cdk_factory/stack_library/auto_scaling/auto_scaling_stack.py,sha256=UsFqUb_3XPJAlmZ6F75nXna3elOggD1KuFmmdmhi0Lg,19070
|
|
79
79
|
cdk_factory/stack_library/aws_lambdas/lambda_stack.py,sha256=SFbBPvvCopbyiuYtq-O5sQkFCf94Wzua6aDUXiFDSB4,26161
|
|
@@ -100,7 +100,7 @@ cdk_factory/stack_library/vpc/__init__.py,sha256=7pIqP97Gf2AJbv9Ebp1WbQGHYhgEbWJ
|
|
|
100
100
|
cdk_factory/stack_library/vpc/vpc_stack.py,sha256=zdDiGilf03esxuya5Z8zVYSVMAIuZBeD-ZKgfnEd6aw,10077
|
|
101
101
|
cdk_factory/stack_library/websites/static_website_stack.py,sha256=KBQiV6PI09mpHGtH-So5Hk3uhfFLDepoXInGbfin0cY,7938
|
|
102
102
|
cdk_factory/stages/websites/static_website_stage.py,sha256=X4fpKXkhb0zIbSHx3QyddBhVSLBryb1vf1Cg2fMTqog,755
|
|
103
|
-
cdk_factory/utilities/api_gateway_integration_utility.py,sha256=
|
|
103
|
+
cdk_factory/utilities/api_gateway_integration_utility.py,sha256=yblKiMIHGXqKb7JK5IbzGM_TXjX9j893BMqgqBT44DE,63449
|
|
104
104
|
cdk_factory/utilities/commandline_args.py,sha256=0FiNEJFbWVN8Ct7r0VHnJEx7rhUlaRKT7R7HMNJBSTI,2216
|
|
105
105
|
cdk_factory/utilities/configuration_loader.py,sha256=z0ZdGLNbTO4_yfluB9zUh_i_Poc9qj-7oRyjMRlNkN8,1522
|
|
106
106
|
cdk_factory/utilities/docker_utilities.py,sha256=9r8C-lXYpymqEfi3gTeWCQzHldvfjttPqn6p3j2khTE,8111
|
|
@@ -112,7 +112,7 @@ cdk_factory/utilities/lambda_function_utilities.py,sha256=j3tBdv_gC2MdEwBINDwAqY
|
|
|
112
112
|
cdk_factory/utilities/os_execute.py,sha256=5Op0LY_8Y-pUm04y1k8MTpNrmQvcLmQHPQITEP7EuSU,1019
|
|
113
113
|
cdk_factory/utils/api_gateway_utilities.py,sha256=If7Xu5s_UxmuV-kL3JkXxPLBdSVUKoLtohm0IUFoiV8,4378
|
|
114
114
|
cdk_factory/workload/workload_factory.py,sha256=yBUDGIuB8-5p_mGcVFxsD2ZoZIziak3yh3LL3JvS0M4,5903
|
|
115
|
-
cdk_factory-0.8.
|
|
116
|
-
cdk_factory-0.8.
|
|
117
|
-
cdk_factory-0.8.
|
|
118
|
-
cdk_factory-0.8.
|
|
115
|
+
cdk_factory-0.8.1.dist-info/METADATA,sha256=QzIZhYxS_Mu7hgXTGdT4yN4K0gtJP6Z1Cn1C7onszAg,2450
|
|
116
|
+
cdk_factory-0.8.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
117
|
+
cdk_factory-0.8.1.dist-info/licenses/LICENSE,sha256=NOtdOeLwg2il_XBJdXUPFPX8JlV4dqTdDGAd2-khxT8,1066
|
|
118
|
+
cdk_factory-0.8.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|