@cratis/chronicle 6.2.0 → 6.3.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.
Files changed (57) hide show
  1. package/confidentiality/EncryptedNotSupportedOnEventSourceId.ts +21 -0
  2. package/confidentiality/EncryptionScope.ts +34 -0
  3. package/confidentiality/PIIAndEncryptedCombinedNotSupported.ts +29 -0
  4. package/confidentiality/SecurityMetadata.ts +22 -0
  5. package/confidentiality/SecurityMetadataResolver.ts +54 -0
  6. package/confidentiality/SecurityMetadataType.ts +56 -0
  7. package/confidentiality/encrypted.spec.ts +105 -0
  8. package/confidentiality/encrypted.ts +143 -0
  9. package/confidentiality/index.ts +10 -0
  10. package/dist/confidentiality/EncryptedNotSupportedOnEventSourceId.d.ts +11 -0
  11. package/dist/confidentiality/EncryptedNotSupportedOnEventSourceId.d.ts.map +1 -0
  12. package/dist/confidentiality/EncryptedNotSupportedOnEventSourceId.js +19 -0
  13. package/dist/confidentiality/EncryptedNotSupportedOnEventSourceId.js.map +1 -0
  14. package/dist/confidentiality/EncryptionScope.d.ts +30 -0
  15. package/dist/confidentiality/EncryptionScope.d.ts.map +1 -0
  16. package/dist/confidentiality/EncryptionScope.js +33 -0
  17. package/dist/confidentiality/EncryptionScope.js.map +1 -0
  18. package/dist/confidentiality/PIIAndEncryptedCombinedNotSupported.d.ts +19 -0
  19. package/dist/confidentiality/PIIAndEncryptedCombinedNotSupported.d.ts.map +1 -0
  20. package/dist/confidentiality/PIIAndEncryptedCombinedNotSupported.js +27 -0
  21. package/dist/confidentiality/PIIAndEncryptedCombinedNotSupported.js.map +1 -0
  22. package/dist/confidentiality/SecurityMetadata.d.ts +18 -0
  23. package/dist/confidentiality/SecurityMetadata.d.ts.map +1 -0
  24. package/dist/confidentiality/SecurityMetadata.js +4 -0
  25. package/dist/confidentiality/SecurityMetadata.js.map +1 -0
  26. package/dist/confidentiality/SecurityMetadataResolver.d.ts +30 -0
  27. package/dist/confidentiality/SecurityMetadataResolver.d.ts.map +1 -0
  28. package/dist/confidentiality/SecurityMetadataResolver.js +48 -0
  29. package/dist/confidentiality/SecurityMetadataResolver.js.map +1 -0
  30. package/dist/confidentiality/SecurityMetadataType.d.ts +42 -0
  31. package/dist/confidentiality/SecurityMetadataType.d.ts.map +1 -0
  32. package/dist/confidentiality/SecurityMetadataType.js +50 -0
  33. package/dist/confidentiality/SecurityMetadataType.js.map +1 -0
  34. package/dist/confidentiality/encrypted.d.ts +72 -0
  35. package/dist/confidentiality/encrypted.d.ts.map +1 -0
  36. package/dist/confidentiality/encrypted.js +130 -0
  37. package/dist/confidentiality/encrypted.js.map +1 -0
  38. package/dist/confidentiality/index.d.ts +8 -0
  39. package/dist/confidentiality/index.d.ts.map +1 -0
  40. package/dist/confidentiality/index.js +9 -0
  41. package/dist/confidentiality/index.js.map +1 -0
  42. package/dist/index.d.ts +3 -1
  43. package/dist/index.d.ts.map +1 -1
  44. package/dist/index.js +3 -1
  45. package/dist/index.js.map +1 -1
  46. package/dist/schemas/JsonSchema.d.ts +18 -0
  47. package/dist/schemas/JsonSchema.d.ts.map +1 -1
  48. package/dist/schemas/JsonSchemaGenerator.d.ts +41 -0
  49. package/dist/schemas/JsonSchemaGenerator.d.ts.map +1 -1
  50. package/dist/schemas/JsonSchemaGenerator.js +102 -9
  51. package/dist/schemas/JsonSchemaGenerator.js.map +1 -1
  52. package/dist/tsconfig.tsbuildinfo +1 -1
  53. package/index.ts +3 -0
  54. package/package.json +7 -2
  55. package/schemas/JsonSchema.ts +20 -0
  56. package/schemas/JsonSchemaGenerator.confidentiality.spec.ts +194 -0
  57. package/schemas/JsonSchemaGenerator.ts +115 -10
@@ -0,0 +1,18 @@
1
+ import type { SecurityMetadataType } from './SecurityMetadataType';
2
+ /**
3
+ * Represents metadata related to security.
4
+ *
5
+ * This is the security counterpart to {@link ComplianceMetadata} - a deliberately separate type
6
+ * rather than a shared one. See {@link SecurityMetadataType} for why.
7
+ */
8
+ export interface SecurityMetadata {
9
+ /**
10
+ * The type of security metadata.
11
+ */
12
+ readonly metadataType: SecurityMetadataType;
13
+ /**
14
+ * Any additional details - can be empty.
15
+ */
16
+ readonly details: string;
17
+ }
18
+ //# sourceMappingURL=SecurityMetadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SecurityMetadata.d.ts","sourceRoot":"","sources":["../../confidentiality/SecurityMetadata.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAEnE;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC7B;;OAEG;IACH,QAAQ,CAAC,YAAY,EAAE,oBAAoB,CAAC;IAE5C;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC5B"}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+ export {};
4
+ //# sourceMappingURL=SecurityMetadata.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SecurityMetadata.js","sourceRoot":"","sources":["../../confidentiality/SecurityMetadata.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG"}
@@ -0,0 +1,30 @@
1
+ import type { SecurityMetadata } from './SecurityMetadata';
2
+ /**
3
+ * Resolves security metadata for properties and types.
4
+ *
5
+ * This is the security counterpart to {@link ComplianceMetadataResolver} - a deliberately separate
6
+ * type rather than a shared one. See {@link SecurityMetadataType} for why.
7
+ */
8
+ export declare class SecurityMetadataResolver {
9
+ /**
10
+ * Checks if a property has security metadata.
11
+ * @param target - The class prototype.
12
+ * @param propertyKey - The property name.
13
+ * @returns True if the property has security metadata; false otherwise.
14
+ */
15
+ static hasMetadataFor(target: object, propertyKey: string): boolean;
16
+ /**
17
+ * Gets all security metadata for a property.
18
+ * @param target - The class prototype.
19
+ * @param propertyKey - The property name.
20
+ * @returns Array of security metadata.
21
+ */
22
+ static getMetadataFor(target: object, propertyKey: string): SecurityMetadata[];
23
+ /**
24
+ * Gets security metadata for a type (e.g., ConceptAs types).
25
+ * @param type - The type constructor.
26
+ * @returns Array of security metadata.
27
+ */
28
+ static getMetadataForType(type: Function): SecurityMetadata[];
29
+ }
30
+ //# sourceMappingURL=SecurityMetadataResolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SecurityMetadataResolver.d.ts","sourceRoot":"","sources":["../../confidentiality/SecurityMetadataResolver.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAG3D;;;;;GAKG;AACH,qBAAa,wBAAwB;IACjC;;;;;OAKG;IACH,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO;IAInE;;;;;OAKG;IACH,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,gBAAgB,EAAE;IAW9E;;;;OAIG;IACH,MAAM,CAAC,kBAAkB,CAAC,IAAI,EAAE,QAAQ,GAAG,gBAAgB,EAAE;CAQhE"}
@@ -0,0 +1,48 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+ import { getEncryptedMetadata, getTypeEncryptedMetadata } from './encrypted';
4
+ /**
5
+ * Resolves security metadata for properties and types.
6
+ *
7
+ * This is the security counterpart to {@link ComplianceMetadataResolver} - a deliberately separate
8
+ * type rather than a shared one. See {@link SecurityMetadataType} for why.
9
+ */
10
+ export class SecurityMetadataResolver {
11
+ /**
12
+ * Checks if a property has security metadata.
13
+ * @param target - The class prototype.
14
+ * @param propertyKey - The property name.
15
+ * @returns True if the property has security metadata; false otherwise.
16
+ */
17
+ static hasMetadataFor(target, propertyKey) {
18
+ return getEncryptedMetadata(target, propertyKey) !== undefined;
19
+ }
20
+ /**
21
+ * Gets all security metadata for a property.
22
+ * @param target - The class prototype.
23
+ * @param propertyKey - The property name.
24
+ * @returns Array of security metadata.
25
+ */
26
+ static getMetadataFor(target, propertyKey) {
27
+ const metadata = [];
28
+ const encryptedMetadata = getEncryptedMetadata(target, propertyKey);
29
+ if (encryptedMetadata) {
30
+ metadata.push(encryptedMetadata);
31
+ }
32
+ return metadata;
33
+ }
34
+ /**
35
+ * Gets security metadata for a type (e.g., ConceptAs types).
36
+ * @param type - The type constructor.
37
+ * @returns Array of security metadata.
38
+ */
39
+ static getMetadataForType(type) {
40
+ const metadata = [];
41
+ const encryptedMetadata = getTypeEncryptedMetadata(type);
42
+ if (encryptedMetadata) {
43
+ metadata.push(encryptedMetadata);
44
+ }
45
+ return metadata;
46
+ }
47
+ }
48
+ //# sourceMappingURL=SecurityMetadataResolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SecurityMetadataResolver.js","sourceRoot":"","sources":["../../confidentiality/SecurityMetadataResolver.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAGrG,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAE7E;;;;;GAKG;AACH,MAAM,OAAO,wBAAwB;IACjC;;;;;OAKG;IACH,MAAM,CAAC,cAAc,CAAC,MAAc,EAAE,WAAmB;QACrD,OAAO,oBAAoB,CAAC,MAAM,EAAE,WAAW,CAAC,KAAK,SAAS,CAAC;IACnE,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,cAAc,CAAC,MAAc,EAAE,WAAmB;QACrD,MAAM,QAAQ,GAAuB,EAAE,CAAC;QAExC,MAAM,iBAAiB,GAAG,oBAAoB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;QACpE,IAAI,iBAAiB,EAAE,CAAC;YACpB,QAAQ,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QACrC,CAAC;QAED,OAAO,QAAQ,CAAC;IACpB,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,kBAAkB,CAAC,IAAc;QACpC,MAAM,QAAQ,GAAuB,EAAE,CAAC;QACxC,MAAM,iBAAiB,GAAG,wBAAwB,CAAC,IAAI,CAAC,CAAC;QACzD,IAAI,iBAAiB,EAAE,CAAC;YACpB,QAAQ,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QACrC,CAAC;QACD,OAAO,QAAQ,CAAC;IACpB,CAAC;CACJ"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Represents a type of security metadata.
3
+ *
4
+ * This is the security counterpart to {@link ComplianceMetadataType} - a deliberately separate type
5
+ * rather than a shared one. A `@pii()` value and an `@encrypted()` value are never the same kind of
6
+ * thing: one is personal data with a GDPR erasure obligation, the other is an operational secret
7
+ * with none. Keeping the two vocabularies apart keeps that distinction visible at every call site
8
+ * that reads a schema's metadata.
9
+ */
10
+ export declare class SecurityMetadataType {
11
+ /**
12
+ * The key is provisioned per compliance identity - the same identity, resolved the same way, a
13
+ * `@pii()` value on the same document would use. This is what `@encrypted()` (with no explicit
14
+ * scope, or `EncryptionScope.Subject`) resolves to.
15
+ */
16
+ static readonly EncryptedSubject: SecurityMetadataType;
17
+ /**
18
+ * The key is provisioned once per event store namespace. This is what
19
+ * `@encrypted(EncryptionScope.Namespace)` resolves to.
20
+ */
21
+ static readonly EncryptedNamespace: SecurityMetadataType;
22
+ /**
23
+ * The key is provisioned once for the whole Chronicle installation. This is what
24
+ * `@encrypted(EncryptionScope.Global)` resolves to.
25
+ */
26
+ static readonly EncryptedGlobal: SecurityMetadataType;
27
+ private readonly _value;
28
+ /**
29
+ * Initializes a new instance of SecurityMetadataType.
30
+ * @param value - The string value of the security metadata type.
31
+ */
32
+ constructor(value: string);
33
+ /**
34
+ * Gets the underlying string value.
35
+ */
36
+ get value(): string;
37
+ /**
38
+ * Returns the string representation of the security metadata type.
39
+ */
40
+ toString(): string;
41
+ }
42
+ //# sourceMappingURL=SecurityMetadataType.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SecurityMetadataType.d.ts","sourceRoot":"","sources":["../../confidentiality/SecurityMetadataType.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,qBAAa,oBAAoB;IAC7B;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,gBAAgB,uBAAgD;IAEhF;;;OAGG;IACH,MAAM,CAAC,QAAQ,CAAC,kBAAkB,uBAAkD;IAEpF;;;OAGG;IACH,MAAM,CAAC,QAAQ,CAAC,eAAe,uBAA+C;IAE9E,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAEhC;;;OAGG;gBACS,KAAK,EAAE,MAAM;IAIzB;;OAEG;IACH,IAAI,KAAK,IAAI,MAAM,CAElB;IAED;;OAEG;IACH,QAAQ,IAAI,MAAM;CAGrB"}
@@ -0,0 +1,50 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+ /**
4
+ * Represents a type of security metadata.
5
+ *
6
+ * This is the security counterpart to {@link ComplianceMetadataType} - a deliberately separate type
7
+ * rather than a shared one. A `@pii()` value and an `@encrypted()` value are never the same kind of
8
+ * thing: one is personal data with a GDPR erasure obligation, the other is an operational secret
9
+ * with none. Keeping the two vocabularies apart keeps that distinction visible at every call site
10
+ * that reads a schema's metadata.
11
+ */
12
+ export class SecurityMetadataType {
13
+ /**
14
+ * The key is provisioned per compliance identity - the same identity, resolved the same way, a
15
+ * `@pii()` value on the same document would use. This is what `@encrypted()` (with no explicit
16
+ * scope, or `EncryptionScope.Subject`) resolves to.
17
+ */
18
+ static EncryptedSubject = new SecurityMetadataType('EncryptedSubject');
19
+ /**
20
+ * The key is provisioned once per event store namespace. This is what
21
+ * `@encrypted(EncryptionScope.Namespace)` resolves to.
22
+ */
23
+ static EncryptedNamespace = new SecurityMetadataType('EncryptedNamespace');
24
+ /**
25
+ * The key is provisioned once for the whole Chronicle installation. This is what
26
+ * `@encrypted(EncryptionScope.Global)` resolves to.
27
+ */
28
+ static EncryptedGlobal = new SecurityMetadataType('EncryptedGlobal');
29
+ _value;
30
+ /**
31
+ * Initializes a new instance of SecurityMetadataType.
32
+ * @param value - The string value of the security metadata type.
33
+ */
34
+ constructor(value) {
35
+ this._value = value;
36
+ }
37
+ /**
38
+ * Gets the underlying string value.
39
+ */
40
+ get value() {
41
+ return this._value;
42
+ }
43
+ /**
44
+ * Returns the string representation of the security metadata type.
45
+ */
46
+ toString() {
47
+ return this._value;
48
+ }
49
+ }
50
+ //# sourceMappingURL=SecurityMetadataType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SecurityMetadataType.js","sourceRoot":"","sources":["../../confidentiality/SecurityMetadataType.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG;;;;;;;;GAQG;AACH,MAAM,OAAO,oBAAoB;IAC7B;;;;OAIG;IACH,MAAM,CAAU,gBAAgB,GAAG,IAAI,oBAAoB,CAAC,kBAAkB,CAAC,CAAC;IAEhF;;;OAGG;IACH,MAAM,CAAU,kBAAkB,GAAG,IAAI,oBAAoB,CAAC,oBAAoB,CAAC,CAAC;IAEpF;;;OAGG;IACH,MAAM,CAAU,eAAe,GAAG,IAAI,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;IAE7D,MAAM,CAAS;IAEhC;;;OAGG;IACH,YAAY,KAAa;QACrB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACxB,CAAC;IAED;;OAEG;IACH,IAAI,KAAK;QACL,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IAED;;OAEG;IACH,QAAQ;QACJ,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC"}
@@ -0,0 +1,72 @@
1
+ import 'reflect-metadata';
2
+ import type { SecurityMetadata } from './SecurityMetadata';
3
+ import { EncryptionScope } from './EncryptionScope';
4
+ /**
5
+ * Decorator that marks a property or type as needing plain-confidentiality encryption at rest - a
6
+ * security measure, not a compliance one.
7
+ *
8
+ * Use `@encrypted()` for an operational secret that has no data subject and no lawful basis for
9
+ * erasure - an API key, a webhook signing secret, a partner credential. Use `@pii()` instead when
10
+ * the value is personal data about a natural person: only `@pii()` encrypts a value *and* enrolls it
11
+ * in GDPR right-to-erasure. Marking a secret `@pii()` would make it erasable on a request that was
12
+ * never about it; marking personal data `@encrypted()` would encrypt it but never erase it. The two
13
+ * are not interchangeable, and this decorator's key is never provisioned under the same identity a
14
+ * `@pii()` value for the same subject uses.
15
+ *
16
+ * All three {@link EncryptionScope} members are honored by the kernel: `EncryptionScope.Subject`
17
+ * (the default) provisions a key per compliance identity, exactly matching how a `@pii()` value on
18
+ * the same document is resolved; `EncryptionScope.Namespace` provisions one key shared by every
19
+ * value marked with it in a given event store namespace; `EncryptionScope.Global` provisions one key
20
+ * shared across the whole installation. Choosing a wider scope is safe for `@encrypted()` in a way
21
+ * it is not for `@pii()`, precisely because an operational secret has no data subject whose erasure
22
+ * request the wider key could ever need to honor separately from another subject's.
23
+ *
24
+ * This decorator can be used in two ways:
25
+ * - As a property decorator: `@encrypted() propertyName: type`
26
+ * - As a class decorator: `@encrypted() class TypeName { }`
27
+ *
28
+ * @param scope - The {@link EncryptionScope} the key is provisioned under - defaults to `EncryptionScope.Subject`.
29
+ * @param details - Optional details explaining why or to what purpose/extent the property/type needs encryption.
30
+ * @returns A decorator function that can be applied to either properties or classes (but not both on the same target).
31
+ *
32
+ * @example
33
+ * Property usage:
34
+ * ```typescript
35
+ * @readModel()
36
+ * class PartnerIntegration {
37
+ * @encrypted()
38
+ * apiKey: string = '';
39
+ *
40
+ * @encrypted(EncryptionScope.Namespace)
41
+ * webhookSigningSecret: string = '';
42
+ * }
43
+ * ```
44
+ */
45
+ export declare function encrypted(scope?: EncryptionScope, details?: string): PropertyDecorator & ClassDecorator;
46
+ /**
47
+ * Gets the encrypted security metadata for a property.
48
+ * @param target - The class prototype.
49
+ * @param propertyKey - The property name.
50
+ * @returns The security metadata, or undefined if not decorated with @encrypted.
51
+ */
52
+ export declare function getEncryptedMetadata(target: object, propertyKey: string): SecurityMetadata | undefined;
53
+ /**
54
+ * Checks whether a property has been decorated with @encrypted.
55
+ * @param target - The class prototype.
56
+ * @param propertyKey - The property name.
57
+ * @returns True if the property has @encrypted decorator; false otherwise.
58
+ */
59
+ export declare function hasEncryptedMetadata(target: object, propertyKey: string): boolean;
60
+ /**
61
+ * Gets the encrypted security metadata for a type.
62
+ * @param type - The type constructor.
63
+ * @returns The security metadata, or undefined if not decorated with @encrypted.
64
+ */
65
+ export declare function getTypeEncryptedMetadata(type: Function): SecurityMetadata | undefined;
66
+ /**
67
+ * Checks whether a type has been decorated with @encrypted.
68
+ * @param type - The type constructor.
69
+ * @returns True if the type has @encrypted decorator; false otherwise.
70
+ */
71
+ export declare function isEncrypted(type: Function): boolean;
72
+ //# sourceMappingURL=encrypted.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encrypted.d.ts","sourceRoot":"","sources":["../../confidentiality/encrypted.ts"],"names":[],"mappings":"AAGA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAwBpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAgB,SAAS,CAAC,KAAK,GAAE,eAAyC,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,iBAAiB,GAAG,cAAc,CAiChI;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS,CAEtG;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAEjF;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,QAAQ,GAAG,gBAAgB,GAAG,SAAS,CAErF;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAEnD"}
@@ -0,0 +1,130 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+ import 'reflect-metadata';
4
+ import { SecurityMetadataType } from './SecurityMetadataType';
5
+ import { EncryptionScope } from './EncryptionScope';
6
+ import { EncryptedNotSupportedOnEventSourceId } from './EncryptedNotSupportedOnEventSourceId';
7
+ import { TypeIntrospector } from '../types';
8
+ /** The property name this client uses everywhere for the event source identifier. */
9
+ const EVENT_SOURCE_ID_PROPERTY = 'eventSourceId';
10
+ /** Metadata key for the encrypted decorator on properties. */
11
+ const ENCRYPTED_PROPERTY_METADATA_KEY = 'chronicle:security:encrypted:property';
12
+ /** Metadata key for the encrypted decorator on types. */
13
+ const ENCRYPTED_TYPE_METADATA_KEY = 'chronicle:security:encrypted:type';
14
+ function metadataTypeFor(scope) {
15
+ switch (scope) {
16
+ case EncryptionScope.Subject:
17
+ return SecurityMetadataType.EncryptedSubject;
18
+ case EncryptionScope.Namespace:
19
+ return SecurityMetadataType.EncryptedNamespace;
20
+ case EncryptionScope.Global:
21
+ return SecurityMetadataType.EncryptedGlobal;
22
+ }
23
+ }
24
+ /**
25
+ * Decorator that marks a property or type as needing plain-confidentiality encryption at rest - a
26
+ * security measure, not a compliance one.
27
+ *
28
+ * Use `@encrypted()` for an operational secret that has no data subject and no lawful basis for
29
+ * erasure - an API key, a webhook signing secret, a partner credential. Use `@pii()` instead when
30
+ * the value is personal data about a natural person: only `@pii()` encrypts a value *and* enrolls it
31
+ * in GDPR right-to-erasure. Marking a secret `@pii()` would make it erasable on a request that was
32
+ * never about it; marking personal data `@encrypted()` would encrypt it but never erase it. The two
33
+ * are not interchangeable, and this decorator's key is never provisioned under the same identity a
34
+ * `@pii()` value for the same subject uses.
35
+ *
36
+ * All three {@link EncryptionScope} members are honored by the kernel: `EncryptionScope.Subject`
37
+ * (the default) provisions a key per compliance identity, exactly matching how a `@pii()` value on
38
+ * the same document is resolved; `EncryptionScope.Namespace` provisions one key shared by every
39
+ * value marked with it in a given event store namespace; `EncryptionScope.Global` provisions one key
40
+ * shared across the whole installation. Choosing a wider scope is safe for `@encrypted()` in a way
41
+ * it is not for `@pii()`, precisely because an operational secret has no data subject whose erasure
42
+ * request the wider key could ever need to honor separately from another subject's.
43
+ *
44
+ * This decorator can be used in two ways:
45
+ * - As a property decorator: `@encrypted() propertyName: type`
46
+ * - As a class decorator: `@encrypted() class TypeName { }`
47
+ *
48
+ * @param scope - The {@link EncryptionScope} the key is provisioned under - defaults to `EncryptionScope.Subject`.
49
+ * @param details - Optional details explaining why or to what purpose/extent the property/type needs encryption.
50
+ * @returns A decorator function that can be applied to either properties or classes (but not both on the same target).
51
+ *
52
+ * @example
53
+ * Property usage:
54
+ * ```typescript
55
+ * @readModel()
56
+ * class PartnerIntegration {
57
+ * @encrypted()
58
+ * apiKey: string = '';
59
+ *
60
+ * @encrypted(EncryptionScope.Namespace)
61
+ * webhookSigningSecret: string = '';
62
+ * }
63
+ * ```
64
+ */
65
+ export function encrypted(scope = EncryptionScope.Subject, details) {
66
+ return (target, propertyKey) => {
67
+ // Class decorator usage (for types like ConceptAs)
68
+ if (typeof target === 'function' && propertyKey === undefined) {
69
+ const metadata = {
70
+ metadataType: metadataTypeFor(scope),
71
+ details: details ?? ''
72
+ };
73
+ Reflect.defineMetadata(ENCRYPTED_TYPE_METADATA_KEY, metadata, target);
74
+ return;
75
+ }
76
+ // Property decorator usage
77
+ if (propertyKey !== undefined) {
78
+ const key = propertyKey.toString();
79
+ const declaringType = target.constructor;
80
+ // Encrypting the event source identifier would make its own decryption key
81
+ // unfindable - the identifier is required, in the clear, to correlate events and
82
+ // look up the key that protects everything else. Mirrors @pii()'s
83
+ // PIINotSupportedOnEventSourceId guard, for the same reason.
84
+ if (key === EVENT_SOURCE_ID_PROPERTY) {
85
+ throw new EncryptedNotSupportedOnEventSourceId(declaringType.name);
86
+ }
87
+ TypeIntrospector.trackProperty(declaringType, key);
88
+ const metadata = {
89
+ metadataType: metadataTypeFor(scope),
90
+ details: details ?? ''
91
+ };
92
+ Reflect.defineMetadata(ENCRYPTED_PROPERTY_METADATA_KEY, metadata, target, key);
93
+ }
94
+ };
95
+ }
96
+ /**
97
+ * Gets the encrypted security metadata for a property.
98
+ * @param target - The class prototype.
99
+ * @param propertyKey - The property name.
100
+ * @returns The security metadata, or undefined if not decorated with @encrypted.
101
+ */
102
+ export function getEncryptedMetadata(target, propertyKey) {
103
+ return Reflect.getMetadata(ENCRYPTED_PROPERTY_METADATA_KEY, target, propertyKey);
104
+ }
105
+ /**
106
+ * Checks whether a property has been decorated with @encrypted.
107
+ * @param target - The class prototype.
108
+ * @param propertyKey - The property name.
109
+ * @returns True if the property has @encrypted decorator; false otherwise.
110
+ */
111
+ export function hasEncryptedMetadata(target, propertyKey) {
112
+ return Reflect.hasMetadata(ENCRYPTED_PROPERTY_METADATA_KEY, target, propertyKey);
113
+ }
114
+ /**
115
+ * Gets the encrypted security metadata for a type.
116
+ * @param type - The type constructor.
117
+ * @returns The security metadata, or undefined if not decorated with @encrypted.
118
+ */
119
+ export function getTypeEncryptedMetadata(type) {
120
+ return Reflect.getMetadata(ENCRYPTED_TYPE_METADATA_KEY, type);
121
+ }
122
+ /**
123
+ * Checks whether a type has been decorated with @encrypted.
124
+ * @param type - The type constructor.
125
+ * @returns True if the type has @encrypted decorator; false otherwise.
126
+ */
127
+ export function isEncrypted(type) {
128
+ return Reflect.hasMetadata(ENCRYPTED_TYPE_METADATA_KEY, type);
129
+ }
130
+ //# sourceMappingURL=encrypted.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encrypted.js","sourceRoot":"","sources":["../../confidentiality/encrypted.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,kBAAkB,CAAC;AAE1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAA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MAAoC,CAAC,WAAW,CAAC;YAExE,2EAA2E;YAC3E,iFAAiF;YACjF,kEAAkE;YAClE,6DAA6D;YAC7D,IAAI,GAAG,KAAK,wBAAwB,EAAE,CAAC;gBACnC,MAAM,IAAI,oCAAoC,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;YACvE,CAAC;YAED,gBAAgB,CAAC,aAAa,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC;YACnD,MAAM,QAAQ,GAAqB;gBAC/B,YAAY,EAAE,eAAe,CAAC,KAAK,CAAC;gBACpC,OAAO,EAAE,OAAO,IAAI,EAAE;aACzB,CAAC;YACF,OAAO,CAAC,cAAc,CAAC,+BAA+B,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;QACnF,CAAC;IACL,CAAC,CAAC;AACN,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAAc,EAAE,WAAmB;IACpE,OAAO,OAAO,CAAC,WAAW,CAAC,+BAA+B,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;AACrF,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAAc,EAAE,WAAmB;IACpE,OAAO,OAAO,CAAC,WAAW,CAAC,+BAA+B,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;AACrF,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CAAC,IAAc;IACnD,OAAO,OAAO,CAAC,WAAW,CAAC,2BAA2B,EAAE,IAAI,CAAC,CAAC;AAClE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,IAAc;IACtC,OAAO,OAAO,CAAC,WAAW,CAAC,2BAA2B,EAAE,IAAI,CAAC,CAAC;AAClE,CAAC"}
@@ -0,0 +1,8 @@
1
+ export { SecurityMetadataType } from './SecurityMetadataType';
2
+ export type { SecurityMetadata } from './SecurityMetadata';
3
+ export { EncryptionScope } from './EncryptionScope';
4
+ export { encrypted, getEncryptedMetadata, hasEncryptedMetadata, getTypeEncryptedMetadata, isEncrypted } from './encrypted';
5
+ export { EncryptedNotSupportedOnEventSourceId } from './EncryptedNotSupportedOnEventSourceId';
6
+ export { PIIAndEncryptedCombinedNotSupported } from './PIIAndEncryptedCombinedNotSupported';
7
+ export { SecurityMetadataResolver } from './SecurityMetadataResolver';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../confidentiality/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC3H,OAAO,EAAE,oCAAoC,EAAE,MAAM,wCAAwC,CAAC;AAC9F,OAAO,EAAE,mCAAmC,EAAE,MAAM,uCAAuC,CAAC;AAC5F,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC"}
@@ -0,0 +1,9 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+ export { SecurityMetadataType } from './SecurityMetadataType';
4
+ export { EncryptionScope } from './EncryptionScope';
5
+ export { encrypted, getEncryptedMetadata, hasEncryptedMetadata, getTypeEncryptedMetadata, isEncrypted } from './encrypted';
6
+ export { EncryptedNotSupportedOnEventSourceId } from './EncryptedNotSupportedOnEventSourceId';
7
+ export { PIIAndEncryptedCombinedNotSupported } from './PIIAndEncryptedCombinedNotSupported';
8
+ export { SecurityMetadataResolver } from './SecurityMetadataResolver';
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../confidentiality/index.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC3H,OAAO,EAAE,oCAAoC,EAAE,MAAM,wCAAwC,CAAC;AAC9F,OAAO,EAAE,mCAAmC,EAAE,MAAM,uCAAuC,CAAC;AAC5F,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC"}
package/dist/index.d.ts CHANGED
@@ -20,6 +20,7 @@ import * as correlation from './correlation';
20
20
  import * as transactions from './transactions';
21
21
  import * as eventStoreSubscriptions from './eventStoreSubscriptions';
22
22
  import * as compliance from './compliance';
23
+ import * as confidentiality from './confidentiality';
23
24
  export { ChronicleClient } from './ChronicleClient';
24
25
  export { IncompatibleChronicleServer } from './connection/IncompatibleChronicleServer';
25
26
  export type { IChronicleClient } from './IChronicleClient';
@@ -53,5 +54,6 @@ export * from './correlation';
53
54
  export * from './transactions';
54
55
  export * from './eventStoreSubscriptions';
55
56
  export * from './compliance';
56
- export { events, eventSequences, reactors, reducers, seeding, readModels, projections, jobs, webhooks, externalServices, identities, observation, sinks, schemas, types, artifacts, identity, auditing, correlation, transactions, eventStoreSubscriptions, compliance, };
57
+ export * from './confidentiality';
58
+ export { events, eventSequences, reactors, reducers, seeding, readModels, projections, jobs, webhooks, externalServices, identities, observation, sinks, schemas, types, artifacts, identity, auditing, correlation, transactions, eventStoreSubscriptions, compliance, confidentiality, };
57
59
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,cAAc,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correlation';
22
22
  import * as transactions from './transactions';
23
23
  import * as eventStoreSubscriptions from './eventStoreSubscriptions';
24
24
  import * as compliance from './compliance';
25
+ import * as confidentiality from './confidentiality';
25
26
  export { ChronicleClient } from './ChronicleClient';
26
27
  export { IncompatibleChronicleServer } from './connection/IncompatibleChronicleServer';
27
28
  export { ChronicleOptions } from './ChronicleOptions';
@@ -53,5 +54,6 @@ export * from './correlation';
53
54
  export * from './transactions';
54
55
  export * from './eventStoreSubscriptions';
55
56
  export * from './compliance';
56
- export { events, eventSequences, reactors, reducers, seeding, readModels, projections, jobs, webhooks, externalServices, identities, observation, sinks, schemas, types, artifacts, identity, auditing, correlation, transactions, eventStoreSubscriptions, compliance, };
57
+ export * from './confidentiality';
58
+ export { events, eventSequences, reactors, reducers, seeding, readModels, projections, jobs, webhooks, externalServices, identities, observation, sinks, schemas, types, artifacts, identity, auditing, correlation, transactions, eventStoreSubscriptions, compliance, confidentiality, };
57
59
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,cAAc,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,WAAW,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AACvC,OAAO,KAAK,gBAAgB,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,W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AC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAElC,OAAO,EACH,MAAM,EACN,cAAc,EACd,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,UAAU,EACV,WAAW,EACX,IAAI,EACJ,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACV,WAAW,EACX,KAAK,EACL,OAAO,EACP,KAAK,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,uBAAuB,EACvB,UAAU,EACV,eAAe,GAClB,CAAC"}
@@ -11,6 +11,23 @@ export interface ComplianceSchemaMetadata {
11
11
  */
12
12
  details: string;
13
13
  }
14
+ /**
15
+ * Represents a single security classification recorded on a schema node.
16
+ *
17
+ * This is the security counterpart to {@link ComplianceSchemaMetadata} - written under its own,
18
+ * separate `security` schema key rather than merged into `compliance`. See
19
+ * `Source/confidentiality/SecurityMetadataType.ts` for why.
20
+ */
21
+ export interface SecuritySchemaMetadata {
22
+ /**
23
+ * The type of security metadata (e.g. 'EncryptedSubject', 'EncryptedNamespace', 'EncryptedGlobal').
24
+ */
25
+ metadataType: string;
26
+ /**
27
+ * Any additional details - can be empty.
28
+ */
29
+ details: string;
30
+ }
14
31
  /**
15
32
  * Represents a JSON Schema object.
16
33
  */
@@ -26,5 +43,6 @@ export type JsonSchema = {
26
43
  additionalProperties?: boolean | JsonSchema;
27
44
  enum?: Array<string | number | boolean | null>;
28
45
  compliance?: ComplianceSchemaMetadata[];
46
+ security?: SecuritySchemaMetadata[];
29
47
  };
30
48
  //# sourceMappingURL=JsonSchema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"JsonSchema.d.ts","sourceRoot":"","sources":["../../schemas/JsonSchema.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACrC;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;IACjF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACxC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,oBAAoB,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IAC5C,IAAI,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC,CAAC;IAC/C,UAAU,CAAC,EAAE,wBAAwB,EAAE,CAAC;CAC3C,CAAC"}
1
+ {"version":3,"file":"JsonSchema.d.ts","sourceRoot":"","sources":["../../schemas/JsonSchema.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACrC;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,sBAAsB;IACnC;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;IACjF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACxC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,oBAAoB,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IAC5C,IAAI,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC,CAAC;IAC/C,UAAU,CAAC,EAAE,wBAAwB,EAAE,CAAC;IACxC,QAAQ,CAAC,EAAE,sBAAsB,EAAE,CAAC;CACvC,CAAC"}
@@ -87,5 +87,46 @@ export declare class JsonSchemaGenerator {
87
87
  * nothing and makes the generated schema noisier to read and to diff.
88
88
  */
89
89
  private static hasComplianceMetadataOfType;
90
+ /**
91
+ * Collects security metadata for a property from every source compliance metadata is resolved
92
+ * from: the property itself, its declaring class, and its own type (the concept case). This is
93
+ * the security counterpart to {@link collectComplianceMetadata} - a deliberately separate walk
94
+ * rather than a shared one, over a completely separate `@encrypted()` decorator vocabulary.
95
+ * @param target - The class prototype the property is declared on.
96
+ * @param propertyKey - The property name.
97
+ * @param propertyType - The property's runtime type, when resolved.
98
+ * @returns The collected security metadata, in property → declaring-class → type order.
99
+ */
100
+ private static collectSecurityMetadata;
101
+ /**
102
+ * Adds security metadata to a schema node, descending into an object's properties so that the
103
+ * metadata always lands on the leaves that actually hold a value. This is the security
104
+ * counterpart to {@link addComplianceMetadataToSchema} - see its remarks for why metadata is
105
+ * pushed to leaves and why an array is left as a container.
106
+ * @param schema - The schema node to add to.
107
+ * @param metadata - The security metadata to add.
108
+ */
109
+ private static addSecurityMetadataToSchema;
110
+ /**
111
+ * Checks whether a security array already carries metadata of a given type.
112
+ * @param security - The security array to check.
113
+ * @param metadataType - The metadata type to look for.
114
+ * @returns True when the metadata type is already present, false if not.
115
+ */
116
+ private static hasSecurityMetadataOfType;
117
+ /**
118
+ * Rejects a property or type that resolved both compliance and security metadata.
119
+ * @param name - The property or type name, used in the thrown error.
120
+ * @param complianceMetadata - The compliance metadata collected for the property/type.
121
+ * @param securityMetadata - The security metadata collected for the property/type.
122
+ * @remarks
123
+ * This is not merely redundant - it corrupts the value. The kernel applies every matching
124
+ * handler for a property in sequence, so a value marked both ways is encrypted first under the
125
+ * PII key and then again under the Encrypted key; releasing it decrypts with the wrong key
126
+ * against ciphertext, which fails loudly rather than returning a wrong value. Checked here, at
127
+ * schema-generation time, the same point C#'s `EncryptedMetadataProvider.ThrowIfAlsoPII` checks
128
+ * it - this client has no compile-time analyzer, so this runtime check is the only backstop.
129
+ */
130
+ private static throwIfBothCompliantAndSecure;
90
131
  }
91
132
  //# sourceMappingURL=JsonSchemaGenerator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"JsonSchemaGenerator.d.ts","sourceRoot":"","sources":["../../schemas/JsonSchemaGenerator.ts"],"names":[],"mappings":"AAGA,OAAO,kBAAkB,CAAC;AAE1B,OAAO,EAA4B,UAAU,EAAE,MAAM,cAAc,CAAC;AAKpE;;GAEG;AACH,qBAAa,mBAAmB;IAC5B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,iBAAiB,CAGtC;IAEH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAEnC;IAEH;;;;OAIG;IACH,MAAM,CAAC,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU;IAWnD;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,W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