@friggframework/devtools 2.0.0--canary.608.ba60ba6.0 → 2.0.0--canary.608.03436383054a.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/domains/integration/integration-builder.js +2 -10
- package/infrastructure/domains/integration/integration-builder.test.js +100 -97
- package/infrastructure/domains/security/iam-generator.js +5 -10
- package/infrastructure/domains/security/iam-generator.test.js +19 -22
- package/infrastructure/domains/security/templates/frigg-deployment-iam-stack.yaml +387 -399
- package/infrastructure/domains/shared/utilities/base-definition-factory.js +59 -95
- package/infrastructure/domains/shared/utilities/base-definition-factory.test.js +27 -73
- package/package.json +7 -7
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
const {
|
|
2
|
-
generateIAMCloudFormation,
|
|
3
|
-
getFeatureSummary,
|
|
4
|
-
} = require('./iam-generator');
|
|
1
|
+
const { generateIAMCloudFormation, getFeatureSummary } = require('./iam-generator');
|
|
5
2
|
|
|
6
3
|
describe('IAM Generator', () => {
|
|
7
4
|
describe('getFeatureSummary', () => {
|
|
@@ -12,7 +9,7 @@ describe('IAM Generator', () => {
|
|
|
12
9
|
vpc: { enable: true },
|
|
13
10
|
encryption: { fieldLevelEncryptionMethod: 'kms' },
|
|
14
11
|
ssm: { enable: true },
|
|
15
|
-
websockets: { enable: true }
|
|
12
|
+
websockets: { enable: true }
|
|
16
13
|
};
|
|
17
14
|
|
|
18
15
|
const summary = getFeatureSummary(appDefinition);
|
|
@@ -28,7 +25,7 @@ describe('IAM Generator', () => {
|
|
|
28
25
|
|
|
29
26
|
it('should detect minimal features when disabled', () => {
|
|
30
27
|
const appDefinition = {
|
|
31
|
-
integrations: []
|
|
28
|
+
integrations: []
|
|
32
29
|
};
|
|
33
30
|
|
|
34
31
|
const summary = getFeatureSummary(appDefinition);
|
|
@@ -51,13 +48,13 @@ describe('IAM Generator', () => {
|
|
|
51
48
|
vpc: { enable: false },
|
|
52
49
|
encryption: { fieldLevelEncryptionMethod: 'aes' },
|
|
53
50
|
ssm: { enable: false },
|
|
54
|
-
websockets: { enable: false }
|
|
51
|
+
websockets: { enable: false }
|
|
55
52
|
};
|
|
56
53
|
|
|
57
54
|
const summary = getFeatureSummary(appDefinition);
|
|
58
55
|
const yaml = generateIAMCloudFormation({
|
|
59
56
|
appName: summary.appName,
|
|
60
|
-
features: summary.features
|
|
57
|
+
features: summary.features
|
|
61
58
|
});
|
|
62
59
|
|
|
63
60
|
expect(yaml).toContain('AWSTemplateFormatVersion');
|
|
@@ -70,13 +67,13 @@ describe('IAM Generator', () => {
|
|
|
70
67
|
const appDefinition = {
|
|
71
68
|
name: 'test-app',
|
|
72
69
|
integrations: [],
|
|
73
|
-
vpc: { enable: true }
|
|
70
|
+
vpc: { enable: true }
|
|
74
71
|
};
|
|
75
72
|
|
|
76
73
|
const summary = getFeatureSummary(appDefinition);
|
|
77
74
|
const yaml = generateIAMCloudFormation({
|
|
78
75
|
appName: summary.appName,
|
|
79
|
-
features: summary.features
|
|
76
|
+
features: summary.features
|
|
80
77
|
});
|
|
81
78
|
|
|
82
79
|
expect(yaml).toContain('FriggVPCPolicy');
|
|
@@ -89,13 +86,13 @@ describe('IAM Generator', () => {
|
|
|
89
86
|
const appDefinition = {
|
|
90
87
|
name: 'test-app',
|
|
91
88
|
integrations: [],
|
|
92
|
-
encryption: { fieldLevelEncryptionMethod: 'kms' }
|
|
89
|
+
encryption: { fieldLevelEncryptionMethod: 'kms' }
|
|
93
90
|
};
|
|
94
91
|
|
|
95
92
|
const summary = getFeatureSummary(appDefinition);
|
|
96
93
|
const yaml = generateIAMCloudFormation({
|
|
97
94
|
appName: summary.appName,
|
|
98
|
-
features: summary.features
|
|
95
|
+
features: summary.features
|
|
99
96
|
});
|
|
100
97
|
|
|
101
98
|
expect(yaml).toContain('FriggKMSPolicy');
|
|
@@ -109,13 +106,13 @@ describe('IAM Generator', () => {
|
|
|
109
106
|
const appDefinition = {
|
|
110
107
|
name: 'test-app',
|
|
111
108
|
integrations: [],
|
|
112
|
-
ssm: { enable: true }
|
|
109
|
+
ssm: { enable: true }
|
|
113
110
|
};
|
|
114
111
|
|
|
115
112
|
const summary = getFeatureSummary(appDefinition);
|
|
116
113
|
const yaml = generateIAMCloudFormation({
|
|
117
114
|
appName: summary.appName,
|
|
118
|
-
features: summary.features
|
|
115
|
+
features: summary.features
|
|
119
116
|
});
|
|
120
117
|
|
|
121
118
|
expect(yaml).toContain('FriggSSMPolicy');
|
|
@@ -129,13 +126,13 @@ describe('IAM Generator', () => {
|
|
|
129
126
|
integrations: [],
|
|
130
127
|
vpc: { enable: true },
|
|
131
128
|
encryption: { fieldLevelEncryptionMethod: 'aes' },
|
|
132
|
-
ssm: { enable: true }
|
|
129
|
+
ssm: { enable: true }
|
|
133
130
|
};
|
|
134
131
|
|
|
135
132
|
const summary = getFeatureSummary(appDefinition);
|
|
136
133
|
const yaml = generateIAMCloudFormation({
|
|
137
134
|
appName: summary.appName,
|
|
138
|
-
features: summary.features
|
|
135
|
+
features: summary.features
|
|
139
136
|
});
|
|
140
137
|
|
|
141
138
|
// Check parameter defaults match the enabled features
|
|
@@ -147,13 +144,13 @@ describe('IAM Generator', () => {
|
|
|
147
144
|
it('should include all core permissions', () => {
|
|
148
145
|
const appDefinition = {
|
|
149
146
|
name: 'test-app',
|
|
150
|
-
integrations: []
|
|
147
|
+
integrations: []
|
|
151
148
|
};
|
|
152
149
|
|
|
153
150
|
const summary = getFeatureSummary(appDefinition);
|
|
154
151
|
const yaml = generateIAMCloudFormation({
|
|
155
152
|
appName: summary.appName,
|
|
156
|
-
features: summary.features
|
|
153
|
+
features: summary.features
|
|
157
154
|
});
|
|
158
155
|
|
|
159
156
|
// Check for core permissions
|
|
@@ -173,13 +170,13 @@ describe('IAM Generator', () => {
|
|
|
173
170
|
it('should include internal-error-queue pattern in SQS resources', () => {
|
|
174
171
|
const appDefinition = {
|
|
175
172
|
name: 'test-app',
|
|
176
|
-
integrations: []
|
|
173
|
+
integrations: []
|
|
177
174
|
};
|
|
178
175
|
|
|
179
176
|
const summary = getFeatureSummary(appDefinition);
|
|
180
177
|
const yaml = generateIAMCloudFormation({
|
|
181
178
|
appName: summary.appName,
|
|
182
|
-
features: summary.features
|
|
179
|
+
features: summary.features
|
|
183
180
|
});
|
|
184
181
|
|
|
185
182
|
expect(yaml).toContain('internal-error-queue-*');
|
|
@@ -204,13 +201,13 @@ describe('IAM Generator', () => {
|
|
|
204
201
|
it('should generate outputs section', () => {
|
|
205
202
|
const appDefinition = {
|
|
206
203
|
name: 'test-app',
|
|
207
|
-
integrations: []
|
|
204
|
+
integrations: []
|
|
208
205
|
};
|
|
209
206
|
|
|
210
207
|
const summary = getFeatureSummary(appDefinition);
|
|
211
208
|
const yaml = generateIAMCloudFormation({
|
|
212
209
|
appName: summary.appName,
|
|
213
|
-
features: summary.features
|
|
210
|
+
features: summary.features
|
|
214
211
|
});
|
|
215
212
|
|
|
216
213
|
expect(yaml).toContain('Outputs:');
|