@friggframework/devtools 2.0.0--canary.540.4653c0a.0 → 2.0.0--canary.663.9683f8b.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/infrastructure/README.md
CHANGED
|
@@ -163,9 +163,11 @@ const appDefinition = {
|
|
|
163
163
|
enableVPCEndpoints: true // Optional: create VPC endpoints
|
|
164
164
|
},
|
|
165
165
|
|
|
166
|
-
//
|
|
166
|
+
// Field-level encryption. 'kms' wires KMS_KEY_ARN on every stage (dev too).
|
|
167
|
+
// A deployed stage with no key refuses to start; 'none' is the explicit
|
|
168
|
+
// plaintext opt-out (sets FRIGG_ENCRYPTION_DISABLED=true).
|
|
167
169
|
encryption: {
|
|
168
|
-
fieldLevelEncryptionMethod: 'kms',
|
|
170
|
+
fieldLevelEncryptionMethod: 'kms', // 'kms' | 'aes' | 'none'
|
|
169
171
|
createResourceIfNoneFound: true
|
|
170
172
|
},
|
|
171
173
|
|
|
@@ -72,6 +72,16 @@ function addLoggingEnv(appDefinition, envVars) {
|
|
|
72
72
|
envVars.FRIGG_LOG_LEVEL = normalized;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
+
// Field-level encryption fails closed in a deployed stage with no key (core's
|
|
76
|
+
// encryption-config.js). `fieldLevelEncryptionMethod: 'none'` is the explicit,
|
|
77
|
+
// documented way to run a stage in plaintext; core logs a warning on every
|
|
78
|
+
// cold start while it is set.
|
|
79
|
+
function addEncryptionEnv(appDefinition, envVars) {
|
|
80
|
+
if (appDefinition?.encryption?.fieldLevelEncryptionMethod === 'none') {
|
|
81
|
+
envVars.FRIGG_ENCRYPTION_DISABLED = 'true';
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
75
85
|
/**
|
|
76
86
|
* Get environment variables from AppDefinition
|
|
77
87
|
*
|
|
@@ -149,6 +159,7 @@ function getAppEnvironmentVars(appDefinition) {
|
|
|
149
159
|
}
|
|
150
160
|
|
|
151
161
|
addLoggingEnv(appDefinition, envVars);
|
|
162
|
+
addEncryptionEnv(appDefinition, envVars);
|
|
152
163
|
|
|
153
164
|
if (envKeys.length > 0) {
|
|
154
165
|
console.log(
|
|
@@ -187,7 +198,7 @@ function getAppEnvironmentVars(appDefinition) {
|
|
|
187
198
|
function buildEnvironment(appEnvironmentVars, discoveredResources) {
|
|
188
199
|
const environment = {
|
|
189
200
|
...appEnvironmentVars,
|
|
190
|
-
STAGE: '${self:provider.stage}', //
|
|
201
|
+
STAGE: '${self:provider.stage}', // Read by core: e.g. the local-only encryption bypass
|
|
191
202
|
FRIGG_STACK: '${self:service}',
|
|
192
203
|
FRIGG_STAGE: '${self:provider.stage}',
|
|
193
204
|
FRIGG_REGION: '${self:provider.region}',
|
|
@@ -468,6 +468,26 @@ describe('Environment Builder', () => {
|
|
|
468
468
|
});
|
|
469
469
|
});
|
|
470
470
|
|
|
471
|
+
describe('field-level encryption opt-out', () => {
|
|
472
|
+
it("emits FRIGG_ENCRYPTION_DISABLED=true for fieldLevelEncryptionMethod: 'none'", () => {
|
|
473
|
+
const result = getAppEnvironmentVars({
|
|
474
|
+
encryption: { fieldLevelEncryptionMethod: 'none' },
|
|
475
|
+
});
|
|
476
|
+
|
|
477
|
+
expect(result.FRIGG_ENCRYPTION_DISABLED).toBe('true');
|
|
478
|
+
});
|
|
479
|
+
|
|
480
|
+
it.each([
|
|
481
|
+
['kms', { fieldLevelEncryptionMethod: 'kms' }],
|
|
482
|
+
['aes', { fieldLevelEncryptionMethod: 'aes' }],
|
|
483
|
+
['no encryption block', undefined],
|
|
484
|
+
])('does not opt out for %s', (_label, encryption) => {
|
|
485
|
+
const result = getAppEnvironmentVars({ encryption });
|
|
486
|
+
|
|
487
|
+
expect(result.FRIGG_ENCRYPTION_DISABLED).toBeUndefined();
|
|
488
|
+
});
|
|
489
|
+
});
|
|
490
|
+
|
|
471
491
|
describe('buildEnvironment()', () => {
|
|
472
492
|
it('should combine app vars with standard Frigg variables', () => {
|
|
473
493
|
const appEnvironmentVars = {
|
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.
|
|
4
|
+
"version": "2.0.0--canary.663.9683f8b.0",
|
|
5
5
|
"bin": {
|
|
6
6
|
"frigg": "./frigg-cli/index.js"
|
|
7
7
|
},
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"@babel/eslint-parser": "^7.18.9",
|
|
27
27
|
"@babel/parser": "^7.25.3",
|
|
28
28
|
"@babel/traverse": "^7.25.3",
|
|
29
|
-
"@friggframework/core": "2.0.0--canary.
|
|
30
|
-
"@friggframework/schemas": "2.0.0--canary.
|
|
31
|
-
"@friggframework/test": "2.0.0--canary.
|
|
29
|
+
"@friggframework/core": "2.0.0--canary.663.9683f8b.0",
|
|
30
|
+
"@friggframework/schemas": "2.0.0--canary.663.9683f8b.0",
|
|
31
|
+
"@friggframework/test": "2.0.0--canary.663.9683f8b.0",
|
|
32
32
|
"@hapi/boom": "^10.0.1",
|
|
33
33
|
"@inquirer/prompts": "^5.3.8",
|
|
34
34
|
"axios": "^1.18.0",
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"validate-npm-package-name": "^5.0.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@friggframework/eslint-config": "2.0.0--canary.
|
|
60
|
-
"@friggframework/prettier-config": "2.0.0--canary.
|
|
59
|
+
"@friggframework/eslint-config": "2.0.0--canary.663.9683f8b.0",
|
|
60
|
+
"@friggframework/prettier-config": "2.0.0--canary.663.9683f8b.0",
|
|
61
61
|
"aws-sdk-client-mock": "^4.1.0",
|
|
62
62
|
"aws-sdk-client-mock-jest": "^4.1.0",
|
|
63
63
|
"jest": "^30.1.3",
|
|
@@ -89,5 +89,5 @@
|
|
|
89
89
|
"publishConfig": {
|
|
90
90
|
"access": "public"
|
|
91
91
|
},
|
|
92
|
-
"gitHead": "
|
|
92
|
+
"gitHead": "9683f8b4ecbbb8a91b497c63e04277490769bad8"
|
|
93
93
|
}
|