@friggframework/devtools 2.0.0--canary.461.777e4f9.0 → 2.0.0--canary.461.94bc9c8.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.
|
@@ -490,6 +490,40 @@ describe('Resource Discovery', () => {
|
|
|
490
490
|
// Should call AWS API discovery (shared mode finds resources across stages)
|
|
491
491
|
expect(mockVpcDiscovery.discover).toHaveBeenCalled();
|
|
492
492
|
});
|
|
493
|
+
|
|
494
|
+
it('should search for specific KMS alias in isolated mode to find orphaned keys', async () => {
|
|
495
|
+
const appDefinition = {
|
|
496
|
+
name: 'quo-integrations',
|
|
497
|
+
managementMode: 'managed',
|
|
498
|
+
vpcIsolation: 'isolated',
|
|
499
|
+
encryption: { fieldLevelEncryptionMethod: 'kms' },
|
|
500
|
+
};
|
|
501
|
+
|
|
502
|
+
process.env.SLS_STAGE = 'dev';
|
|
503
|
+
|
|
504
|
+
// Mock KMS discovery finding key via alias search
|
|
505
|
+
mockKmsDiscovery.discover.mockResolvedValue({
|
|
506
|
+
defaultKmsKeyId: 'arn:aws:kms:us-east-1:123:key/found-via-alias',
|
|
507
|
+
kmsKeyAlias: 'alias/quo-integrations-dev-frigg-kms',
|
|
508
|
+
});
|
|
509
|
+
|
|
510
|
+
const result = await gatherDiscoveredResources(appDefinition);
|
|
511
|
+
|
|
512
|
+
// Should pass keyAlias to discover orphaned KMS keys
|
|
513
|
+
expect(mockKmsDiscovery.discover).toHaveBeenCalledWith(
|
|
514
|
+
expect.objectContaining({
|
|
515
|
+
serviceName: 'quo-integrations',
|
|
516
|
+
stage: 'dev',
|
|
517
|
+
keyAlias: 'alias/quo-integrations-dev-frigg-kms',
|
|
518
|
+
})
|
|
519
|
+
);
|
|
520
|
+
|
|
521
|
+
// Should return discovered KMS key (even if orphaned from stack)
|
|
522
|
+
expect(result).toEqual({
|
|
523
|
+
defaultKmsKeyId: 'arn:aws:kms:us-east-1:123:key/found-via-alias',
|
|
524
|
+
kmsKeyAlias: 'alias/quo-integrations-dev-frigg-kms',
|
|
525
|
+
});
|
|
526
|
+
});
|
|
493
527
|
});
|
|
494
528
|
});
|
|
495
529
|
|
|
@@ -411,15 +411,20 @@ async function verifyRhelBinaries(expectedClients) {
|
|
|
411
411
|
/**
|
|
412
412
|
* Verify required files exist
|
|
413
413
|
* Runtime layer should NOT have CLI files
|
|
414
|
+
* @param {Array} clientPackages - Generated client packages that were included
|
|
414
415
|
*/
|
|
415
|
-
async function verifyLayerStructure() {
|
|
416
|
+
async function verifyLayerStructure(clientPackages) {
|
|
416
417
|
logStep(8, 'Verifying layer structure (runtime only)');
|
|
417
418
|
|
|
418
419
|
const requiredPaths = [
|
|
419
420
|
'@prisma/client/runtime',
|
|
420
421
|
'@prisma/client/index.d.ts',
|
|
421
|
-
'generated/prisma-postgresql/schema.prisma', // PostgreSQL (default)
|
|
422
422
|
];
|
|
423
|
+
|
|
424
|
+
// Add schema.prisma for each included client
|
|
425
|
+
for (const pkg of clientPackages) {
|
|
426
|
+
requiredPaths.push(`${pkg}/schema.prisma`);
|
|
427
|
+
}
|
|
423
428
|
|
|
424
429
|
// Verify CLI is NOT present (keeps layer small)
|
|
425
430
|
const forbiddenPaths = [
|
|
@@ -512,7 +517,7 @@ async function buildPrismaLayer(databaseConfig = {}) {
|
|
|
512
517
|
await removeUnnecessaryFiles(); // Remove source maps, docs, tests (37MB+)
|
|
513
518
|
await removeNonRhelBinaries(); // Remove non-Linux binaries
|
|
514
519
|
await verifyRhelBinaries(clientPackages); // Verify query engines present
|
|
515
|
-
await verifyLayerStructure();
|
|
520
|
+
await verifyLayerStructure(clientPackages); // Verify minimal runtime structure
|
|
516
521
|
await displayLayerSummary();
|
|
517
522
|
|
|
518
523
|
const duration = ((Date.now() - startTime) / 1000).toFixed(2);
|
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.94bc9c8.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.94bc9c8.0",
|
|
15
|
+
"@friggframework/test": "2.0.0--canary.461.94bc9c8.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.94bc9c8.0",
|
|
38
|
+
"@friggframework/prettier-config": "2.0.0--canary.461.94bc9c8.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": "94bc9c8d886a30024277f85db890ce8c44c616df"
|
|
74
74
|
}
|