@friggframework/devtools 2.0.0--canary.461.8f65f96.0 → 2.0.0--canary.461.41c835a.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.
|
@@ -288,7 +288,7 @@ class AuroraBuilder extends InfrastructureBuilder {
|
|
|
288
288
|
SecretStringTemplate: JSON.stringify({ username: dbConfig.username || 'postgres' }),
|
|
289
289
|
GenerateStringKey: 'password',
|
|
290
290
|
PasswordLength: 32,
|
|
291
|
-
ExcludeCharacters: '"
|
|
291
|
+
ExcludeCharacters: '"@/\\\\',
|
|
292
292
|
},
|
|
293
293
|
Tags: [
|
|
294
294
|
{ Key: 'Name', Value: '${self:service}-${self:provider.stage}-db-secret' },
|
|
@@ -497,6 +497,34 @@ describe('AuroraBuilder', () => {
|
|
|
497
497
|
expect(result.environment.DATABASE_HOST).toBe('cluster.abc.us-east-1.rds.amazonaws.com');
|
|
498
498
|
expect(result.environment.DATABASE_PORT).toBe('5432');
|
|
499
499
|
});
|
|
500
|
+
|
|
501
|
+
it('should generate valid CloudFormation ZipFile code without template literal conflicts', async () => {
|
|
502
|
+
const appDefinition = {
|
|
503
|
+
database: {
|
|
504
|
+
postgres: {
|
|
505
|
+
enable: true,
|
|
506
|
+
management: 'discover',
|
|
507
|
+
autoCreateCredentials: true,
|
|
508
|
+
},
|
|
509
|
+
},
|
|
510
|
+
};
|
|
511
|
+
|
|
512
|
+
const discoveredResources = {
|
|
513
|
+
auroraClusterEndpoint: 'cluster.abc.us-east-1.rds.amazonaws.com',
|
|
514
|
+
auroraPort: 5432,
|
|
515
|
+
};
|
|
516
|
+
|
|
517
|
+
const result = await auroraBuilder.build(appDefinition, discoveredResources);
|
|
518
|
+
|
|
519
|
+
const zipFileCode = result.resources.PasswordRotatorLambda.Properties.Code.ZipFile;
|
|
520
|
+
|
|
521
|
+
// Should not contain template literals that would conflict with CloudFormation ${} substitution
|
|
522
|
+
// CloudFormation uses ${} for parameter substitution, so we should avoid `${variable}` in ZipFile
|
|
523
|
+
expect(zipFileCode).not.toMatch(/`.*\$\{(?!env:).*\}`/); // No template literals with ${} except ${env:...}
|
|
524
|
+
|
|
525
|
+
// Should use string concatenation instead
|
|
526
|
+
expect(zipFileCode).toContain("'Successfully rotated password for cluster: ' + ClusterIdentifier");
|
|
527
|
+
});
|
|
500
528
|
});
|
|
501
529
|
});
|
|
502
530
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@friggframework/devtools",
|
|
3
3
|
"prettier": "@friggframework/prettier-config",
|
|
4
|
-
"version": "2.0.0--canary.461.
|
|
4
|
+
"version": "2.0.0--canary.461.41c835a.0",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@aws-sdk/client-ec2": "^3.835.0",
|
|
7
7
|
"@aws-sdk/client-kms": "^3.835.0",
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"@babel/eslint-parser": "^7.18.9",
|
|
12
12
|
"@babel/parser": "^7.25.3",
|
|
13
13
|
"@babel/traverse": "^7.25.3",
|
|
14
|
-
"@friggframework/schemas": "2.0.0--canary.461.
|
|
15
|
-
"@friggframework/test": "2.0.0--canary.461.
|
|
14
|
+
"@friggframework/schemas": "2.0.0--canary.461.41c835a.0",
|
|
15
|
+
"@friggframework/test": "2.0.0--canary.461.41c835a.0",
|
|
16
16
|
"@hapi/boom": "^10.0.1",
|
|
17
17
|
"@inquirer/prompts": "^5.3.8",
|
|
18
18
|
"axios": "^1.7.2",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"serverless-http": "^2.7.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@friggframework/eslint-config": "2.0.0--canary.461.
|
|
38
|
-
"@friggframework/prettier-config": "2.0.0--canary.461.
|
|
37
|
+
"@friggframework/eslint-config": "2.0.0--canary.461.41c835a.0",
|
|
38
|
+
"@friggframework/prettier-config": "2.0.0--canary.461.41c835a.0",
|
|
39
39
|
"aws-sdk-client-mock": "^4.1.0",
|
|
40
40
|
"aws-sdk-client-mock-jest": "^4.1.0",
|
|
41
41
|
"jest": "^30.1.3",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"publishConfig": {
|
|
71
71
|
"access": "public"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "41c835ab632e6cb39b585b16663981525975ae6a"
|
|
74
74
|
}
|