diff --git a/FitConnect/Subscriber.cs b/FitConnect/Subscriber.cs index 5b1b6222f77babfb144c500c7546825edeada99f..f647dc848cdd7fa71454142b1f1870b5c60bbcf3 100644 --- a/FitConnect/Subscriber.cs +++ b/FitConnect/Subscriber.cs @@ -151,8 +151,9 @@ public class Subscriber : FitConnectClient, throw new ArgumentException("Destination not found"); } - if (!destination.Services!.Select(s => s.Identifier) - .Contains(submission.Metadata.PublicServiceType.Identifier)) { + var destinationService = destination.Services!.FirstOrDefault(s => + s.Identifier == submission.Metadata.PublicServiceType.Identifier); + if (destinationService == null) { var problem = new Problems(Problems.ProblemTypeEnum.UnsupportedService, Problems.DetailUnsupportedService); RejectSubmission(problem); @@ -174,6 +175,17 @@ public class Subscriber : FitConnectClient, throw new SecurityEventException(problem); } + + // SuccessCriteria:3.11 + // TODO get data schema for data + string? dataSchema = null; + if (dataSchema != null) { + if (destinationService.SubmissionSchemas.Select(s => s.SchemaUri) + .Contains(dataSchema)) { + } + } + + Dictionary<string, string> attachmentSignatures = (submitEvent.Payload as dynamic)?.authenticationTags?.attachments .ToObject<Dictionary<string, string>>()!;