@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
@@ -4,6 +4,8 @@ import 'reflect-metadata';
4
4
  import { ConceptAs, Fields, Guid } from '@cratis/fundamentals';
5
5
  import { TypeIntrospector } from '../types';
6
6
  import { ComplianceMetadataResolver } from '../compliance/ComplianceMetadataResolver';
7
+ import { SecurityMetadataResolver } from '../confidentiality/SecurityMetadataResolver';
8
+ import { PIIAndEncryptedCombinedNotSupported } from '../confidentiality/PIIAndEncryptedCombinedNotSupported';
7
9
  /**
8
10
  * Generates JSON schemas for class constructors using reflection metadata.
9
11
  */
@@ -46,11 +48,15 @@ export class JsonSchemaGenerator {
46
48
  // the runtime type was unavailable (e.g. esbuild/tsx omits design:paramtypes).
47
49
  if (Object.keys(propertySchema).length > 0) {
48
50
  // An array of concept elements resolves and applies its own item-level compliance
49
- // inside mapRuntimeTypeToSchema - the general property/type/declaring-class walk
50
- // below is skipped for it, mirroring the C# generator's enumerable-of-concept branch.
51
+ // and security metadata inside mapRuntimeTypeToSchema - the general
52
+ // property/type/declaring-class walk below is skipped for it, mirroring the C#
53
+ // generator's enumerable-of-concept branch.
51
54
  if (!this.isConceptArrayMember(target, memberName, memberType)) {
52
- const metadata = this.collectComplianceMetadata(prototype, memberName, memberType);
53
- this.addComplianceMetadataToSchema(propertySchema, metadata);
55
+ const complianceMetadata = this.collectComplianceMetadata(prototype, memberName, memberType);
56
+ const securityMetadata = this.collectSecurityMetadata(prototype, memberName, memberType);
57
+ this.throwIfBothCompliantAndSecure(memberName, complianceMetadata, securityMetadata);
58
+ this.addComplianceMetadataToSchema(propertySchema, complianceMetadata);
59
+ this.addSecurityMetadataToSchema(propertySchema, securityMetadata);
54
60
  }
55
61
  schemaProperties[memberName] = propertySchema;
56
62
  }
@@ -111,13 +117,16 @@ export class JsonSchemaGenerator {
111
117
  static mapArrayTypeToSchema(declaringType, propertyName) {
112
118
  const elementType = this.getArrayElementType(declaringType, propertyName);
113
119
  // An array whose element is a ConceptAs<T> loses its classification the moment it is put in
114
- // a list unless the element concept's own compliance metadata is carried onto the item schema -
115
- // a value that would be encrypted as a scalar would otherwise be persisted in the clear as a
116
- // list element. Mirrors the C# generator's explicit enumerable-of-concept branch.
120
+ // a list unless the element concept's own compliance/security metadata is carried onto the
121
+ // item schema - a value that would be encrypted as a scalar would otherwise be persisted in
122
+ // the clear as a list element. Mirrors the C# generator's explicit enumerable-of-concept branch.
117
123
  if (elementType && this.isConceptAs(elementType)) {
118
124
  const itemSchema = this.mapRuntimeTypeToSchema(elementType);
119
- const metadata = ComplianceMetadataResolver.getMetadataForType(elementType);
120
- this.addComplianceMetadataToSchema(itemSchema, metadata);
125
+ const complianceMetadata = ComplianceMetadataResolver.getMetadataForType(elementType);
126
+ const securityMetadata = SecurityMetadataResolver.getMetadataForType(elementType);
127
+ this.throwIfBothCompliantAndSecure(elementType.name, complianceMetadata, securityMetadata);
128
+ this.addComplianceMetadataToSchema(itemSchema, complianceMetadata);
129
+ this.addSecurityMetadataToSchema(itemSchema, securityMetadata);
121
130
  return { type: 'array', items: itemSchema };
122
131
  }
123
132
  return { type: 'array', items: { type: 'object' } };
@@ -256,5 +265,89 @@ export class JsonSchemaGenerator {
256
265
  static hasComplianceMetadataOfType(compliance, metadataType) {
257
266
  return compliance.some(item => item.metadataType === metadataType);
258
267
  }
268
+ /**
269
+ * Collects security metadata for a property from every source compliance metadata is resolved
270
+ * from: the property itself, its declaring class, and its own type (the concept case). This is
271
+ * the security counterpart to {@link collectComplianceMetadata} - a deliberately separate walk
272
+ * rather than a shared one, over a completely separate `@encrypted()` decorator vocabulary.
273
+ * @param target - The class prototype the property is declared on.
274
+ * @param propertyKey - The property name.
275
+ * @param propertyType - The property's runtime type, when resolved.
276
+ * @returns The collected security metadata, in property → declaring-class → type order.
277
+ */
278
+ static collectSecurityMetadata(target, propertyKey, propertyType) {
279
+ const metadata = [];
280
+ // Property-level security decorator.
281
+ if (SecurityMetadataResolver.hasMetadataFor(target, propertyKey)) {
282
+ metadata.push(...SecurityMetadataResolver.getMetadataFor(target, propertyKey));
283
+ }
284
+ // Declaring class-level security decorator - a class-level @encrypted() marks every one of
285
+ // its own properties, the same way a class-level @pii() does for compliance.
286
+ const declaringClass = target.constructor;
287
+ if (declaringClass) {
288
+ metadata.push(...SecurityMetadataResolver.getMetadataForType(declaringClass));
289
+ }
290
+ // Type-level security decorator on the property's own type (e.g., @encrypted on a ConceptAs).
291
+ if (propertyType) {
292
+ metadata.push(...SecurityMetadataResolver.getMetadataForType(propertyType));
293
+ }
294
+ return metadata;
295
+ }
296
+ /**
297
+ * Adds security metadata to a schema node, descending into an object's properties so that the
298
+ * metadata always lands on the leaves that actually hold a value. This is the security
299
+ * counterpart to {@link addComplianceMetadataToSchema} - see its remarks for why metadata is
300
+ * pushed to leaves and why an array is left as a container.
301
+ * @param schema - The schema node to add to.
302
+ * @param metadata - The security metadata to add.
303
+ */
304
+ static addSecurityMetadataToSchema(schema, metadata) {
305
+ if (metadata.length === 0) {
306
+ return;
307
+ }
308
+ if (schema.properties && Object.keys(schema.properties).length > 0) {
309
+ for (const propertySchema of Object.values(schema.properties)) {
310
+ this.addSecurityMetadataToSchema(propertySchema, metadata);
311
+ }
312
+ return;
313
+ }
314
+ const security = schema.security ?? [];
315
+ for (const item of metadata) {
316
+ const metadataType = item.metadataType.value.toString();
317
+ if (!this.hasSecurityMetadataOfType(security, metadataType)) {
318
+ security.push({ metadataType, details: item.details });
319
+ }
320
+ }
321
+ if (security.length > 0) {
322
+ schema.security = security;
323
+ }
324
+ }
325
+ /**
326
+ * Checks whether a security array already carries metadata of a given type.
327
+ * @param security - The security array to check.
328
+ * @param metadataType - The metadata type to look for.
329
+ * @returns True when the metadata type is already present, false if not.
330
+ */
331
+ static hasSecurityMetadataOfType(security, metadataType) {
332
+ return security.some(item => item.metadataType === metadataType);
333
+ }
334
+ /**
335
+ * Rejects a property or type that resolved both compliance and security metadata.
336
+ * @param name - The property or type name, used in the thrown error.
337
+ * @param complianceMetadata - The compliance metadata collected for the property/type.
338
+ * @param securityMetadata - The security metadata collected for the property/type.
339
+ * @remarks
340
+ * This is not merely redundant - it corrupts the value. The kernel applies every matching
341
+ * handler for a property in sequence, so a value marked both ways is encrypted first under the
342
+ * PII key and then again under the Encrypted key; releasing it decrypts with the wrong key
343
+ * against ciphertext, which fails loudly rather than returning a wrong value. Checked here, at
344
+ * schema-generation time, the same point C#'s `EncryptedMetadataProvider.ThrowIfAlsoPII` checks
345
+ * it - this client has no compile-time analyzer, so this runtime check is the only backstop.
346
+ */
347
+ static throwIfBothCompliantAndSecure(name, complianceMetadata, securityMetadata) {
348
+ if (complianceMetadata.length > 0 && securityMetadata.length > 0) {
349
+ throw new PIIAndEncryptedCombinedNotSupported(name);
350
+ }
351
+ }
259
352
  }
260
353
  //# sourceMappingURL=JsonSchemaGenerator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"JsonSchemaGenerator.js","sourceRoot":"","sources":["../../schemas/JsonSchemaGenerator.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAe,MAAM,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,OAAO,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AAEtF;;GAEG;AACH,MAAM,OAAO,mBAAmB;IACpB,MAAM,CAAU,iBAAiB,GAAG,IAAI,GAAG,CAAyD;QACxG,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;QAC1C,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;KAClD,CAAC,CAAC;IAEK,MAAM,CAAU,cAAc,GAAG,IAAI,GAAG,CAAiB;QAC7D,CAAC,MAAM,EAAE,MAAM,CAAC;KACnB,CAAC,CAAC;IAEH;;;;OAIG;IACH,MAAM,CAAC,iBAAiB,CAAC,KAAa;QAClC,OAAO;YACH,OAAO,EAAE,8CAA8C;YACvD,KAAK;YACL,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,EAAE;YACd,QAAQ,EAAE,EAAE;YACZ,oBAAoB,EAAE,KAAK;SAC9B,CAAC;IACN,CAAC;IAED;;;;;O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;gBAC5D,IAAI,CAAC,2BAA2B,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;YAC/D,CAAC;YACD,OAAO;QACX,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC;QACvC,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;YAC1B,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;YACxD,IAAI,CAAC,IAAI,CAAC,yBAAyB,CAAC,QAAQ,EAAE,YAAY,CAAC,EAAE,CAAC;gBAC1D,QAAQ,CAAC,IAAI,CAAC,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;YAC3D,CAAC;QACL,CAAC;QAED,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACtB,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC/B,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACK,MAAM,CAAC,yBAAyB,CAAC,QAAkC,EAAE,YAAoB;QAC7F,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,YAAY,KAAK,YAAY,CAAC,CAAC;IACrE,CAAC;IAED;;;;;;;;;;;;OAYG;IACK,MAAM,CAAC,6BAA6B,CAAC,IAAY,EAAE,kBAAwC,EAAE,gBAAoC;QACrI,IAAI,kBAAkB,CAAC,MAAM,GAAG,CAAC,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC/D,MAAM,IAAI,mCAAmC,CAAC,IAAI,CAAC,CAAC;QACxD,CAAC;IACL,CAAC"}
@@ -1 +1 @@
1
- {"root":["../ChronicleClient.ts","../ChronicleOptions.ts","../EventStore.ts","../EventStoreName.ts","../EventStoreNamespaceName.ts","../IChronicleClient.ts","../IEventStore.ts","../Metrics.ts","../Tracing.ts","../index.ts","../artifacts/DefaultClientArtifactsProvider.ts","../artifacts/IClientArtifactsProvider.ts","../artifacts/index.ts","../auditing/Causation.ts","../auditing/CausationManager.ts","../auditing/CausationType.ts","../auditing/ICausationManager.ts","../auditing/index.ts","../compliance/ComplianceContracts.ts","../compliance/ComplianceMetadata.ts","../compliance/ComplianceMetadataResolver.ts","../compliance/ComplianceMetadataType.ts","../compliance/IPIIManager.ts","../compliance/PIIManager.ts","../compliance/PIINotSupportedOnEventSourceId.ts","../compliance/index.ts","../compliance/pii.ts","../compliance/subject.ts","../connection/ChronicleConnection.ts","../connection/ChronicleConnectionString.ts","../connection/ChronicleServerAddressResolver.ts","../connection/ChronicleServices.ts","../connection/ChronicleSrvResolutionError.ts","../connection/ChronicleSrvResolver.ts","../connection/CompatibilityPreflight.ts","../connection/ConnectionLifecycle.ts","../connection/DateTimeOffset.ts","../connection/Guid.ts","../connection/ILoadBalancerStrategy.ts","../connection/IncompatibleChronicleServer.ts","../connection/KernelKeepAlive.ts","../connection/LeastConnectionsLoadBalancerStrategy.ts","../connection/LoadBalancerMode.ts","../connection/LoadBalancerStrategyFactory.ts","../connection/RandomLoadBalancerStrategy.ts","../connection/RoundRobinLoadBalancerStrategy.ts","../connection/TokenProvider.ts","../connection/callResults.ts","../connection/fetchOAuthAccessToken.ts","../connection/formatServerAddress.ts","../connection/index.ts","../correlation/CorrelationId.ts","../correlation/CorrelationIdManager.ts","../correlation/ICorrelationIdAccessor.ts","../correlation/ICorrelationIdSetter.ts","../correlation/index.ts","../eventSequences/AppendError.ts","../eventSequences/AppendOperationsBroadcaster.ts","../eventSequences/AppendOptions.ts","../eventSequences/AppendResult.ts","../eventSequences/AppendedEventWithResult.ts","../eventSequences/CompleteStreamError.ts","../eventSequences/CompleteStreamResult.ts","../eventSequences/ConcurrencyScope.ts","../eventSequences/ConcurrencyViolation.ts","../eventSequences/ConstraintViolation.ts","../eventSequences/EventForEventSourceId.ts","../eventSequences/EventLog.ts","../eventSequences/EventSequence.ts","../eventSequences/EventSequenceId.ts","../eventSequences/EventSequenceNumber.ts","../eventSequences/IEventLog.ts","../eventSequences/IEventSequence.ts","../eventSequences/ITransactionalEventSequence.ts","../eventSequences/TransactionalEventSequence.ts","../eventSequences/WaitForCompletionResult.ts","../eventSequences/index.ts","../eventStoreSubscriptions/EventStoreSubscriptionBuilder.ts","../eventStoreSubscriptions/EventStoreSubscriptionDefinition.ts","../eventStoreSubscriptions/EventStoreSubscriptionId.ts","../eventStoreSubscriptions/EventStoreSubscriptions.ts","../eventStoreSubscriptions/IEventStoreSubscriptionBuilder.ts","../eventStoreSubscriptions/IEventStoreSubscriptions.ts","../eventStoreSubscriptions/contracts.ts","../eventStoreSubscriptions/index.ts","../events/AppendedEvent.ts","../events/CausationEntry.ts","../events/EventContext.ts","../events/EventType.ts","../events/EventTypeGeneration.ts","../events/EventTypeId.ts","../events/EventTypes.ts","../events/IEventTypes.ts","../events/Tag.ts","../events/WireEventContext.ts","../events/eventTypeDecorator.ts","../events/filterEventsByTagDecorator.ts","../events/index.ts","../events/mergeTags.ts","../events/tagDecorator.ts","../events/toClientEventContext.ts","../events/constraints/ConstraintBuilder.ts","../events/constraints/ConstraintId.ts","../events/constraints/Constraints.ts","../events/constraints/IConstraint.ts","../events/constraints/IConstraintBuilder.ts","../events/constraints/IConstraints.ts","../events/constraints/IUniqueConstraintBuilder.ts","../events/constraints/UniqueConstraintBuilder.ts","../events/constraints/constraint.ts","../events/constraints/index.ts","../events/migrations/EventMigrationBuilder.ts","../events/migrations/EventMigrationPropertyBuilder.ts","../events/migrations/EventTypeMigrators.ts","../events/migrations/IEventMigrationBuilder.ts","../events/migrations/IEventMigrationPropertyBuilder.ts","../events/migrations/IEventTypeMigration.ts","../events/migrations/IEventTypeMigrators.ts","../events/migrations/InvalidMigrationGenerationGap.ts","../events/migrations/eventTypeMigration.ts","../events/migrations/index.ts","../externalServices/ExternalServiceBuilder.ts","../externalServices/ExternalServices.ts","../externalServices/ExternalServicesContracts.ts","../externalServices/IExternalServiceBuilder.ts","../externalServices/IExternalServices.ts","../externalServices/index.ts","../identities/IIdentityManager.ts","../identities/IdentityManager.ts","../identities/index.ts","../identity/IIdentityProvider.ts","../identity/Identity.ts","../identity/IdentityProvider.ts","../identity/index.ts","../jobs/IJobs.ts","../jobs/JobId.ts","../jobs/Jobs.ts","../jobs/index.ts","../observation/FailedPartition.ts","../observation/FailedPartitionAttempt.ts","../observation/FailedPartitions.ts","../observation/ICanBeNotifiedWhenPartitionReplayed.ts","../observation/ICanBeNotifiedWhenReplay.ts","../observation/IFailedPartitions.ts","../observation/ObserverId.ts","../observation/ObserverRunningState.ts","../observation/index.ts","../observation/notifyReplayLifecycle.ts","../observation/toClientFailedPartition.ts","../observation/toObserverRunningState.ts","../projections/GlobalHandlerPropertyNotOnVariant.ts","../projections/IProjections.ts","../projections/ProjectionId.ts","../projections/ProjectionQueryResult.ts","../projections/ProjectionState.ts","../projections/Projections.ts","../projections/UnableToQueryProjection.ts","../projections/VariantMustDeclareEntersOnEvent.ts","../projections/VariantReclassifier.ts","../projections/index.ts","../projections/declarative/AddBuilder.ts","../projections/declarative/AddChildBuilder.ts","../projections/declarative/AllSetBuilder.ts","../projections/declarative/ChildrenBuilder.ts","../projections/declarative/CompositeKeyBuilder.ts","../projections/declarative/FromBuilder.ts","../projections/declarative/FromEveryBuilder.ts","../projections/declarative/IAddBuilder.ts","../projections/declarative/IAddChildBuilder.ts","../projections/declarative/IAllSetBuilder.ts","../projections/declarative/IChildrenBuilder.ts","../projections/declarative/ICompositeKeyBuilder.ts","../projections/declarative/IFromBuilder.ts","../projections/declarative/IFromEveryBuilder.ts","../projections/declarative/IJoinBuilder.ts","../projections/declarative/INestedBuilder.ts","../projections/declarative/IProjectionBuilder.ts","../projections/declarative/IProjectionBuilderFor.ts","../projections/declarative/IProjectionFor.ts","../projections/declarative/IReadModelPropertiesBuilder.ts","../projections/declarative/IRemovedWithBuilder.ts","../projections/declarative/IRemovedWithJoinBuilder.ts","../projections/declarative/ISetBuilder.ts","../projections/declarative/ISubtractBuilder.ts","../projections/declarative/JoinBuilder.ts","../projections/declarative/NestedBuilder.ts","../projections/declarative/ProjectionBuilderCore.ts","../projections/declarative/ProjectionBuilderFor.ts","../projections/declarative/RemovedWithBuilder.ts","../projections/declarative/RemovedWithJoinBuilder.ts","../projections/declarative/SetBuilder.ts","../projections/declarative/SubtractBuilder.ts","../projections/declarative/index.ts","../projections/declarative/projection.ts","../projections/modelBound/FromEventMetadata.ts","../projections/modelBound/FromEventOptions.ts","../projections/modelBound/addFrom.ts","../projections/modelBound/childrenAndNestedBuilder.ts","../projections/modelBound/childrenFrom.ts","../projections/modelBound/clearWith.ts","../projections/modelBound/count.ts","../projections/modelBound/decrement.ts","../projections/modelBound/entersOn.ts","../projections/modelBound/eventSequence.ts","../projections/modelBound/fromAll.ts","../projections/modelBound/fromEvent.ts","../projections/modelBound/fromEvery.ts","../projections/modelBound/globalFor.ts","../projections/modelBound/increment.ts","../projections/modelBound/index.ts","../projections/modelBound/join.ts","../projections/modelBound/nested.ts","../projections/modelBound/noAutoMap.ts","../projections/modelBound/notRewindable.ts","../projections/modelBound/passive.ts","../projections/modelBound/removedWith.ts","../projections/modelBound/removedWithJoin.ts","../projections/modelBound/setFrom.ts","../projections/modelBound/setFromContext.ts","../projections/modelBound/setValue.ts","../projections/modelBound/subtractFrom.ts","../projections/modelBound/variantOf.ts","../reactors/IReactors.ts","../reactors/ReactorId.ts","../reactors/ReactorSideEffects.ts","../reactors/Reactors.ts","../reactors/index.ts","../reactors/reactor.ts","../readModels/IMaterializedReadModels.ts","../readModels/IReadModels.ts","../readModels/MaterializedReadModels.ts","../readModels/ReadModelChangeset.ts","../readModels/ReadModelId.ts","../readModels/ReadModelSnapshot.ts","../readModels/ReadModelSubjectResolver.ts","../readModels/ReadModels.ts","../readModels/index.ts","../readModels/readModel.ts","../reducers/IReducers.ts","../reducers/ReducerId.ts","../reducers/Reducers.ts","../reducers/index.ts","../reducers/reducer.ts","../schemas/JsonSchema.ts","../schemas/JsonSchemaGenerator.ts","../schemas/index.ts","../schemas/jsonSchemaProperty.ts","../seeding/EventSeeding.ts","../seeding/ICanSeedEvents.ts","../seeding/IEventSeeding.ts","../seeding/IEventSeedingBuilder.ts","../seeding/IEventSeedingScopeBuilder.ts","../seeding/index.ts","../seeding/seeder.ts","../sinks/WellKnownSinks.ts","../sinks/index.ts","../transactions/IUnitOfWork.ts","../transactions/IUnitOfWorkManager.ts","../transactions/NoUnitOfWorkHasBeenStarted.ts","../transactions/UnitOfWork.ts","../transactions/UnitOfWorkManager.ts","../transactions/index.ts","../types/DecoratorType.ts","../types/TypeDiscoverer.ts","../types/TypeIntrospector.ts","../types/index.ts","../webhooks/IWebhook.ts","../webhooks/IWebhookDefinitionBuilder.ts","../webhooks/IWebhooks.ts","../webhooks/WebhookDefinitionBuilder.ts","../webhooks/WebhookId.ts","../webhooks/WebhookTargetUrl.ts","../webhooks/Webhooks.ts","../webhooks/index.ts","../webhooks/webhook.ts"],"version":"6.0.3"}
1
+ {"root":["../ChronicleClient.ts","../ChronicleOptions.ts","../EventStore.ts","../EventStoreName.ts","../EventStoreNamespaceName.ts","../IChronicleClient.ts","../IEventStore.ts","../Metrics.ts","../Tracing.ts","../index.ts","../artifacts/DefaultClientArtifactsProvider.ts","../artifacts/IClientArtifactsProvider.ts","../artifacts/index.ts","../auditing/Causation.ts","../auditing/CausationManager.ts","../auditing/CausationType.ts","../auditing/ICausationManager.ts","../auditing/index.ts","../compliance/ComplianceContracts.ts","../compliance/ComplianceMetadata.ts","../compliance/ComplianceMetadataResolver.ts","../compliance/ComplianceMetadataType.ts","../compliance/IPIIManager.ts","../compliance/PIIManager.ts","../compliance/PIINotSupportedOnEventSourceId.ts","../compliance/index.ts","../compliance/pii.ts","../compliance/subject.ts","../confidentiality/EncryptedNotSupportedOnEventSourceId.ts","../confidentiality/EncryptionScope.ts","../confidentiality/PIIAndEncryptedCombinedNotSupported.ts","../confidentiality/SecurityMetadata.ts","../confidentiality/SecurityMetadataResolver.ts","../confidentiality/SecurityMetadataType.ts","../confidentiality/encrypted.ts","../confidentiality/index.ts","../connection/ChronicleConnection.ts","../connection/ChronicleConnectionString.ts","../connection/ChronicleServerAddressResolver.ts","../connection/ChronicleServices.ts","../connection/ChronicleSrvResolutionError.ts","../connection/ChronicleSrvResolver.ts","../connection/CompatibilityPreflight.ts","../connection/ConnectionLifecycle.ts","../connection/DateTimeOffset.ts","../connection/Guid.ts","../connection/ILoadBalancerStrategy.ts","../connection/IncompatibleChronicleServer.ts","../connection/KernelKeepAlive.ts","../connection/LeastConnectionsLoadBalancerStrategy.ts","../connection/LoadBalancerMode.ts","../connection/LoadBalancerStrategyFactory.ts","../connection/RandomLoadBalancerStrategy.ts","../connection/RoundRobinLoadBalancerStrategy.ts","../connection/TokenProvider.ts","../connection/callResults.ts","../connection/fetchOAuthAccessToken.ts","../connection/formatServerAddress.ts","../connection/index.ts","../correlation/CorrelationId.ts","../correlation/CorrelationIdManager.ts","../correlation/ICorrelationIdAccessor.ts","../correlation/ICorrelationIdSetter.ts","../correlation/index.ts","../eventSequences/AppendError.ts","../eventSequences/AppendOperationsBroadcaster.ts","../eventSequences/AppendOptions.ts","../eventSequences/AppendResult.ts","../eventSequences/AppendedEventWithResult.ts","../eventSequences/CompleteStreamError.ts","../eventSequences/CompleteStreamResult.ts","../eventSequences/ConcurrencyScope.ts","../eventSequences/ConcurrencyViolation.ts","../eventSequences/ConstraintViolation.ts","../eventSequences/EventForEventSourceId.ts","../eventSequences/EventLog.ts","../eventSequences/EventSequence.ts","../eventSequences/EventSequenceId.ts","../eventSequences/EventSequenceNumber.ts","../eventSequences/IEventLog.ts","../eventSequences/IEventSequence.ts","../eventSequences/ITransactionalEventSequence.ts","../eventSequences/TransactionalEventSequence.ts","../eventSequences/WaitForCompletionResult.ts","../eventSequences/index.ts","../eventStoreSubscriptions/EventStoreSubscriptionBuilder.ts","../eventStoreSubscriptions/EventStoreSubscriptionDefinition.ts","../eventStoreSubscriptions/EventStoreSubscriptionId.ts","../eventStoreSubscriptions/EventStoreSubscriptions.ts","../eventStoreSubscriptions/IEventStoreSubscriptionBuilder.ts","../eventStoreSubscriptions/IEventStoreSubscriptions.ts","../eventStoreSubscriptions/contracts.ts","../eventStoreSubscriptions/index.ts","../events/AppendedEvent.ts","../events/CausationEntry.ts","../events/EventContext.ts","../events/EventType.ts","../events/EventTypeGeneration.ts","../events/EventTypeId.ts","../events/EventTypes.ts","../events/IEventTypes.ts","../events/Tag.ts","../events/WireEventContext.ts","../events/eventTypeDecorator.ts","../events/filterEventsByTagDecorator.ts","../events/index.ts","../events/mergeTags.ts","../events/tagDecorator.ts","../events/toClientEventContext.ts","../events/constraints/ConstraintBuilder.ts","../events/constraints/ConstraintId.ts","../events/constraints/Constraints.ts","../events/constraints/IConstraint.ts","../events/constraints/IConstraintBuilder.ts","../events/constraints/IConstraints.ts","../events/constraints/IUniqueConstraintBuilder.ts","../events/constraints/UniqueConstraintBuilder.ts","../events/constraints/constraint.ts","../events/constraints/index.ts","../events/migrations/EventMigrationBuilder.ts","../events/migrations/EventMigrationPropertyBuilder.ts","../events/migrations/EventTypeMigrators.ts","../events/migrations/IEventMigrationBuilder.ts","../events/migrations/IEventMigrationPropertyBuilder.ts","../events/migrations/IEventTypeMigration.ts","../events/migrations/IEventTypeMigrators.ts","../events/migrations/InvalidMigrationGenerationGap.ts","../events/migrations/eventTypeMigration.ts","../events/migrations/index.ts","../externalServices/ExternalServiceBuilder.ts","../externalServices/ExternalServices.ts","../externalServices/ExternalServicesContracts.ts","../externalServices/IExternalServiceBuilder.ts","../externalServices/IExternalServices.ts","../externalServices/index.ts","../identities/IIdentityManager.ts","../identities/IdentityManager.ts","../identities/index.ts","../identity/IIdentityProvider.ts","../identity/Identity.ts","../identity/IdentityProvider.ts","../identity/index.ts","../jobs/IJobs.ts","../jobs/JobId.ts","../jobs/Jobs.ts","../jobs/index.ts","../observation/FailedPartition.ts","../observation/FailedPartitionAttempt.ts","../observation/FailedPartitions.ts","../observation/ICanBeNotifiedWhenPartitionReplayed.ts","../observation/ICanBeNotifiedWhenReplay.ts","../observation/IFailedPartitions.ts","../observation/ObserverId.ts","../observation/ObserverRunningState.ts","../observation/index.ts","../observation/notifyReplayLifecycle.ts","../observation/toClientFailedPartition.ts","../observation/toObserverRunningState.ts","../projections/GlobalHandlerPropertyNotOnVariant.ts","../projections/IProjections.ts","../projections/ProjectionId.ts","../projections/ProjectionQueryResult.ts","../projections/ProjectionState.ts","../projections/Projections.ts","../projections/UnableToQueryProjection.ts","../projections/VariantMustDeclareEntersOnEvent.ts","../projections/VariantReclassifier.ts","../projections/index.ts","../projections/declarative/AddBuilder.ts","../projections/declarative/AddChildBuilder.ts","../projections/declarative/AllSetBuilder.ts","../projections/declarative/ChildrenBuilder.ts","../projections/declarative/CompositeKeyBuilder.ts","../projections/declarative/FromBuilder.ts","../projections/declarative/FromEveryBuilder.ts","../projections/declarative/IAddBuilder.ts","../projections/declarative/IAddChildBuilder.ts","../projections/declarative/IAllSetBuilder.ts","../projections/declarative/IChildrenBuilder.ts","../projections/declarative/ICompositeKeyBuilder.ts","../projections/declarative/IFromBuilder.ts","../projections/declarative/IFromEveryBuilder.ts","../projections/declarative/IJoinBuilder.ts","../projections/declarative/INestedBuilder.ts","../projections/declarative/IProjectionBuilder.ts","../projections/declarative/IProjectionBuilderFor.ts","../projections/declarative/IProjectionFor.ts","../projections/declarative/IReadModelPropertiesBuilder.ts","../projections/declarative/IRemovedWithBuilder.ts","../projections/declarative/IRemovedWithJoinBuilder.ts","../projections/declarative/ISetBuilder.ts","../projections/declarative/ISubtractBuilder.ts","../projections/declarative/JoinBuilder.ts","../projections/declarative/NestedBuilder.ts","../projections/declarative/ProjectionBuilderCore.ts","../projections/declarative/ProjectionBuilderFor.ts","../projections/declarative/RemovedWithBuilder.ts","../projections/declarative/RemovedWithJoinBuilder.ts","../projections/declarative/SetBuilder.ts","../projections/declarative/SubtractBuilder.ts","../projections/declarative/index.ts","../projections/declarative/projection.ts","../projections/modelBound/FromEventMetadata.ts","../projections/modelBound/FromEventOptions.ts","../projections/modelBound/addFrom.ts","../projections/modelBound/childrenAndNestedBuilder.ts","../projections/modelBound/childrenFrom.ts","../projections/modelBound/clearWith.ts","../projections/modelBound/count.ts","../projections/modelBound/decrement.ts","../projections/modelBound/entersOn.ts","../projections/modelBound/eventSequence.ts","../projections/modelBound/fromAll.ts","../projections/modelBound/fromEvent.ts","../projections/modelBound/fromEvery.ts","../projections/modelBound/globalFor.ts","../projections/modelBound/increment.ts","../projections/modelBound/index.ts","../projections/modelBound/join.ts","../projections/modelBound/nested.ts","../projections/modelBound/noAutoMap.ts","../projections/modelBound/notRewindable.ts","../projections/modelBound/passive.ts","../projections/modelBound/removedWith.ts","../projections/modelBound/removedWithJoin.ts","../projections/modelBound/setFrom.ts","../projections/modelBound/setFromContext.ts","../projections/modelBound/setValue.ts","../projections/modelBound/subtractFrom.ts","../projections/modelBound/variantOf.ts","../reactors/IReactors.ts","../reactors/ReactorId.ts","../reactors/ReactorSideEffects.ts","../reactors/Reactors.ts","../reactors/index.ts","../reactors/reactor.ts","../readModels/IMaterializedReadModels.ts","../readModels/IReadModels.ts","../readModels/MaterializedReadModels.ts","../readModels/ReadModelChangeset.ts","../readModels/ReadModelId.ts","../readModels/ReadModelSnapshot.ts","../readModels/ReadModelSubjectResolver.ts","../readModels/ReadModels.ts","../readModels/index.ts","../readModels/readModel.ts","../reducers/IReducers.ts","../reducers/ReducerId.ts","../reducers/Reducers.ts","../reducers/index.ts","../reducers/reducer.ts","../schemas/JsonSchema.ts","../schemas/JsonSchemaGenerator.ts","../schemas/index.ts","../schemas/jsonSchemaProperty.ts","../seeding/EventSeeding.ts","../seeding/ICanSeedEvents.ts","../seeding/IEventSeeding.ts","../seeding/IEventSeedingBuilder.ts","../seeding/IEventSeedingScopeBuilder.ts","../seeding/index.ts","../seeding/seeder.ts","../sinks/WellKnownSinks.ts","../sinks/index.ts","../transactions/IUnitOfWork.ts","../transactions/IUnitOfWorkManager.ts","../transactions/NoUnitOfWorkHasBeenStarted.ts","../transactions/UnitOfWork.ts","../transactions/UnitOfWorkManager.ts","../transactions/index.ts","../types/DecoratorType.ts","../types/TypeDiscoverer.ts","../types/TypeIntrospector.ts","../types/index.ts","../webhooks/IWebhook.ts","../webhooks/IWebhookDefinitionBuilder.ts","../webhooks/IWebhooks.ts","../webhooks/WebhookDefinitionBuilder.ts","../webhooks/WebhookId.ts","../webhooks/WebhookTargetUrl.ts","../webhooks/Webhooks.ts","../webhooks/index.ts","../webhooks/webhook.ts"],"version":"6.0.3"}
package/index.ts CHANGED
@@ -23,6 +23,7 @@ import * as correlation from './correlation';
23
23
  import * as transactions from './transactions';
24
24
  import * as eventStoreSubscriptions from './eventStoreSubscriptions';
25
25
  import * as compliance from './compliance';
26
+ import * as confidentiality from './confidentiality';
26
27
 
27
28
  export { ChronicleClient } from './ChronicleClient';
28
29
  export { IncompatibleChronicleServer } from './connection/IncompatibleChronicleServer';
@@ -58,6 +59,7 @@ export * from './correlation';
58
59
  export * from './transactions';
59
60
  export * from './eventStoreSubscriptions';
60
61
  export * from './compliance';
62
+ export * from './confidentiality';
61
63
 
62
64
  export {
63
65
  events,
@@ -82,4 +84,5 @@ export {
82
84
  transactions,
83
85
  eventStoreSubscriptions,
84
86
  compliance,
87
+ confidentiality,
85
88
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cratis/chronicle",
3
- "version": "6.2.0",
3
+ "version": "6.3.0",
4
4
  "description": "Event sourcing for TypeScript and Node.js — the idiomatic client for Cratis Chronicle, the open-source event-sourcing database",
5
5
  "author": "Cratis",
6
6
  "license": "MIT",
@@ -61,6 +61,11 @@
61
61
  "import": "./dist/compliance/index.js",
62
62
  "default": "./dist/compliance/index.js"
63
63
  },
64
+ "./confidentiality": {
65
+ "types": "./dist/confidentiality/index.d.ts",
66
+ "import": "./dist/confidentiality/index.js",
67
+ "default": "./dist/confidentiality/index.js"
68
+ },
64
69
  "./reactors": {
65
70
  "types": "./dist/reactors/index.d.ts",
66
71
  "import": "./dist/reactors/index.js",
@@ -160,7 +165,7 @@
160
165
  },
161
166
  "dependencies": {
162
167
  "@bufbuild/protobuf": "^2.15.0",
163
- "@cratis/chronicle.contracts": "19.0.1",
168
+ "@cratis/chronicle.contracts": "19.4.0",
164
169
  "@grpc/grpc-js": "^1.14.4",
165
170
  "@opentelemetry/api": "^1.9.1",
166
171
  "nice-grpc": "^2.1.17",
@@ -16,6 +16,25 @@ export interface ComplianceSchemaMetadata {
16
16
  details: string;
17
17
  }
18
18
 
19
+ /**
20
+ * Represents a single security classification recorded on a schema node.
21
+ *
22
+ * This is the security counterpart to {@link ComplianceSchemaMetadata} - written under its own,
23
+ * separate `security` schema key rather than merged into `compliance`. See
24
+ * `Source/confidentiality/SecurityMetadataType.ts` for why.
25
+ */
26
+ export interface SecuritySchemaMetadata {
27
+ /**
28
+ * The type of security metadata (e.g. 'EncryptedSubject', 'EncryptedNamespace', 'EncryptedGlobal').
29
+ */
30
+ metadataType: string;
31
+
32
+ /**
33
+ * Any additional details - can be empty.
34
+ */
35
+ details: string;
36
+ }
37
+
19
38
  /**
20
39
  * Represents a JSON Schema object.
21
40
  */
@@ -31,4 +50,5 @@ export type JsonSchema = {
31
50
  additionalProperties?: boolean | JsonSchema;
32
51
  enum?: Array<string | number | boolean | null>;
33
52
  compliance?: ComplianceSchemaMetadata[];
53
+ security?: SecuritySchemaMetadata[];
34
54
  };
@@ -0,0 +1,194 @@
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
+ import 'reflect-metadata';
5
+ import { ConceptAs, field } from '@cratis/fundamentals';
6
+ import { describe, expect, it } from 'vitest';
7
+ import { pii } from '../compliance/pii';
8
+ import { encrypted } from '../confidentiality/encrypted';
9
+ import { EncryptionScope } from '../confidentiality/EncryptionScope';
10
+ import { PIIAndEncryptedCombinedNotSupported } from '../confidentiality/PIIAndEncryptedCombinedNotSupported';
11
+ import { getReadModelMetadata, readModel } from '../readModels/readModel';
12
+ import { JsonSchema } from './JsonSchema';
13
+
14
+ // See JsonSchemaGenerator.spec.ts for why decorators are applied as plain function calls here
15
+ // rather than `@decorator` syntax, and why order matters.
16
+
17
+ function schemaFor(target: Function): JsonSchema {
18
+ return getReadModelMetadata(target)!.schema;
19
+ }
20
+
21
+ describe('JsonSchemaGenerator - security metadata', () => {
22
+ describe('when a class is marked @encrypted() at the class level', () => {
23
+ class PartnerCredentials {
24
+ apiKey = '';
25
+ webhookSecret = '';
26
+ }
27
+ encrypted()(PartnerCredentials);
28
+
29
+ readModel()(PartnerCredentials);
30
+ const schema = schemaFor(PartnerCredentials);
31
+
32
+ it('should mark every one of its own properties as EncryptedSubject', () => {
33
+ expect(schema.properties!.apiKey.security).toEqual([{ metadataType: 'EncryptedSubject', details: '' }]);
34
+ expect(schema.properties!.webhookSecret.security).toEqual([{ metadataType: 'EncryptedSubject', details: '' }]);
35
+ });
36
+
37
+ it('should not write anything to the compliance key', () => {
38
+ expect(schema.properties!.apiKey.compliance).toBeUndefined();
39
+ expect(schema.properties!.webhookSecret.compliance).toBeUndefined();
40
+ });
41
+ });
42
+
43
+ describe('when only a single property is marked @encrypted()', () => {
44
+ class Integration {
45
+ apiKey = '';
46
+ name = '';
47
+ }
48
+ encrypted(EncryptionScope.Subject, 'Partner API key')(Integration.prototype, 'apiKey');
49
+ readModel()(Integration);
50
+ const schema = schemaFor(Integration);
51
+
52
+ it('should mark the decorated property as EncryptedSubject', () => {
53
+ expect(schema.properties!.apiKey.security).toEqual([{ metadataType: 'EncryptedSubject', details: 'Partner API key' }]);
54
+ });
55
+
56
+ it('should leave the other property without security metadata', () => {
57
+ expect(schema.properties!.name.security).toBeUndefined();
58
+ });
59
+ });
60
+
61
+ describe.each([
62
+ [EncryptionScope.Subject, 'EncryptedSubject'],
63
+ [EncryptionScope.Namespace, 'EncryptedNamespace'],
64
+ [EncryptionScope.Global, 'EncryptedGlobal']
65
+ ])('when a property is marked @encrypted() with scope %s', (scope, expectedMetadataType) => {
66
+ class Secret {
67
+ value = '';
68
+ }
69
+ encrypted(scope)(Secret.prototype, 'value');
70
+ readModel()(Secret);
71
+ const schema = schemaFor(Secret);
72
+
73
+ it(`should resolve to metadataType ${expectedMetadataType}`, () => {
74
+ expect(schema.properties!.value.security).toEqual([{ metadataType: expectedMetadataType, details: '' }]);
75
+ });
76
+ });
77
+
78
+ describe('when a property is typed as a ConceptAs<T> marked @encrypted()', () => {
79
+ class ApiKey extends ConceptAs<string> {
80
+ constructor(value: string) {
81
+ super(value);
82
+ }
83
+ }
84
+ encrypted(EncryptionScope.Namespace, 'Shared namespace key')(ApiKey);
85
+
86
+ class Configuration {
87
+ key: ApiKey = new ApiKey('');
88
+ }
89
+ readModel()(Configuration);
90
+ const schema = schemaFor(Configuration);
91
+
92
+ it('should mark the concept-typed property as EncryptedNamespace', () => {
93
+ expect(schema.properties!.key.security).toEqual([{ metadataType: 'EncryptedNamespace', details: 'Shared namespace key' }]);
94
+ });
95
+ });
96
+
97
+ describe('when a property typed as a nested composite value object is marked @encrypted()', () => {
98
+ class ContactDetails {
99
+ phone = '';
100
+ fax = '';
101
+ }
102
+ class Vendor {
103
+ contact: ContactDetails = new ContactDetails();
104
+ }
105
+ encrypted(EncryptionScope.Subject, 'Vendor contact information')(Vendor.prototype, 'contact');
106
+ readModel()(Vendor);
107
+ const schema = schemaFor(Vendor);
108
+
109
+ it('should push the security metadata down onto every leaf property', () => {
110
+ expect(schema.properties!.contact.properties!.phone.security).toEqual([{ metadataType: 'EncryptedSubject', details: 'Vendor contact information' }]);
111
+ expect(schema.properties!.contact.properties!.fax.security).toEqual([{ metadataType: 'EncryptedSubject', details: 'Vendor contact information' }]);
112
+ });
113
+
114
+ it('should not leave security metadata on the container node itself', () => {
115
+ expect(schema.properties!.contact.security).toBeUndefined();
116
+ });
117
+ });
118
+
119
+ describe('when an array element is a ConceptAs<T> marked @encrypted()', () => {
120
+ class Token extends ConceptAs<string> {
121
+ constructor(value: string) {
122
+ super(value);
123
+ }
124
+ }
125
+ encrypted(EncryptionScope.Subject, 'Rotating token')(Token);
126
+
127
+ class Session {
128
+ tokens: Token[] = [];
129
+ }
130
+ field(Array, { enumerable: true, genericArguments: [Token] })(Session.prototype, 'tokens');
131
+ readModel()(Session);
132
+ const schema = schemaFor(Session);
133
+
134
+ it('should carry the element concept security metadata onto the item schema', () => {
135
+ expect(schema.properties!.tokens.items!.security).toEqual([{ metadataType: 'EncryptedSubject', details: 'Rotating token' }]);
136
+ });
137
+
138
+ it('should not leave coarse security metadata on the array container itself', () => {
139
+ expect(schema.properties!.tokens.security).toBeUndefined();
140
+ });
141
+ });
142
+
143
+ describe('when a property is marked both @pii() and @encrypted()', () => {
144
+ class ConflictedValue {
145
+ value = '';
146
+ }
147
+ pii()(ConflictedValue.prototype, 'value');
148
+ encrypted()(ConflictedValue.prototype, 'value');
149
+
150
+ it('should throw PIIAndEncryptedCombinedNotSupported when generating the schema', () => {
151
+ expect(() => { readModel()(ConflictedValue); }).toThrow(PIIAndEncryptedCombinedNotSupported);
152
+ });
153
+ });
154
+
155
+ describe('when a class-level @pii() combines with a property-level @encrypted() on the same property', () => {
156
+ class MixedClass {
157
+ value = '';
158
+ }
159
+ pii()(MixedClass);
160
+ encrypted()(MixedClass.prototype, 'value');
161
+
162
+ it('should throw PIIAndEncryptedCombinedNotSupported when generating the schema', () => {
163
+ expect(() => { readModel()(MixedClass); }).toThrow(PIIAndEncryptedCombinedNotSupported);
164
+ });
165
+ });
166
+
167
+ describe('when a class carries only @pii() properties alongside a class that carries only @encrypted() properties', () => {
168
+ class OnlyPii {
169
+ ssn = '';
170
+ }
171
+ pii()(OnlyPii.prototype, 'ssn');
172
+ readModel()(OnlyPii);
173
+
174
+ class OnlyEncrypted {
175
+ apiKey = '';
176
+ }
177
+ encrypted()(OnlyEncrypted.prototype, 'apiKey');
178
+ readModel()(OnlyEncrypted);
179
+
180
+ it('should not throw for either type', () => {
181
+ expect(() => schemaFor(OnlyPii)).not.toThrow();
182
+ expect(() => schemaFor(OnlyEncrypted)).not.toThrow();
183
+ });
184
+
185
+ it('should keep compliance and security metadata on separate schema keys', () => {
186
+ const piiSchema = schemaFor(OnlyPii);
187
+ const encryptedSchema = schemaFor(OnlyEncrypted);
188
+ expect(piiSchema.properties!.ssn.compliance).toEqual([{ metadataType: 'PII', details: '' }]);
189
+ expect(piiSchema.properties!.ssn.security).toBeUndefined();
190
+ expect(encryptedSchema.properties!.apiKey.security).toEqual([{ metadataType: 'EncryptedSubject', details: '' }]);
191
+ expect(encryptedSchema.properties!.apiKey.compliance).toBeUndefined();
192
+ });
193
+ });
194
+ });