syntax = "proto3"; option go_package = "whiteboxsystems.nl/openkv"; service OpenKV { // Onboarding rpc GetMetadata (GetMetadataRequest) returns (GetMetadataResponse) {} rpc Register (RegisterRequest) returns (RegisterResponse) {} rpc CompleteRegistration (CompleteRegistrationRequest) returns (CompleteRegistrationResponse) {} // Service config rpc ConfigService (ConfigServiceRequest) returns (ConfigServiceResponse) {} rpc UpdateSubscriptions (UpdateSubscriptionsRequest) returns (UpdateSubscriptionsResponse) {} rpc ListSubscriptions (ListSubscriptionsRequest) returns (ListSubscriptionsResponse) {} } enum AuthMethod { mTLS = 0; APIToken = 1; JWT = 2; Custom = 3; } message MTLSConfig { string publicKey = 1; } message APITokenConfig { string token = 1; } message JWTConfig { string publicKey = 1; } message CustomConfig { string method = 1; map params = 2; } message Error { int32 code = 1; string message = 2; } enum SubscriptionPolicy { subnone = 0; optin = 1; optout = 2; } enum ConsentPolicy { consentnone = 0; explicit = 1; presumed = 2; } message ProtocolDefinition { string protocol = 1; repeated AuthMethod authMethods = 2; } message ServiceDefinition { string id = 1; string name = 2; string description = 3; SubscriptionPolicy subscriptionPolicy = 4; ConsentPolicy consentPolicy = 5; repeated ProtocolDefinition fetchProtocols = 6; repeated ProtocolDefinition pushProtocols = 7; } message ServiceConfig { string protocol = 1; map config = 2; AuthConfig auth = 3; } message GetMetadataRequest {} message GetMetadataResponse { string supplier = 1; string system = 2; repeated ServiceDefinition services = 3; bool success = 4; Error error = 5; } message AuthConfig { AuthMethod method = 1; oneof config { MTLSConfig mtlsConfig = 2; APITokenConfig apiTokenConfig = 3; JWTConfig jwtConfig = 4; } } message RegisterRequest { string organisationId = 1; string organisationIdSystem = 2; // Type bijv AGB of BIG registratie string organisationDisplayName = 3; string organisationFormalName = 4; AuthConfig auth = 5; } message RegisterResponse { string reference = 1; bool success = 2; Error error = 3; } message CompleteRegistrationRequest { string reference = 1; string registrationToken = 2; } message CompleteRegistrationResponse { bool success = 1; Error error = 2; } message ConfigServiceRequest { string service = 1; bool enabled = 2; ServiceConfig fetch = 3; ServiceConfig push = 4; } message ConfigServiceResponse { string service = 1; bool enabled = 2; ServiceConfig fetch = 3; ServiceConfig push = 4; bool success = 5; Error error = 6; } message PatientMeta { string externalId = 1; string externalIdSystem = 2; string name = 3; string birthdate = 4; map custom = 5; } message SubscriptionData { PatientMeta subject = 1; bool subscribe = 2; map protocolMeta = 3; } message UpdateSubscriptionsRequest { string serviceId = 1; repeated SubscriptionData subscriptionData = 2; bool atomicUpdate = 3; } message SubscriptionError { int32 index = 1; Error error = 2; } message UpdateSubscriptionsResponse { bool success = 1; repeated SubscriptionError errors = 2; } message ListSubscriptionsRequest { string serviceId = 1; } message ListSubscriptionsResponse { bool success = 1; repeated SubscriptionData subscriptionData = 2; Error error = 3; }