create-qpq-app 0.1.25 → 0.1.26
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/package.json +2 -2
- package/template/README.md +4 -0
- package/template/apps/qpqjs/account.qpq.ts +4 -0
- package/template/apps/qpqjs/bootstrap.qpq.ts +13 -2
- package/template/apps/qpqjs/packages/service-utils/src/defineQpqjsService.ts +4 -0
- package/template/apps/qpqjs/services/test/models/src/SmokeProbeRecord.ts +9 -0
- package/template/apps/qpqjs/services/test/models/src/SmokeRunSummary.ts +8 -1
- package/template/apps/qpqjs/services/test/models/src/SmokeTestStatus.ts +2 -0
- package/template/apps/qpqjs/services/test/service/src/smoke/config/defineSmoke.ts +96 -6
- package/template/apps/qpqjs/services/test/service/src/smoke/constants/smokeProbe.ts +25 -0
- package/template/apps/qpqjs/services/test/service/src/smoke/email/index.ts +2 -0
- package/template/apps/qpqjs/services/test/service/src/smoke/email/onSmokeEmailReceived.ts +33 -0
- package/template/apps/qpqjs/services/test/service/src/smoke/email/smokeEmailMarkerId.ts +4 -0
- package/template/apps/qpqjs/services/test/service/src/smoke/index.ts +3 -0
- package/template/apps/qpqjs/services/test/service/src/smoke/kvsStream/index.ts +2 -0
- package/template/apps/qpqjs/services/test/service/src/smoke/kvsStream/onSmokeStreamRecord.ts +31 -0
- package/template/apps/qpqjs/services/test/service/src/smoke/kvsStream/smokeStreamMarkerId.ts +8 -0
- package/template/apps/qpqjs/services/test/service/src/smoke/logic/smokeRun/askExecuteSmokeTest.ts +3 -2
- package/template/apps/qpqjs/services/test/service/src/smoke/logic/smokeRun/askStartSmokeRun.ts +27 -13
- package/template/apps/qpqjs/services/test/service/src/smoke/logic/smokeRun/summarizeSmokeRun.ts +5 -1
- package/template/apps/qpqjs/services/test/service/src/smoke/storageDrive/index.ts +4 -0
- package/template/apps/qpqjs/services/test/service/src/smoke/storageDrive/onSmokeFileEvent.ts +38 -0
- package/template/apps/qpqjs/services/test/service/src/smoke/storageDrive/smokeFileEventMarkerId.ts +14 -0
- package/template/apps/qpqjs/services/test/service/src/smoke/tests/SmokeTestDefinition.ts +3 -0
- package/template/apps/qpqjs/services/test/service/src/smoke/tests/askSmokePollForMarker.ts +44 -0
- package/template/apps/qpqjs/services/test/service/src/smoke/tests/emailReceive/askRunEmailReceiveTest.ts +41 -0
- package/template/apps/qpqjs/services/test/service/src/smoke/tests/emailReceive/index.ts +1 -0
- package/template/apps/qpqjs/services/test/service/src/smoke/tests/encryptedResources/askRunEncryptedResourcesTest.ts +63 -0
- package/template/apps/qpqjs/services/test/service/src/smoke/tests/encryptedResources/index.ts +1 -0
- package/template/apps/qpqjs/services/test/service/src/smoke/tests/eventBus/askRunEventBusTest.ts +2 -26
- package/template/apps/qpqjs/services/test/service/src/smoke/tests/eventDoc/askAwaitSmokeEventDocLog.ts +2 -1
- package/template/apps/qpqjs/services/test/service/src/smoke/tests/index.ts +5 -0
- package/template/apps/qpqjs/services/test/service/src/smoke/tests/keyValueStoreStream/askRunKeyValueStoreStreamTest.ts +60 -0
- package/template/apps/qpqjs/services/test/service/src/smoke/tests/keyValueStoreStream/index.ts +1 -0
- package/template/apps/qpqjs/services/test/service/src/smoke/tests/scopedKeyValueStore/askRunScopedKeyValueStoreTest.ts +102 -0
- package/template/apps/qpqjs/services/test/service/src/smoke/tests/scopedKeyValueStore/index.ts +1 -0
- package/template/apps/qpqjs/services/test/service/src/smoke/tests/scopedStorageDrive/askRunScopedStorageDriveTest.ts +116 -0
- package/template/apps/qpqjs/services/test/service/src/smoke/tests/scopedStorageDrive/index.ts +1 -0
- package/template/apps/qpqjs/services/test/service/src/smoke/tests/smokeTestRegistry.ts +12 -0
- package/template/apps/qpqjs/services/test/service/src/smoke/tests/storageDriveEvent/askRunStorageDriveEventTest.ts +80 -0
- package/template/apps/qpqjs/services/test/service/src/smoke/tests/storageDriveEvent/index.ts +1 -0
- package/template/docusaurus/docs/actions/core/file/ask-file-write-text-contents.md +1 -1
- package/template/docusaurus/docs/actions/core/platform/ask-platform-get-name.md +32 -0
- package/template/docusaurus/docs/actions/webserver/email/ask-email-parse.md +54 -0
- package/template/docusaurus/docs/config/config-aws/account-email-receiving.md +33 -0
- package/template/docusaurus/docs/config/core/crypto-key.md +3 -1
- package/template/docusaurus/docs/config/core/key-value-store.md +4 -3
- package/template/docusaurus/docs/config/core/storage-drive.md +5 -4
- package/template/docusaurus/docs/config/features/event-doc-routes.md +1 -0
- package/template/docusaurus/docs/config/features/tenant-stores.md +10 -5
- package/template/docusaurus/docs/config/features/tenant.md +36 -12
- package/template/docusaurus/docs/config/features/tenanted-email-receiver.md +79 -0
- package/template/docusaurus/docs/config/features/tenanted-event-doc.md +22 -7
- package/template/docusaurus/docs/config/webserver/email-receiver.md +65 -0
- package/template/docusaurus/docs/config/webserver/email-receiving-domain.md +41 -0
- package/template/scripts/smoke/runSmokeRun.mjs +1 -1
- package/template/docusaurus/docs/config/config-aws/aws-kms-key.md +0 -100
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: defineAwsKmsKey
|
|
3
|
-
description: Register a customer-managed KMS key to encrypt a storage drive or key-value store.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# defineAwsKmsKey
|
|
7
|
-
|
|
8
|
-
Registers an existing **customer-managed KMS key** (by ARN) and binds it to a specific [storage drive](../core/storage-drive.md) or [key-value store](../core/key-value-store.md). It is the AWS-side companion to the `encryption: true` flag on those resources: when a drive or store opts into customer-managed encryption, this setting tells the deploy which KMS key to use. Without a matching key registered here, the `encryption` flag has no key to reference.
|
|
9
|
-
|
|
10
|
-
- **On AWS:** looked up by `getAwsKmsKeyForStorageDrive` / `getAwsKmsKeyForKeyValueStore` in `quidproquo-config-aws`, keyed by target type + resource name + owning module. `QpqCoreStorageDriveConstruct` and `QpqCoreKeyValueStoreConstruct` in `quidproquo-deploy-awscdk` resolve the key with `aws_kms.Key.fromKeyArn(...)` and set it as the bucket / table `encryptionKey`. The deploy also grants the service's roles the KMS actions (`kms:Decrypt`, `kms:GenerateDataKey*`, `kms:Encrypt`, `kms:ReEncrypt*`, `kms:DescribeKey`) needed to use the key. The key itself is referenced, not created — you provision and manage the key (and its key policy) separately.
|
|
11
|
-
|
|
12
|
-
```typescript
|
|
13
|
-
import { defineAwsKmsKey, AwsKmsKeyTargetType } from 'quidproquo-config-aws';
|
|
14
|
-
|
|
15
|
-
export default [
|
|
16
|
-
defineAwsKmsKey(
|
|
17
|
-
'uploads-key',
|
|
18
|
-
'arn:aws:kms:us-east-1:123456789012:key/abcd-1234-...',
|
|
19
|
-
AwsKmsKeyTargetType.storageDrive,
|
|
20
|
-
{ name: 'user-uploads', module: 'my-service' },
|
|
21
|
-
),
|
|
22
|
-
];
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## Signature
|
|
26
|
-
|
|
27
|
-
```typescript
|
|
28
|
-
function defineAwsKmsKey(
|
|
29
|
-
keyname: string,
|
|
30
|
-
arn: string,
|
|
31
|
-
type: AwsKmsKeyTargetType,
|
|
32
|
-
owner: AwsKmsKeyOwner,
|
|
33
|
-
): AwsKmsKeyQPQConfigSetting;
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
## Parameters
|
|
37
|
-
|
|
38
|
-
### `keyname` — `string` (required)
|
|
39
|
-
|
|
40
|
-
A unique name for this key registration (its `uniqueKey` within the config). An identifier for the entry — not the AWS key alias.
|
|
41
|
-
|
|
42
|
-
### `arn` — `string` (required)
|
|
43
|
-
|
|
44
|
-
The ARN of the existing customer-managed KMS key. This exact ARN is imported via `Key.fromKeyArn`.
|
|
45
|
-
|
|
46
|
-
### `type` — `AwsKmsKeyTargetType` (required)
|
|
47
|
-
|
|
48
|
-
Which kind of data store this key encrypts. The lookup matches on this together with the owner, so a store only picks up a key registered for its own resource type.
|
|
49
|
-
|
|
50
|
-
| Value | Encrypts |
|
|
51
|
-
| --- | --- |
|
|
52
|
-
| `storageDrive` | A [storage drive](../core/storage-drive.md) (S3 bucket) with `encryption: true`. |
|
|
53
|
-
| `keyValueStore` | A [key-value store](../core/key-value-store.md) (DynamoDB table) with `encryption: true`. |
|
|
54
|
-
|
|
55
|
-
### `owner` — `AwsKmsKeyOwner` (required)
|
|
56
|
-
|
|
57
|
-
Identifies the resource the key belongs to. Both fields are matched against the target store at deploy time.
|
|
58
|
-
|
|
59
|
-
```typescript
|
|
60
|
-
type AwsKmsKeyOwner = {
|
|
61
|
-
name: string; // the storage-drive / key-value-store name
|
|
62
|
-
module: string; // the module that owns that resource
|
|
63
|
-
};
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
- **`name`** — the storage-drive or key-value-store name (matches the value passed to `defineStorageDrive` / `defineKeyValueStore`).
|
|
67
|
-
- **`module`** — the module that owns that resource. For a store owned by the current service this is the service's own module name; set it to another module to key a foreign resource.
|
|
68
|
-
|
|
69
|
-
## Examples
|
|
70
|
-
|
|
71
|
-
```typescript
|
|
72
|
-
import { defineKeyValueStore } from 'quidproquo-core';
|
|
73
|
-
import { defineStorageDrive } from 'quidproquo-core';
|
|
74
|
-
import { defineAwsKmsKey, AwsKmsKeyTargetType } from 'quidproquo-config-aws';
|
|
75
|
-
|
|
76
|
-
export default [
|
|
77
|
-
// A drive and a store that both request customer-managed encryption
|
|
78
|
-
defineStorageDrive('user-uploads', { encryption: true }),
|
|
79
|
-
defineKeyValueStore('billing', 'invoiceId', { encryption: true }),
|
|
80
|
-
|
|
81
|
-
// Bind each to its KMS key
|
|
82
|
-
defineAwsKmsKey(
|
|
83
|
-
'uploads-key',
|
|
84
|
-
'arn:aws:kms:us-east-1:123456789012:key/uploads-...',
|
|
85
|
-
AwsKmsKeyTargetType.storageDrive,
|
|
86
|
-
{ name: 'user-uploads', module: 'my-service' },
|
|
87
|
-
),
|
|
88
|
-
defineAwsKmsKey(
|
|
89
|
-
'billing-key',
|
|
90
|
-
'arn:aws:kms:us-east-1:123456789012:key/billing-...',
|
|
91
|
-
AwsKmsKeyTargetType.keyValueStore,
|
|
92
|
-
{ name: 'billing', module: 'my-service' },
|
|
93
|
-
),
|
|
94
|
-
];
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
## Related
|
|
98
|
-
|
|
99
|
-
- [defineStorageDrive](../core/storage-drive.md) — its `encryption` flag selects a key registered here.
|
|
100
|
-
- [defineKeyValueStore](../core/key-value-store.md) — its `encryption` flag selects a key registered here.
|