From b816a3ea0edd5d97784fcdc0a2285826f68e2666 Mon Sep 17 00:00:00 2001 From: ingmarvali Date: Sat, 26 Feb 2022 18:45:03 +0200 Subject: [PATCH 01/10] Update README --- RegistrationBB/README | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/RegistrationBB/README b/RegistrationBB/README index ff37aae..785b271 100644 --- a/RegistrationBB/README +++ b/RegistrationBB/README @@ -1,7 +1,15 @@ -Short Description: Records identifiers and other general information about a person, place or other entity, typically for the purpose of registration or enrollment in specific services or programmes and tracking of that entity over time. +Registration Building Block API Definitions +This repository holds OpenAPI definitions for Registration BB - one of the building blocks that have been developed by the GovStack expert working groups. -Full Description: Registration services attribute a unique functional ID to a person, place or other entity to identify and access information about it. According to the World Bank, functional IDs are those that evolve out of a single use-case, such as voter IDs, health records, or bank cards, and are created with a specific purpose in mind, differing from foundational IDs which are created with a general purpose in mind. Registration services can also use the foundational ID or map it to the functional ID where such an identity exists. Examples of specific registration services include immunization, disease and citizenship records, as well as birth and death registration. The ensemble of utilities for capturing, recording, profiling, searching, retrieving and verifying this identity information is encapsulated as registration services. The information itself will be deposited into and retrieved from corresponding functional registries (see the Registries ICT Building Blocks). Registration services help profile entities by enabling the registration of different categories or groups and documenting their access to various services. These services also onboard users into a programme or service offered by an organization (eg rural advisory service), capturing related demography, profile and citizen ID information. +Each building block API definition must be stored in a json file that is compatible with the OpenAPI 3.0 standard -Other Names: Enrollment services +Acknowledgement +This specification was prepared by a team comprising Frank Grozel (UNCTAD), Ingmar Vali (UNCTAD), Tambet Artma (Centre of Registers and Information Systems), Saurav Bhattarai (GIZ), Dr Ramkumar (ITU), Rauno Kulla (UNCTAD). -https://solutions.dial.community/building_blocks/registration +Status +Current status of the specification is v.1.0 Currently under review. + +Reference +UNCTAD eRegistrations: https://digitalgovernment.world/ +UNCTAD https://unctad.org/ +Use Cases: https://solutions.dial.community/building_blocks/registration From 1126d298c36fb0369545c87b5ee8d1334c1035d7 Mon Sep 17 00:00:00 2001 From: ingmarvali Date: Sat, 26 Feb 2022 18:47:43 +0200 Subject: [PATCH 02/10] Update README.txt --- DigitalRegistriesBB/README.txt | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/DigitalRegistriesBB/README.txt b/DigitalRegistriesBB/README.txt index d5b3f8e..85a9153 100644 --- a/DigitalRegistriesBB/README.txt +++ b/DigitalRegistriesBB/README.txt @@ -1,6 +1,15 @@ -Short Description: Registries are centrally managed databases that uniquely identify persons, vendors, facilities, procedures, products and sites related to an organization, industry or activity. +Digital Registries Building Block API Definitions +This repository holds OpenAPI definitions for Digital Registries BB - one of the building blocks that have been developed by the GovStack expert working groups. -Full Description: Registries store unique identifiers of persons, vendors, facilities, procedures, products and sites and are used to record and monitor resources and assets (physical or virtual). These resources are those that are used by a person, organization or industry, or they are consumed while performing certain activities. Registries store essential information for identification and verification purposes, such as name, biometrics/photos, location/contact details and basic profile of the person (eg age, sex qualification, etc), facility (eg type of entity, specialization) or thing (eg equipment type, serial number, warranty period). +Each building block API definition must be stored in a json file that is compatible with the OpenAPI 3.0 standard -Other Names: Directories, Functional registries -https://solutions.dial.community/building_blocks/digital_registries +Acknowledgement +This specification was prepared by a team comprising Frank Grozel (UNCTAD), Ingmar Vali (UNCTAD), Tambet Artma (Centre of Registers and Information Systems), Saurav Bhattarai (GIZ), Dr Ramkumar (ITU), Rauno Kulla (UNCTAD). + +Status +Current status of the specification is v.1.0 Currently under review. + +Reference +UNCTAD eRegistrations: https://digitalgovernment.world/ +UNCTAD https://unctad.org/ +Use Cases: https://solutions.dial.community/building_blocks/digital_registries From 193671b75570e5686998dbcb8d8a2bc6123ae60e Mon Sep 17 00:00:00 2001 From: ingmarvali Date: Sat, 26 Feb 2022 18:48:25 +0200 Subject: [PATCH 03/10] Create README.txt Corrected the text From 7c01b3061efd0e0f8f2a709a28546f5fda943d60 Mon Sep 17 00:00:00 2001 From: ingmarvali Date: Wed, 9 Mar 2022 22:33:34 +0200 Subject: [PATCH 04/10] Create test-IDV --- IDV/test-IDV | 1010 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1010 insertions(+) create mode 100644 IDV/test-IDV diff --git a/IDV/test-IDV b/IDV/test-IDV new file mode 100644 index 0000000..6a686ef --- /dev/null +++ b/IDV/test-IDV @@ -0,0 +1,1010 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Verification", + "description": "Verification of individual with the provided information", + "license": { + "name": "MPL-2.0", + "url": "https://www.mozilla.org/en-US/MPL/2.0/" + }, + "version": "1.0-oas3-oas3" + }, + + + + + + + "servers": [ + { + "url": "http://securityserver/r1/egovstack/GOV/7003/ID_Verification/authenticate" + } + ] + + + + + , + "paths": { + "/authenticate": { + "post": { + "summary": "", + "description": "To authenticate an individual", + "operationId": "post-authenticate", + "parameters": [ + { + "name": "Signature", + "in": "header", + "description": "JWS signature of the entire http body of the body header..signature", + "required": false, + "style": "simple", + "explode": false, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/authenticate_body" + }, + "examples": { + "Example": { + "value": { + "context": { + "id": "8284-8198-7235", + "transactionId": "TXN123456789", + "requestTime": "2016-07-16T19:20:30+5:30" + }, + "consent": { + "type": "linked", + "schema": "https://govstack.global/schema/consent", + "signUri": "https://govstack.global/TXN123456789.sig", + "linkUri": "https://govstack.global/TXN123456789.data" + }, + "demographics": [ + { + "attributeName": "name", + "operator": "=", + "value": "Sasi", + "lang": "eng" + } + ], + "biometrics": [ + { + "specVersion": "1.0", + "data": { + "captureDevice": "string", + "env": "string", + "deviceServiceVersion": "1.0", + "bioType": "Finger", + "bioSubType": "Left IndexFinger", + "purpose": "Auth", + "domainUri": "http://idv.govstack.global", + "bioValue": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTUxNjIzOTAyMn0.POstGetfAytaZS82wHcjoTyoqhMyxXiWdR7Nn7A29DNSl0EiXLdwJ6xC6AfgZWF1bOsS_TuYI3OG85AmiExREkrS6tDfTQ2B3WXlrr-wp5AokiRbz3_oB4OxG-W9KcEEbDRcZc0nH3L7LzYptiy1PtAylQGxHTWZXtGz4ht0bAecBgmpdgXMguEIcoqPJ1n3pIWk_dUZegpqx0Lka21H6XxUTxiy8OcaarA8zdnPUnV6AmNP3ecFawIFYdvJB_cm-GvpCSbr8G8y_Mllj8f4x9nBH8pQux89_6gUY618iYv7tuPWBFfEbLxtF2pZS6YC1aSfLQxeNe8djT9YjpvRZA", + "transactionId": "TXN123456789", + "timestamp": "2016-07-16T19:20:30+5:30", + "requestedScore": 65, + "qualityScore": 90 + }, + "hash": "string", + "sessionKey": "string", + "thumbprint": "string" + } + ], + "authFactors": [ + { + "factor": "string", + "specVersion": "string", + "data": [ + {} + ] + } + ] + } + } + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/inline_response_200" + }, + "examples": { + "example-1": {} + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "AuthFactor": { + "title": "AuthFactor", + "required": [ + "data", + "factor", + "specVersion" + ], + "type": "object", + "properties": { + "factor": { + "type": "string" + }, + "specVersion": { + "type": "string" + }, + "hash": { + "type": "string" + }, + "data": { + "type": "array", + "items": { + "type": "object" + } + }, + "security": { + "$ref": "#/components/schemas/Encryption" + } + } + }, + "AuthFactor_2": { + "title": "AuthFactor", + "required": [ + "data", + "factor", + "specVersion" + ], + "type": "object", + "properties": { + "factor": { + "maxLength": 256, + "minLength": 1, + "type": "string", + "description": "Name of the factor" + }, + "specVersion": { + "maxLength": 5, + "minLength": 1, + "type": "string", + "description": "Adopted spec version for this factor" + }, + "hash": { + "maxLength": 512, + "minLength": 1, + "type": "string", + "description": "hash value of the data object before encryption" + }, + "data": { + "type": "array", + "description": "Free data object as per the factors specification", + "items": { + "type": "object" + } + }, + "security": { + "$ref": "#/components/schemas/Encryption" + } + } + }, + "BiometricData": { + "title": "BiometricFactor", + "required": [ + "hash", + "sessionKey", + "specVersion", + "thumbprint" + ], + "type": "object", + "properties": { + "specVersion": { + "minLength": 1, + "type": "string", + "enum": [ + "0.95", + "1.0" + ] + }, + "data": { + "$ref": "#/components/schemas/BiometricData_data" + }, + "hash": { + "minLength": 1, + "type": "string" + }, + "sessionKey": { + "minLength": 1, + "type": "string" + }, + "thumbprint": { + "minLength": 1, + "type": "string" + } + } + }, + "CaptureDevice": { + "required": [ + "dateTime", + "make", + "model", + "serialNo", + "type" + ], + "type": "object", + "properties": { + "serialNo": { + "maxLength": 12, + "minLength": 0, + "type": "string", + "description": "Serial no of the device, same as whats printed on the device. In case of integrated pls ensure the it can be seen in about device or similar such features. Alpha numeric" + }, + "make": { + "maxLength": 50, + "minLength": 1, + "type": "string", + "description": "Make of the device" + }, + "model": { + "maxLength": 50, + "minLength": 1, + "type": "string", + "description": "Model of the device" + }, + "type": { + "maxLength": 50, + "minLength": 1, + "type": "string", + "description": "Type of the device", + "enum": [ + "Finger", + "Iris", + "Face" + ] + }, + "deviceSubType": { + "maxLength": 50, + "minLength": 1, + "type": "string", + "description": "Additional mode details of device type. Its a enum", + "enum": [ + "Slap", + "Single", + "Touchless", + "Double", + "Full Frontal" + ] + }, + "deviceProvider": { + "maxLength": 256, + "minLength": 1, + "type": "string", + "description": "Provider name as per the certification" + }, + "deviceProviderId": { + "maxLength": 50, + "minLength": 1, + "type": "string", + "description": "Unique provider id assigned by the certifier" + }, + "dateTime": { + "minLength": 1, + "type": "string", + "description": "ISO Timestamp of the device ", + "format": "date-time" + } + }, + "description": "Digital footprint of the capture device", + "x-examples": { + "example-1": { + "serialNo": "Serial number", + "make": "Make of the device", + "model": "Model of the device", + "type": "Type of the biometric device", + "deviceSubType": "Subtypes of the biometric device", + "deviceProvider": "Device provider name", + "deviceProviderId": "Device provider id", + "dateTime": "Current datetime in ISO format" + } + } + }, + "Consent": { + "title": "Consent", + "required": [ + "type" + ], + "type": "object", + "properties": { + "type": { + "maxLength": 50, + "minLength": 1, + "type": "string", + "description": "Consent type. Limited the enum values", + "example": "linked", + "enum": [ + "embedded", + "linked", + "no-consent" + ] + }, + "data": { + "maxLength": 256, + "minLength": 1, + "type": "string", + "description": "embedded data in jwt format" + }, + "schema": { + "maxLength": 256, + "minLength": 1, + "type": "string", + "description": "Schema for the consent", + "format": "uri-reference" + }, + "signUri": { + "maxLength": 256, + "minLength": 1, + "type": "string", + "description": "signature url. no data of the consent", + "format": "uri" + }, + "linkUri": { + "maxLength": 256, + "minLength": 1, + "type": "string", + "description": "unique link to the content of the consent", + "format": "uri" + } + }, + "description": "" + }, + "Credential": { + "title": "Credential", + "required": [ + "consent", + "credentialSubject", + "id", + "issuanceDate", + "issuedTo", + "issuer", + "proof", + "protectedAttributes", + "type" + ], + "type": "object", + "properties": { + "issuer": { + "maxLength": 256, + "minLength": 1, + "type": "string", + "description": "Who has issued this credential." + }, + "id": { + "maxLength": 256, + "minLength": 1, + "type": "string", + "description": "ID of the credential" + }, + "issuedTo": { + "maxLength": 256, + "minLength": 1, + "type": "string", + "description": "to whom the id is issued to" + }, + "issuanceDate": { + "minLength": 1, + "type": "string", + "format": "date-time" + }, + "protectedAttributes": { + "type": "array", + "description": "Array of attributes that are available in protected form (encrypted).", + "items": { + "type": "string" + } + }, + "credentialSubject": { + "$ref": "#/components/schemas/Credential_credentialSubject" + }, + "type": { + "maxItems": 20, + "minItems": 1, + "type": "array", + "description": "Array of strings indicating the type of the credential", + "items": { + "maxLength": 50, + "minLength": 1, + "type": "string", + "example": "[\"VerifiableCredential\", \"AlumniCredential\"]" + } + }, + "consent": { + "$ref": "#/components/schemas/Consent" + }, + "proof": { + "$ref": "#/components/schemas/Credential_proof" + } + }, + "description": "Credential", + "x-examples": { + "example-1": { + "issuedTo": "mpartner-default-print", + "protectedAttributes": [], + "issuanceDate": "2021-01-20T04:38:41.045Z", + "credentialSubject": { + "name": "james", + "gender": "male" + }, + "id": "http://govstack.global/credentials/9178c6ed-6c3d-4be4-9eef-7668ca236c21", + "type": [ + "VerifiableCredential", + "GovStackVerifiableCredential" + ], + "consent": "", + "issuer": "https://govstack.global/issuers/" + } + } + }, + "DemoAttribute": { + "title": "Demo", + "required": [ + "attributeName", + "value" + ], + "type": "object", + "properties": { + "attributeName": { + "maxLength": 50, + "minLength": 1, + "type": "string", + "description": "Name of the attribute. eg name, firstname" + }, + "value": { + "maxLength": 2096, + "minLength": 1, + "type": "string", + "description": "Value for the demographic data" + }, + "language": { + "maxLength": 3, + "minLength": 2, + "type": "string", + "description": "Language of the value ISO 639-1 in case the language is not available in 639-1 use 639-2" + } + } + }, + "Encryption": { + "title": "Encryption", + "required": [ + "algorithm", + "sessionKey", + "thumbprint" + ], + "type": "object", + "properties": { + "sessionKey": { + "maxLength": 2096, + "minLength": 0, + "type": "string", + "description": "random created key for this instance" + }, + "thumbprint": { + "maxLength": 32, + "minLength": 0, + "type": "string", + "description": "key id to uniquely identify the key, Can be url or hash of the key." + }, + "algorithm": { + "maxLength": 50, + "minLength": 1, + "type": "string", + "description": "algorithm used for protection of data" + } + } + }, + "authenticate_context": { + "required": [ + "id", + "requestTime", + "transactionId" + ], + "type": "object", + "properties": { + "id": { + "minLength": 1, + "type": "string", + "description": "Identity used for authentication" + }, + "transactionId": { + "maxLength": 50, + "minLength": 12, + "type": "string", + "description": "The current transaction id or service request id as per the relying party" + }, + "requestTime": { + "maxLength": 30, + "minLength": 12, + "type": "string", + "description": "Timestamp in ISO8601" + }, + "purpose": { + "maxLength": 256, + "minLength": 0, + "type": "string", + "description": "Purpose of the authentication request. Not mandatory but provides a way to ensure people know for what they are doing it" + }, + "issuer": { + "maxLength": 250, + "minLength": 0, + "type": "string", + "description": "Issuer of this ID. Its optional. Auth can be rejected in some scenarios if this is not present" + }, + "type": { + "maxLength": 150, + "minLength": 0, + "type": "string", + "description": "Type of the ID. Its optional and auth can not be rejected if the type is not present." + } + }, + "example": null + }, + "authenticate_body": { + "required": [ + "authFactors", + "biometrics", + "consent", + "context", + "demographics", + "security" + ], + "type": "object", + "properties": { + "context": { + "$ref": "#/components/schemas/authenticate_context" + }, + "consent": { + "$ref": "#/components/schemas/Consent" + }, + "security": { + "$ref": "#/components/schemas/Encryption" + }, + "demographics": { + "minItems": 1, + "uniqueItems": true, + "type": "array", + "description": "demographic information", + "items": { + "$ref": "#/components/schemas/DemoAttribute" + } + }, + "biometrics": { + "minItems": 1, + "uniqueItems": true, + "type": "array", + "description": "ISO 639-1 or ISO 639-2/", + "items": { + "$ref": "#/components/schemas/BiometricData" + } + }, + "authFactors": { + "minItems": 1, + "uniqueItems": true, + "type": "array", + "description": "Other auth factors that are supported.", + "items": { + "$ref": "#/components/schemas/AuthFactor_2" + } + }, + "": { + "type": "string" + } + }, + "description": "", + "x-examples": { + "example-1": { + "context": { + "id": "id object", + "transactionId": "ABC123456723", + "requestTime": "2016-07-16T19:20:30+5:30" + }, + "consent": { + "type": "embedded / linked", + "data": "JWT", + "schema": "", + "signUri": "http://consent.govstack.global/consent.json.sig", + "linkUri": "http://consent.govstack.global/consent.json" + }, + "demographics": [ + { + "attribute": "name", + "operator": "equals", + "value": "sasi", + "lang": "ISO 639-1 language code" + }, + { + "attribute": "dob", + "operator": "equals", + "value": "sasi", + "lang": "ISO 639-1 language code" + } + ], + "biometrics": [ + { + "specVersion": "SBI spec version", + "data": { + "digitalId": "Digital Id as described in this document signed using FTM key (SBI 2.0)", + "deviceServiceVersion": "SBI version", + "bioType": "Finger", + "bioSubType": "UNKNOWN", + "purpose": "Auth", + "env": "Target environment", + "domainUri": "URI of the auth server", + "bioValue": "Encrypted with session key and base64urlencoded biometric data", + "transactionId": "Unique transaction id", + "timestamp": "Current datetime in ISO format", + "requestedScore": "Floating point number to represent the minimum required score for the capture", + "qualityScore": "Floating point number representing the score for the current capture" + }, + "hash": "sha256 in hex format in upper case (previous hash + sha256 hash of the current biometric ISO data before encryption)", + "sessionKey": "Session key used for encrypting bioValue, encrypted with idv public key (dynamically selected based on the URI) and base64urlencoded", + "thumbprint": "SHA256 representation of the certificate (HEX encoded) that was used for encryption of session key. All texts to be treated as uppercase without any spaces or hyphens" + }, + { + "specVersion": "SBI spec version", + "data": { + "digitalId": "Digital Id as described in this document signed using FTM key (SBI 2.0)", + "deviceServiceVersion": "SBI version", + "bioType": "Finger", + "bioSubType": "Left IndexFinger", + "purpose": "Auth", + "env": "Target environment", + "domainUri": "URI of the auth server", + "bioValue": "Encrypted with session key and base64urlencoded biometric data", + "transactionId": "Unique transaction id", + "timestamp": "Current datetime in ISO format", + "requestedScore": "Floating point number to represent the minimum required score for the capture", + "qualityScore": "Floating point number representing the score for the current capture" + }, + "hash": "sha256 in hex format in upper case (previous hash + sha256 hash of the current biometric ISO data before encryption)", + "sessionKey": "Session key used for encrypting bioValue, encrypted with idv public key (dynamically selected based on the URI) and base64urlencoded", + "thumbprint": "SHA256 representation of the certificate (HEX encoded) that was used for encryption of session key. All texts to be treated as uppercase without any spaces or hyphens" + } + ], + "authFactors": [ + { + "factors": "", + "specVersion": "", + "data": [] + }, + { + "factors": "", + "specVersion": "", + "data": [] + } + ] + } + } + }, + "inline_response_200": { + "required": [ + "authResult", + "consentVerified", + "factorsVerified", + "purpose", + "transactionId", + "version" + ], + "type": "object", + "properties": { + "version": { + "type": "string", + "description": "Version of this response" + }, + "responseTime": { + "type": "string", + "description": "ISO 8601" + }, + "transactionId": { + "maxLength": 50, + "minLength": 12, + "type": "string", + "example": "TXN123456789" + }, + "purpose": { + "type": "string", + "description": "Same value as purpose in the request" + }, + "factorsVerified": { + "type": "array", + "description": "What are all the factors we verified. So in case the relying party needs a mandatory factor he can check and ensure if the authentication contained such a factor.", + "items": { + "type": "string" + } + }, + "consentVerified": { + "type": "boolean", + "description": "Consent verification was performed or not.", + "default": false + }, + "authResult": { + "$ref": "#/components/schemas/inline_response_200_authResult" + }, + "errors": { + "type": "array", + "description": "Error code array. Messages for the respective errors has to be translated as ", + "items": { + "$ref": "#/components/schemas/inline_response_200_errors" + } + } + } + }, + "BiometricData_data": { + "required": [ + "bioSubType", + "bioType", + "bioValue", + "captureDevice", + "mimetype", + "timestamp", + "transactionId" + ], + "type": "object", + "properties": { + "captureDevice": { + "$ref": "#/components/schemas/CaptureDevice" + }, + "deviceServiceVersion": { + "minLength": 1, + "type": "string", + "description": "version of SBI (secure biometric interface) spec driver " + }, + "bioType": { + "minLength": 1, + "type": "string", + "description": "", + "enum": [ + "Face", + "Finger", + "Iris", + "Voice", + "Palm" + ] + }, + "bioSubType": { + "minLength": 1, + "type": "string", + "enum": [ + "Left IndexFinger", + "Left MiddleFinger", + "Left RingFinger", + "Left LittleFinger", + "Left Thumb", + "Right IndexFinger", + "Right MiddleFinger", + "Right RingFinger", + "Right LittleFinger", + "Right Thumb", + "UNKNOWN", + "Left", + "Right" + ] + }, + "purpose": { + "maxLength": 144, + "minLength": 1, + "type": "string", + "description": "simple string to explain the purpose of the auth. This will be notified to the user", + "enum": [ + "Auth", + "KYC", + "Registration" + ] + }, + "env": { + "minLength": 1, + "type": "string" + }, + "domainUri": { + "minLength": 1, + "type": "string", + "format": "uri" + }, + "bioValue": { + "minLength": 1, + "type": "string" + }, + "requestedScore": { + "maximum": 100, + "minimum": 0, + "type": "number" + }, + "transactionId": { + "maxLength": 50, + "minLength": 12, + "type": "string", + "example": "ABC123456789" + }, + "timestamp": { + "minLength": 20, + "type": "string", + "example": "2016-07-16T19:20:30+5:30" + }, + "qualityScore": { + "maximum": 100, + "minimum": 0, + "type": "number" + }, + "mimetype": { + "maxLength": 256, + "minLength": 0, + "type": "string", + "description": "Mimetype limited to audio, video, image as per https://www.iana.org/assignments/media-types/media-types.xhtml#audio, https://www.iana.org/assignments/media-types/media-types.xhtml#video, https://www.iana.org/assignments/media-types/media-types.xhtml#image\nin cases of ISO send iso-19794" + } + }, + "description": "The entire data in this object is encrypted as a single blob and attached here as a string - Refer the SBI Specification", + "example": null + }, + "Credential_credentialSubject_idOf": { + "type": "object", + "properties": { + "attributeName": { + "maxLength": 256, + "minLength": 1, + "type": "string", + "description": "Name of the attribute" + }, + "value": { + "maxLength": 1024, + "minLength": 0, + "type": "string", + "description": "Value for the given attribute. Note: It could be encrypted if the attribute name is part of the protected array." + }, + "language": { + "maxLength": 3, + "minLength": 2, + "type": "string", + "description": "language in ISO 639-1 format. USe 639-2 only when the code is not available in 639-1" + } + }, + "example": null + }, + "Credential_credentialSubject": { + "required": [ + "id", + "idOf" + ], + "type": "object", + "properties": { + "id": { + "maxLength": 50, + "minLength": 10, + "type": "string", + "description": "id of subject" + }, + "idOf": { + "type": "array", + "description": "Array of information about the subject", + "items": { + "$ref": "#/components/schemas/Credential_credentialSubject_idOf" + } + } + }, + "description": "Subject information for the credential", + "example": null + }, + "Credential_proof": { + "required": [ + "created", + "jws", + "proofPurpose", + "type", + "verificationMethod" + ], + "type": "object", + "properties": { + "type": { + "maxLength": 10, + "minLength": 1, + "type": "string", + "description": "Type of the proof", + "enum": [ + "RsaSignature2018", + "ED25519" + ] + }, + "created": { + "type": "string", + "description": "What was it created", + "format": "date-time" + }, + "proofPurpose": { + "maxLength": 256, + "minLength": 0, + "type": "string", + "description": "What is the purpose of this proof" + }, + "verificationMethod": { + "maxLength": 256, + "minLength": 1, + "type": "string", + "description": "URL to the keys" + }, + "jws": { + "maxLength": 10000, + "minLength": 0, + "type": "string", + "description": "JWS of the format header..signature" + } + }, + "description": "Credential proof", + "example": null + }, + "inline_response_200_authResult": { + "required": [ + "tokenId", + "verified" + ], + "type": "object", + "properties": { + "verified": { + "type": "boolean", + "description": "result of the authentication. A simple boolean", + "default": false + }, + "tokenId": { + "maxLength": 500, + "minLength": 12, + "type": "string", + "description": "Random Token either specific for this authentication or specific for an individual & Relying party combination." + }, + "kycCredential": { + "$ref": "#/components/schemas/Credential" + }, + "kycUri": { + "type": "string", + "description": "Link pointing to the KYC data credential" + } + }, + "description": "Result of the authentication", + "example": null + }, + "inline_response_200_errors": { + "type": "object", + "properties": { + "code": { + "type": "string", + "description": "unique error code " + }, + "message": { + "type": "string", + "description": "description of the error message" + }, + "language": { + "type": "string", + "description": "ISO 639-2" + }, + "action": { + "type": "string", + "description": "action that we want the user to make in order to correct the error." + } + }, + "example": null + } + }, + "responses": {}, + "securitySchemes": { + "Authorization": { + "type": "openIdConnect", + "openIdConnectUrl": "https://idv.govstack.global/auth/openid-configuration" + } + } + } +} From db3c7825e16a4f154287f47add6299fc82a88380 Mon Sep 17 00:00:00 2001 From: ingmarvali Date: Wed, 9 Mar 2022 23:51:27 +0200 Subject: [PATCH 05/10] Update test-IDV MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added the following IM specific information 👍 { "openapi": "3.0.0", "info": { "title": "Verification", "description": "Verification of individual with the provided information", "license": { "name": "MPL-2.0", "url": "https://www.mozilla.org/en-US/MPL/2.0/" }, "version": "1.0-oas3-oas3" }, "servers": [ { "url": "http://securityserver/r1/egovstack/GOV/7003/ID_Verification/authenticate" } ] , "paths": { "/authenticate": { "post": { "summary": "", "description": "To authenticate an individual", "operationId": "post-authenticate", "parameters": [ { "in": "header", "name": "X-Road-Client", "example": "egovstack/GOV/7002/Registration", "description": "Format is: INSTANCE/CLASS/MEMBER/SUBSYSTEM", "schema": { "type": "string" }, "required": true }, { "name": "Signature", "in": "header", "description": "JWS signature of the entire http body of the body header..signature", "required": false, "style": "simple", "explode": false, "schema": { "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/authenticate_body" }, "examples": { "Example": { "value": { "context": { "id": "8284-8198-7235", "transactionId": "TXN123456789", "requestTime": "2016-07-16T19:20:30+5:30" }, "consent": { "type": "linked", "schema": "https://govstack.global/schema/consent", "signUri": "https://govstack.global/TXN123456789.sig", "linkUri": "https://govstack.global/TXN123456789.data" }, "demographics": [ { "attributeName": "name", "operator": "=", "value": "Sasi", "lang": "eng" } ], "biometrics": [ { "specVersion": "1.0", "data": { "captureDevice": "string", "env": "string", "deviceServiceVersion": "1.0", "bioType": "Finger", "bioSubType": "Left IndexFinger", "purpose": "Auth", "domainUri": "http://idv.govstack.global", "bioValue": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWUsImlhdCI6MTUxNjIzOTAyMn0.POstGetfAytaZS82wHcjoTyoqhMyxXiWdR7Nn7A29DNSl0EiXLdwJ6xC6AfgZWF1bOsS_TuYI3OG85AmiExREkrS6tDfTQ2B3WXlrr-wp5AokiRbz3_oB4OxG-W9KcEEbDRcZc0nH3L7LzYptiy1PtAylQGxHTWZXtGz4ht0bAecBgmpdgXMguEIcoqPJ1n3pIWk_dUZegpqx0Lka21H6XxUTxiy8OcaarA8zdnPUnV6AmNP3ecFawIFYdvJB_cm-GvpCSbr8G8y_Mllj8f4x9nBH8pQux89_6gUY618iYv7tuPWBFfEbLxtF2pZS6YC1aSfLQxeNe8djT9YjpvRZA", "transactionId": "TXN123456789", "timestamp": "2016-07-16T19:20:30+5:30", "requestedScore": 65, "qualityScore": 90 }, "hash": "string", "sessionKey": "string", "thumbprint": "string" } ], "authFactors": [ { "factor": "string", "specVersion": "string", "data": [ {} ] } ] } } } } } }, "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/inline_response_200" }, "examples": { "example-1": {} } } } } } } } }, "components": { "schemas": { "AuthFactor": { "title": "AuthFactor", "required": [ "data", "factor", "specVersion" ], "type": "object", "properties": { "factor": { "type": "string" }, "specVersion": { "type": "string" }, "hash": { "type": "string" }, "data": { "type": "array", "items": { "type": "object" } }, "security": { "$ref": "#/components/schemas/Encryption" } } }, "AuthFactor_2": { "title": "AuthFactor", "required": [ "data", "factor", "specVersion" ], "type": "object", "properties": { "factor": { "maxLength": 256, "minLength": 1, "type": "string", "description": "Name of the factor" }, "specVersion": { "maxLength": 5, "minLength": 1, "type": "string", "description": "Adopted spec version for this factor" }, "hash": { "maxLength": 512, "minLength": 1, "type": "string", "description": "hash value of the data object before encryption" }, "data": { "type": "array", "description": "Free data object as per the factors specification", "items": { "type": "object" } }, "security": { "$ref": "#/components/schemas/Encryption" } } }, "BiometricData": { "title": "BiometricFactor", "required": [ "hash", "sessionKey", "specVersion", "thumbprint" ], "type": "object", "properties": { "specVersion": { "minLength": 1, "type": "string", "enum": [ "0.95", "1.0" ] }, "data": { "$ref": "#/components/schemas/BiometricData_data" }, "hash": { "minLength": 1, "type": "string" }, "sessionKey": { "minLength": 1, "type": "string" }, "thumbprint": { "minLength": 1, "type": "string" } } }, "CaptureDevice": { "required": [ "dateTime", "make", "model", "serialNo", "type" ], "type": "object", "properties": { "serialNo": { "maxLength": 12, "minLength": 0, "type": "string", "description": "Serial no of the device, same as whats printed on the device. In case of integrated pls ensure the it can be seen in about device or similar such features. Alpha numeric" }, "make": { "maxLength": 50, "minLength": 1, "type": "string", "description": "Make of the device" }, "model": { "maxLength": 50, "minLength": 1, "type": "string", "description": "Model of the device" }, "type": { "maxLength": 50, "minLength": 1, "type": "string", "description": "Type of the device", "enum": [ "Finger", "Iris", "Face" ] }, "deviceSubType": { "maxLength": 50, "minLength": 1, "type": "string", "description": "Additional mode details of device type. Its a enum", "enum": [ "Slap", "Single", "Touchless", "Double", "Full Frontal" ] }, "deviceProvider": { "maxLength": 256, "minLength": 1, "type": "string", "description": "Provider name as per the certification" }, "deviceProviderId": { "maxLength": 50, "minLength": 1, "type": "string", "description": "Unique provider id assigned by the certifier" }, "dateTime": { "minLength": 1, "type": "string", "description": "ISO Timestamp of the device ", "format": "date-time" } }, "description": "Digital footprint of the capture device", "x-examples": { "example-1": { "serialNo": "Serial number", "make": "Make of the device", "model": "Model of the device", "type": "Type of the biometric device", "deviceSubType": "Subtypes of the biometric device", "deviceProvider": "Device provider name", "deviceProviderId": "Device provider id", "dateTime": "Current datetime in ISO format" } } }, "Consent": { "title": "Consent", "required": [ "type" ], "type": "object", "properties": { "type": { "maxLength": 50, "minLength": 1, "type": "string", "description": "Consent type. Limited the enum values", "example": "linked", "enum": [ "embedded", "linked", "no-consent" ] }, "data": { "maxLength": 256, "minLength": 1, "type": "string", "description": "embedded data in jwt format" }, "schema": { "maxLength": 256, "minLength": 1, "type": "string", "description": "Schema for the consent", "format": "uri-reference" }, "signUri": { "maxLength": 256, "minLength": 1, "type": "string", "description": "signature url. no data of the consent", "format": "uri" }, "linkUri": { "maxLength": 256, "minLength": 1, "type": "string", "description": "unique link to the content of the consent", "format": "uri" } }, "description": "" }, "Credential": { "title": "Credential", "required": [ "consent", "credentialSubject", "id", "issuanceDate", "issuedTo", "issuer", "proof", "protectedAttributes", "type" ], "type": "object", "properties": { "issuer": { "maxLength": 256, "minLength": 1, "type": "string", "description": "Who has issued this credential." }, "id": { "maxLength": 256, "minLength": 1, "type": "string", "description": "ID of the credential" }, "issuedTo": { "maxLength": 256, "minLength": 1, "type": "string", "description": "to whom the id is issued to" }, "issuanceDate": { "minLength": 1, "type": "string", "format": "date-time" }, "protectedAttributes": { "type": "array", "description": "Array of attributes that are available in protected form (encrypted).", "items": { "type": "string" } }, "credentialSubject": { "$ref": "#/components/schemas/Credential_credentialSubject" }, "type": { "maxItems": 20, "minItems": 1, "type": "array", "description": "Array of strings indicating the type of the credential", "items": { "maxLength": 50, "minLength": 1, "type": "string", "example": "[\"VerifiableCredential\", \"AlumniCredential\"]" } }, "consent": { "$ref": "#/components/schemas/Consent" }, "proof": { "$ref": "#/components/schemas/Credential_proof" } }, "description": "Credential", "x-examples": { "example-1": { "issuedTo": "mpartner-default-print", "protectedAttributes": [], "issuanceDate": "2021-01-20T04:38:41.045Z", "credentialSubject": { "name": "james", "gender": "male" }, "id": "http://govstack.global/credentials/9178c6ed-6c3d-4be4-9eef-7668ca236c21", "type": [ "VerifiableCredential", "GovStackVerifiableCredential" ], "consent": "", "issuer": "https://govstack.global/issuers/" } } }, "DemoAttribute": { "title": "Demo", "required": [ "attributeName", "value" ], "type": "object", "properties": { "attributeName": { "maxLength": 50, "minLength": 1, "type": "string", "description": "Name of the attribute. eg name, firstname" }, "value": { "maxLength": 2096, "minLength": 1, "type": "string", "description": "Value for the demographic data" }, "language": { "maxLength": 3, "minLength": 2, "type": "string", "description": "Language of the value ISO 639-1 in case the language is not available in 639-1 use 639-2" } } }, "Encryption": { "title": "Encryption", "required": [ "algorithm", "sessionKey", "thumbprint" ], "type": "object", "properties": { "sessionKey": { "maxLength": 2096, "minLength": 0, "type": "string", "description": "random created key for this instance" }, "thumbprint": { "maxLength": 32, "minLength": 0, "type": "string", "description": "key id to uniquely identify the key, Can be url or hash of the key." }, "algorithm": { "maxLength": 50, "minLength": 1, "type": "string", "description": "algorithm used for protection of data" } } }, "authenticate_context": { "required": [ "id", "requestTime", "transactionId" ], "type": "object", "properties": { "id": { "minLength": 1, "type": "string", "description": "Identity used for authentication" }, "transactionId": { "maxLength": 50, "minLength": 12, "type": "string", "description": "The current transaction id or service request id as per the relying party" }, "requestTime": { "maxLength": 30, "minLength": 12, "type": "string", "description": "Timestamp in ISO8601" }, "purpose": { "maxLength": 256, "minLength": 0, "type": "string", "description": "Purpose of the authentication request. Not mandatory but provides a way to ensure people know for what they are doing it" }, "issuer": { "maxLength": 250, "minLength": 0, "type": "string", "description": "Issuer of this ID. Its optional. Auth can be rejected in some scenarios if this is not present" }, "type": { "maxLength": 150, "minLength": 0, "type": "string", "description": "Type of the ID. Its optional and auth can not be rejected if the type is not present." } }, "example": null }, "authenticate_body": { "required": [ "authFactors", "biometrics", "consent", "context", "demographics", "security" ], "type": "object", "properties": { "context": { "$ref": "#/components/schemas/authenticate_context" }, "consent": { "$ref": "#/components/schemas/Consent" }, "security": { "$ref": "#/components/schemas/Encryption" }, "demographics": { "minItems": 1, "uniqueItems": true, "type": "array", "description": "demographic information", "items": { "$ref": "#/components/schemas/DemoAttribute" } }, "biometrics": { "minItems": 1, "uniqueItems": true, "type": "array", "description": "ISO 639-1 or ISO 639-2/", "items": { "$ref": "#/components/schemas/BiometricData" } }, "authFactors": { "minItems": 1, "uniqueItems": true, "type": "array", "description": "Other auth factors that are supported.", "items": { "$ref": "#/components/schemas/AuthFactor_2" } }, "": { "type": "string" } }, "description": "", "x-examples": { "example-1": { "context": { "id": "id object", "transactionId": "ABC123456723", "requestTime": "2016-07-16T19:20:30+5:30" }, "consent": { "type": "embedded / linked", "data": "JWT", "schema": "", "signUri": "http://consent.govstack.global/consent.json.sig", "linkUri": "http://consent.govstack.global/consent.json" }, "demographics": [ { "attribute": "name", "operator": "equals", "value": "sasi", "lang": "ISO 639-1 language code" }, { "attribute": "dob", "operator": "equals", "value": "sasi", "lang": "ISO 639-1 language code" } ], "biometrics": [ { "specVersion": "SBI spec version", "data": { "digitalId": "Digital Id as described in this document signed using FTM key (SBI 2.0)", "deviceServiceVersion": "SBI version", "bioType": "Finger", "bioSubType": "UNKNOWN", "purpose": "Auth", "env": "Target environment", "domainUri": "URI of the auth server", "bioValue": "Encrypted with session key and base64urlencoded biometric data", "transactionId": "Unique transaction id", "timestamp": "Current datetime in ISO format", "requestedScore": "Floating point number to represent the minimum required score for the capture", "qualityScore": "Floating point number representing the score for the current capture" }, "hash": "sha256 in hex format in upper case (previous hash + sha256 hash of the current biometric ISO data before encryption)", "sessionKey": "Session key used for encrypting bioValue, encrypted with idv public key (dynamically selected based on the URI) and base64urlencoded", "thumbprint": "SHA256 representation of the certificate (HEX encoded) that was used for encryption of session key. All texts to be treated as uppercase without any spaces or hyphens" }, { "specVersion": "SBI spec version", "data": { "digitalId": "Digital Id as described in this document signed using FTM key (SBI 2.0)", "deviceServiceVersion": "SBI version", "bioType": "Finger", "bioSubType": "Left IndexFinger", "purpose": "Auth", "env": "Target environment", "domainUri": "URI of the auth server", "bioValue": "Encrypted with session key and base64urlencoded biometric data", "transactionId": "Unique transaction id", "timestamp": "Current datetime in ISO format", "requestedScore": "Floating point number to represent the minimum required score for the capture", "qualityScore": "Floating point number representing the score for the current capture" }, "hash": "sha256 in hex format in upper case (previous hash + sha256 hash of the current biometric ISO data before encryption)", "sessionKey": "Session key used for encrypting bioValue, encrypted with idv public key (dynamically selected based on the URI) and base64urlencoded", "thumbprint": "SHA256 representation of the certificate (HEX encoded) that was used for encryption of session key. All texts to be treated as uppercase without any spaces or hyphens" } ], "authFactors": [ { "factors": "", "specVersion": "", "data": [] }, { "factors": "", "specVersion": "", "data": [] } ] } } }, "inline_response_200": { "required": [ "authResult", "consentVerified", "factorsVerified", "purpose", "transactionId", "version" ], "type": "object", "properties": { "version": { "type": "string", "description": "Version of this response" }, "responseTime": { "type": "string", "description": "ISO 8601" }, "transactionId": { "maxLength": 50, "minLength": 12, "type": "string", "example": "TXN123456789" }, "purpose": { "type": "string", "description": "Same value as purpose in the request" }, "factorsVerified": { "type": "array", "description": "What are all the factors we verified. So in case the relying party needs a mandatory factor he can check and ensure if the authentication contained such a factor.", "items": { "type": "string" } }, "consentVerified": { "type": "boolean", "description": "Consent verification was performed or not.", "default": false }, "authResult": { "$ref": "#/components/schemas/inline_response_200_authResult" }, "errors": { "type": "array", "description": "Error code array. Messages for the respective errors has to be translated as ", "items": { "$ref": "#/components/schemas/inline_response_200_errors" } } } }, "BiometricData_data": { "required": [ "bioSubType", "bioType", "bioValue", "captureDevice", "mimetype", "timestamp", "transactionId" ], "type": "object", "properties": { "captureDevice": { "$ref": "#/components/schemas/CaptureDevice" }, "deviceServiceVersion": { "minLength": 1, "type": "string", "description": "version of SBI (secure biometric interface) spec driver " }, "bioType": { "minLength": 1, "type": "string", "description": "", "enum": [ "Face", "Finger", "Iris", "Voice", "Palm" ] }, "bioSubType": { "minLength": 1, "type": "string", "enum": [ "Left IndexFinger", "Left MiddleFinger", "Left RingFinger", "Left LittleFinger", "Left Thumb", "Right IndexFinger", "Right MiddleFinger", "Right RingFinger", "Right LittleFinger", "Right Thumb", "UNKNOWN", "Left", "Right" ] }, "purpose": { "maxLength": 144, "minLength": 1, "type": "string", "description": "simple string to explain the purpose of the auth. This will be notified to the user", "enum": [ "Auth", "KYC", "Registration" ] }, "env": { "minLength": 1, "type": "string" }, "domainUri": { "minLength": 1, "type": "string", "format": "uri" }, "bioValue": { "minLength": 1, "type": "string" }, "requestedScore": { "maximum": 100, "minimum": 0, "type": "number" }, "transactionId": { "maxLength": 50, "minLength": 12, "type": "string", "example": "ABC123456789" }, "timestamp": { "minLength": 20, "type": "string", "example": "2016-07-16T19:20:30+5:30" }, "qualityScore": { "maximum": 100, "minimum": 0, "type": "number" }, "mimetype": { "maxLength": 256, "minLength": 0, "type": "string", "description": "Mimetype limited to audio, video, image as per https://www.iana.org/assignments/media-types/media-types.xhtml#audio, https://www.iana.org/assignments/media-types/media-types.xhtml#video, https://www.iana.org/assignments/media-types/media-types.xhtml#image\nin cases of ISO send iso-19794" } }, "description": "The entire data in this object is encrypted as a single blob and attached here as a string - Refer the SBI Specification", "example": null }, "Credential_credentialSubject_idOf": { "type": "object", "properties": { "attributeName": { "maxLength": 256, "minLength": 1, "type": "string", "description": "Name of the attribute" }, "value": { "maxLength": 1024, "minLength": 0, "type": "string", "description": "Value for the given attribute. Note: It could be encrypted if the attribute name is part of the protected array." }, "language": { "maxLength": 3, "minLength": 2, "type": "string", "description": "language in ISO 639-1 format. USe 639-2 only when the code is not available in 639-1" } }, "example": null }, "Credential_credentialSubject": { "required": [ "id", "idOf" ], "type": "object", "properties": { "id": { "maxLength": 50, "minLength": 10, "type": "string", "description": "id of subject" }, "idOf": { "type": "array", "description": "Array of information about the subject", "items": { "$ref": "#/components/schemas/Credential_credentialSubject_idOf" } } }, "description": "Subject information for the credential", "example": null }, "Credential_proof": { "required": [ "created", "jws", "proofPurpose", "type", "verificationMethod" ], "type": "object", "properties": { "type": { "maxLength": 10, "minLength": 1, "type": "string", "description": "Type of the proof", "enum": [ "RsaSignature2018", "ED25519" ] }, "created": { "type": "string", "description": "What was it created", "format": "date-time" }, "proofPurpose": { "maxLength": 256, "minLength": 0, "type": "string", "description": "What is the purpose of this proof" }, "verificationMethod": { "maxLength": 256, "minLength": 1, "type": "string", "description": "URL to the keys" }, "jws": { "maxLength": 10000, "minLength": 0, "type": "string", "description": "JWS of the format header..signature" } }, "description": "Credential proof", "example": null }, "inline_response_200_authResult": { "required": [ "tokenId", "verified" ], "type": "object", "properties": { "verified": { "type": "boolean", "description": "result of the authentication. A simple boolean", "default": false }, "tokenId": { "maxLength": 500, "minLength": 12, "type": "string", "description": "Random Token either specific for this authentication or specific for an individual & Relying party combination." }, "kycCredential": { "$ref": "#/components/schemas/Credential" }, "kycUri": { "type": "string", "description": "Link pointing to the KYC data credential" } }, "description": "Result of the authentication", "example": null }, "inline_response_200_errors": { "type": "object", "properties": { "code": { "type": "string", "description": "unique error code " }, "message": { "type": "string", "description": "description of the error message" }, "language": { "type": "string", "description": "ISO 639-2" }, "action": { "type": "string", "description": "action that we want the user to make in order to correct the error." } }, "example": null } }, "responses": {}, "securitySchemes": { "Authorization": { "type": "openIdConnect", "openIdConnectUrl": "https://idv.govstack.global/auth/openid-configuration" } } } } --- IDV/test-IDV | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/IDV/test-IDV b/IDV/test-IDV index 6a686ef..dea31c0 100644 --- a/IDV/test-IDV +++ b/IDV/test-IDV @@ -32,6 +32,16 @@ "description": "To authenticate an individual", "operationId": "post-authenticate", "parameters": [ + { + "in": "header", + "name": "X-Road-Client", + "example": "egovstack/GOV/7002/Registration", + "description": "Format is: INSTANCE/CLASS/MEMBER/SUBSYSTEM", + "schema": { + "type": "string" + }, + "required": true + }, { "name": "Signature", "in": "header", From 357a205ddbcb878ece9bb931a33d953cc7c3369a Mon Sep 17 00:00:00 2001 From: tambetartma Date: Mon, 27 Jun 2022 13:18:52 +0300 Subject: [PATCH 06/10] New, more generalized API descriptions --- ...registries_BB_Data_API_template-1.3.0.json | 1142 +++++++++++++++++ ...stries_BB_Database_API_template-1.3.0.json | 571 +++++++++ 2 files changed, 1713 insertions(+) create mode 100644 DigitalRegistriesBB/GovStack_Digital_registries_BB_Data_API_template-1.3.0.json create mode 100644 DigitalRegistriesBB/GovStack_Digital_registries_BB_Database_API_template-1.3.0.json diff --git a/DigitalRegistriesBB/GovStack_Digital_registries_BB_Data_API_template-1.3.0.json b/DigitalRegistriesBB/GovStack_Digital_registries_BB_Data_API_template-1.3.0.json new file mode 100644 index 0000000..26d3b83 --- /dev/null +++ b/DigitalRegistriesBB/GovStack_Digital_registries_BB_Data_API_template-1.3.0.json @@ -0,0 +1,1142 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "GovStack Digital Registries BB API examples", + "description": "Digital Registries System contains multiple registries in one instance. For each registry same set of APIs is described. In this example two example registries have been described.\n", + "contact": { + "email": "tambetartma88@gmail.com" + }, + "version": "1.3.0", + "termsOfService": "#", + "license": { + "name": "Apache 2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0.html" + } + }, + "servers": [ + { + "description": "Information Mediator BB Security server", + "url": "http://ss2.egovstack.net/r1/eGovStack/COM/11222456/RegistrationBB/creg/" + } + ], + "tags": [ + { + "name": "Registry data query API", + "description": "Registry data query API" + } + ], + "paths": { + "/data//": { + "get": { + "tags": [ + "Registry data query API" + ], + "description": "Searches (Regex supported) and returns multiple records as an array-list. ", + "operationId": "list", + "summary": "list", + "parameters": [ + { + "$ref": "#/components/parameters/Information-Mediator-Client" + }, + { + "name": "search", + "in": "query", + "description": "Field for searching random string type data from database", + "required": false, + "schema": { + "type": "string", + "example": "John" + } + }, + { + "name": "filter", + "in": "query", + "description": "Field name that user wishes to filter", + "required": false, + "schema": { + "type": "string", + "example": "FirstName" + } + }, + { + "name": "ordering", + "in": "query", + "description": "How user wishes to order the data", + "required": false, + "schema": { + "type": "string", + "example": "descending" + } + }, + { + "name": "page", + "in": "query", + "description": "Result page number", + "required": false, + "schema": { + "type": "integer", + "example": 1 + } + }, + { + "name": "page_size", + "in": "query", + "description": "Number of results on one page", + "required": false, + "schema": { + "type": "integer", + "example": 10 + } + }, + { + "name": "query.", + "in": "query", + "description": "Example of searchable database field. If more searchable fields are in DB, then more similar fields will follow in input", + "required": false, + "schema": { + "type": "string", + "example": "Value can be in any supported format, for an example 'string'", + "readOnly": true + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "count": { + "type": "integer", + "description": "Number of results", + "example": 1 + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true, + "description": "URI to next results page", + "example": 1 + }, + "previous": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Example" + } + } + }, + "required": [ + "count", + "results" + ] + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/data///create": { + "post": { + "tags": [ + "Registry data query API" + ], + "description": "Creates a new record in the registry database.", + "operationId": "create", + "summary": "create", + "parameters": [ + { + "$ref": "#/components/parameters/Information-Mediator-Client" + } + ], + "requestBody": { + "description": "", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "write": { + "type": "object", + "properties": { + "content": { + "$ref": "#/components/schemas/Example" + } + }, + "required": [ + "content" + ] + } + }, + "required": [ + "write" + ] + } + } + } + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "content": { + "$ref": "#/components/schemas/Example" + } + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/data///exists": { + "post": { + "tags": [ + "Registry data query API" + ], + "description": "Searches records based on input parameters and returns boolean answer (true/false).", + "operationId": "exists", + "summary": "exists", + "parameters": [ + { + "$ref": "#/components/parameters/Information-Mediator-Client" + } + ], + "requestBody": { + "description": "", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "query": { + "type": "object", + "properties": { + "content": { + "$ref": "#/components/schemas/Example" + } + }, + "required": [ + "content" + ] + } + }, + "required": [ + "query" + ] + } + } + } + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "answer": { + "type": "object", + "properties": { + "status": { + "type": "boolean", + "example": true, + "description": "Example object found in database" + }, + "message": { + "type": "string", + "example": "Object found from database", + "description": "More information about the object" + } + }, + "required": [ + "status" + ] + } + }, + "required": [ + "answer" + ] + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/data///read": { + "post": { + "tags": [ + "Registry data query API" + ], + "description": "Searches and returns one record.", + "operationId": "read", + "summary": "read", + "parameters": [ + { + "$ref": "#/components/parameters/Information-Mediator-Client" + } + ], + "requestBody": { + "description": "", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "query": { + "type": "object", + "properties": { + "content": { + "$ref": "#/components/schemas/Example" + } + }, + "required": [ + "content" + ] + } + }, + "required": [ + "query" + ] + } + } + } + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "content": { + "$ref": "#/components/schemas/Example" + } + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/data///update": { + "put": { + "tags": [ + "Registry data query API" + ], + "description": "Updates one existing record in the registry database.", + "operationId": "update", + "summary": "update", + "parameters": [ + { + "$ref": "#/components/parameters/Information-Mediator-Client" + } + ], + "requestBody": { + "description": "", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "query": { + "type": "object", + "description": "Search object that needs to be updated", + "properties": { + "content": { + "$ref": "#/components/schemas/Example" + } + }, + "required": [ + "content" + ] + }, + "write": { + "type": "object", + "description": "Update found object with the following data", + "properties": { + "content": { + "$ref": "#/components/schemas/Example" + } + }, + "required": [ + "content" + ] + } + }, + "required": [ + "write" + ] + } + } + } + }, + "responses": { + "200": { + "description": "" + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/data///update-entries": { + "put": { + "tags": [ + "Registry data query API" + ], + "description": "Updates multiple records in the registry database that match the input query.", + "operationId": "update-entries", + "summary": "update-entries", + "parameters": [ + { + "$ref": "#/components/parameters/Information-Mediator-Client" + } + ], + "requestBody": { + "description": "", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "query": { + "type": "object", + "description": "Find objects that needs to be updated", + "properties": { + "content": { + "$ref": "#/components/schemas/Example" + } + }, + "required": [ + "content" + ] + }, + "write": { + "type": "object", + "description": "Data that needs to be added to the found objects", + "properties": { + "content": { + "$ref": "#/components/schemas/Example" + } + }, + "required": [ + "content" + ] + } + }, + "required": [ + "write" + ] + } + } + } + }, + "responses": { + "200": { + "description": "" + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/data///update-or-create": { + "post": { + "tags": [ + "Registry data query API" + ], + "description": "API updates existing record if matching with input parameters is successful. If record is not found the API will create a new record. ", + "operationId": "update-or-create", + "summary": "update-or-create", + "parameters": [ + { + "$ref": "#/components/parameters/Information-Mediator-Client" + } + ], + "requestBody": { + "description": "", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "query": { + "type": "object", + "description": "Find object to update, if object not found, new will be created", + "properties": { + "content": { + "$ref": "#/components/schemas/Example" + } + }, + "required": [ + "content" + ] + }, + "write": { + "type": "object", + "description": "Data that will be updated for found Example object. If object not found new object with this data is created", + "properties": { + "content": { + "$ref": "#/components/schemas/Example" + } + }, + "required": [ + "content" + ] + } + }, + "required": [ + "write" + ] + } + } + } + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "content": { + "$ref": "#/components/schemas/Example" + } + } + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/data///{ID}/delete": { + "delete": { + "tags": [ + "Registry data query API" + ], + "description": "Delete record.", + "operationId": "delete", + "summary": "delete", + "parameters": [ + { + "$ref": "#/components/parameters/Information-Mediator-Client" + }, + { + "name": "ID", + "in": "path", + "required": true, + "schema": { + "type": "string", + "example": "ID1", + "description": "ID of the citizen that needs to be deleted from the Registry data query API" + } + } + ], + "responses": { + "204": { + "description": "" + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/data///{uuid}/read-value/{field}.{ext}": { + "get": { + "tags": [ + "Registry data query API" + ], + "description": "Searches and returns one record’s one field value.", + "operationId": "read-value", + "summary": "read-value", + "parameters": [ + { + "$ref": "#/components/parameters/Information-Mediator-Client" + }, + { + "name": "uuid", + "in": "path", + "required": true, + "schema": { + "type": "string", + "description": "Primary key field", + "example": "DB-1" + } + }, + { + "name": "field", + "in": "path", + "required": true, + "schema": { + "type": "string", + "description": "Data format. Endpoint: /data/DB/1.0/DB-1/read-value/First%20name.json", + "example": "First name" + } + }, + { + "name": "ext", + "in": "path", + "required": true, + "schema": { + "type": "string", + "description": "Data format. Endpoint: /data/DB/1.0/DB-1/read-value/First%20name.json", + "example": "json" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "object", + "properties": { + "value": { + "anyOf": [ + { + "type": "array", + "items": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "integer" + }, + { + "type": "number" + }, + { + "type": "object" + }, + { + "type": "string" + } + ] + } + }, + { + "type": "boolean" + }, + { + "type": "integer" + }, + { + "type": "number" + }, + { + "type": "object" + }, + { + "type": "string" + } + ] + } + } + } + ] + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/data/MyPersonalDataUsage/1.0": { + "get": { + "tags": [ + "MyPersonalDataUsage API" + ], + "description": "Allows a user to see who has read their personal data.", + "operationId": "DPU", + "parameters": [ + { + "$ref": "#/components/parameters/Information-Mediator-Client" + }, + { + "name": "userID", + "in": "query", + "description": "User's personal unique identifier", + "required": true, + "style": "form", + "schema": { + "type": "string", + "example": "EE378129277266" + } + }, + { + "name": "DatabaseID", + "in": "query", + "description": "Database acronym", + "required": true, + "style": "form", + "schema": { + "type": "string", + "example": "MCTS" + } + } + ], + "responses": { + "200": { + "description": "Success Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "description": "Array of found data processign logs", + "items": { + "$ref": "#/components/schemas/PersonalDataUsage" + } + } + } + } + }, + "400": { + "description": "Invalid ID supplied" + }, + "404": { + "description": "Person requests not found" + } + } + } + } + }, + "components": { + "securitySchemes": { + "apiKey": { + "type": "apiKey", + "name": "Authorization", + "in": "header" + } + }, + "parameters": { + "Information-Mediator-Client": { + "in": "header", + "name": "Information-Mediator-Client", + "example": "eGovStack/GOV/90000009/digitalregistries", + "description": "Format is: INSTANCE/CLASS/MEMBER/SUBSYSTEM", + "schema": { + "type": "string" + }, + "required": true + } + }, + "schemas": { + "MCC": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "Object ID in the database", + "example": "MCTS1" + }, + "Child": { + "$ref": "#/components/schemas/Child" + }, + "Registraion date": { + "type": "string", + "format": "date", + "description": "Date of registration", + "example": "2021-01-30" + }, + "Expiry date": { + "type": "string", + "format": "date", + "description": "The expiry date of the registration", + "example": "2021-01-30" + }, + "Caretaker": { + "$ref": "#/components/schemas/Caretaker" + } + } + }, + "Child": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "Child's identifier", + "example": "xyz-12345678910" + }, + "Firstname": { + "type": "string", + "description": "Child's first name", + "example": "Usha" + }, + "Lastname": { + "type": "string", + "description": "Child's last name", + "example": "Bajaj" + }, + "Birthdate": { + "type": "string", + "format": "date", + "description": "Child's birth date", + "example": "2021-01-30" + }, + "Address": { + "type": "string", + "description": "Child's address", + "example": "Longroad 123, Big Village" + }, + "Birth_certificate": { + "$ref": "#/components/schemas/Birth_certificate" + } + } + }, + "Birth_certificate": { + "anyOf": [ + { + "type": "object", + "description": "Birth certificate file", + "properties": { + "url": { + "type": "string", + "description": "URL to the birth certificate document", + "example": "https://gdbs.dev.training.eregistrations.org/data/mcc/files/ID23.pdf" + }, + "originalName": { + "type": "string", + "description": "Document original name", + "example": "Birth certificate" + }, + "type": { + "type": "string", + "description": "Document type", + "example": "application/pdf", + "enum": [ + "application/pdf", + "image/jpeg", + "image/png", + "image/gif", + "image/tiff", + "image/bmp", + "image/x-ms-bmp", + "application/rtf", + "text/rtf", + "application/vnd.openxmlformats-officedocument.wordprocessingml.document", + "application/vnd.oasis.opendocument.text" + ] + } + }, + "required": [ + "url", + "originalName", + "type" + ] + }, + { + "type": "object", + "properties": { + "$documentId": { + "type": "number" + } + }, + "required": [ + "$documentId" + ] + } + ] + }, + "Caretaker": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "Caretaker's identifier", + "example": "EL129983773663" + }, + "Firstname": { + "type": "string", + "description": "Caretaker's first name", + "example": "John" + }, + "Lastname": { + "type": "string", + "description": "Caretaker's last name", + "example": "Smith" + }, + "Birthdate": { + "type": "string", + "format": "date", + "description": "Caretaker's birth date", + "example": "1980-01-30" + }, + "Phone": { + "type": "string", + "description": "Caretaker's phone number", + "example": "+37258000000" + }, + "Email": { + "type": "string", + "description": "Caretaker's email", + "example": "jonh.smith@email.com" + }, + "Picture": { + "$ref": "#/components/schemas/Picture" + }, + "Document ID": { + "$ref": "#/components/schemas/Document_ID" + } + } + }, + "Picture": { + "anyOf": [ + { + "type": "object", + "description": "Caretaker's picture object in database", + "properties": { + "url": { + "type": "string", + "description": "URL to the Caretaker's picture file", + "example": "https://gdbs.dev.training.eregistrations.org/data/mcc/files/ID2243.pdf" + }, + "originalName": { + "type": "string", + "description": "Caretaker's picture original file name", + "example": "John Smith avatar" + }, + "type": { + "type": "string", + "description": "Picture type", + "example": "image/jpeg", + "enum": [ + "application/pdf", + "image/jpeg", + "image/png", + "image/gif", + "image/tiff", + "image/bmp", + "image/x-ms-bmp", + "application/rtf", + "text/rtf", + "application/vnd.openxmlformats-officedocument.wordprocessingml.document", + "application/vnd.oasis.opendocument.text" + ] + } + }, + "required": [ + "url", + "originalName", + "type" + ] + }, + { + "type": "object", + "properties": { + "$documentId": { + "type": "number" + } + }, + "required": [ + "$documentId" + ] + } + ] + }, + "Document_ID": { + "anyOf": [ + { + "type": "object", + "description": "Caretaker's identification document", + "properties": { + "url": { + "type": "string", + "description": "URL to the Caretaker's identification document", + "example": "https://gdbs.dev.training.eregistrations.org/data/mcc/files/ID223.pdf" + }, + "originalName": { + "type": "string", + "description": "Identification document original name", + "example": "John Smith passport" + }, + "type": { + "type": "string", + "description": "File type of identification document", + "example": "application/pdf", + "enum": [ + "application/pdf", + "image/jpeg", + "image/png", + "image/gif", + "image/tiff", + "image/bmp", + "image/x-ms-bmp", + "application/rtf", + "text/rtf", + "application/vnd.openxmlformats-officedocument.wordprocessingml.document", + "application/vnd.oasis.opendocument.text" + ] + } + }, + "required": [ + "url", + "originalName", + "type" + ] + }, + { + "type": "object", + "properties": { + "$documentId": { + "type": "number" + } + }, + "required": [ + "$documentId" + ] + } + ] + }, + "PersonalDataUsage": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "Log record ID", + "example": "1234567" + }, + "ReaderID": { + "type": "string", + "description": "Identifier of a reader who looked at personal data", + "example": "EE37819285773" + }, + "ReaderInitials": { + "type": "string", + "description": "Reader's initials", + "example": "JD" + }, + "ReaderInstitutionID": { + "type": "string", + "description": "Reader's instituition ID", + "example": "EE70049837" + }, + "ReaderInstitutionName": { + "type": "string", + "description": "Reader's institution name", + "example": "East Hospital" + }, + "ReaderApplicationName": { + "type": "string", + "description": "Reader's institution system name", + "example": "East Hospital healthcare back office" + }, + "SearchDateTime": { + "type": "string", + "format": "date-time", + "description": "Date and time of registration", + "example": "2017-07-21T17:32:28Z" + }, + "Refrences": { + "type": "array", + "description": "Personal Data reference", + "items": { + "properties": { + "ReferenceID": { + "type": "string", + "description": "Registration ID", + "example": "MCTS31" + } + } + } + } + } + }, + "Example": { + "type": "object", + "properties": { + "ID": { + "type": "string", + "description": "Citizen's identifier", + "example": "EE378627348834" + }, + "FirstName": { + "type": "string", + "description": "Citizen's first name", + "example": "John Helmut" + }, + "LastName": { + "type": "string", + "description": "Citizen's last name", + "example": "Smith Carry" + }, + "BirthCertificateID": { + "type": "string", + "description": "Birth certificate ID in CR", + "example": "RR-1234567889" + } + } + } + } + } +} \ No newline at end of file diff --git a/DigitalRegistriesBB/GovStack_Digital_registries_BB_Database_API_template-1.3.0.json b/DigitalRegistriesBB/GovStack_Digital_registries_BB_Database_API_template-1.3.0.json new file mode 100644 index 0000000..e03768c --- /dev/null +++ b/DigitalRegistriesBB/GovStack_Digital_registries_BB_Database_API_template-1.3.0.json @@ -0,0 +1,571 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "GovStack Digital registries BB Database API template", + "description": "This is a sample API\n", + "contact": { + "email": "tambetartma88@gmail.com" + }, + "version": "1.1.0", + "termsOfService": "#", + "license": { + "name": "Apache 2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0.html" + } + }, + "servers": [ + { + "description": "Eregistrations API", + "url": "http://ss2.egovstack.net/r1/eGovStack/COM/11222456/swaggerhub/creg/" + } + ], + "tags": [ + { + "name": "Database API", + "description": "API endpoint that allows to query data from database" + }, + { + "name": "Databases", + "description": "API gets all databases and schema versions as a list array" + } + ], + "paths": { + "/database/{id}": { + "get": { + "tags": [ + "Database API" + ], + "description": "API endpoint that allows user to get database information with schema", + "parameters": [ + { + "$ref": "#/components/parameters/Information-Mediator-Client" + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "example": 1, + "description": "Id of the database that schema is requested" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DatabaseInfo" + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + }, + "delete": { + "tags": [ + "Database API" + ], + "description": "API endpoint that allows user to delete database schema", + "parameters": [ + { + "$ref": "#/components/parameters/Information-Mediator-Client" + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "integer", + "example": 1, + "description": "Id of the database that schema is requested" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "type": "string", + "example": "Success" + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + }, + "/database/modify": { + "post": { + "tags": [ + "Database API" + ], + "description": "API endpoint that allows user to create or modify database schema", + "parameters": [ + { + "$ref": "#/components/parameters/Information-Mediator-Client" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "group_name": { + "type": "string", + "description": "Group name where this schema is located", + "example": "Test" + }, + "catalog_name": { + "type": "string", + "description": "Catalog name where this schema is located", + "example": "Mother and Child" + }, + "code": { + "type": "string", + "description": "Short code of the database", + "example": "MCR" + }, + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/DatabaseSchema" + } + ], + "required": [ + "creationDate", + "description", + "filename" + ] + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DatabaseSchema" + } + } + } + } + } + } + }, + "/databases": { + "get": { + "tags": [ + "Databases" + ], + "description": "API endpoint that allows user to get information about all databases", + "parameters": [ + { + "$ref": "#/components/parameters/Information-Mediator-Client" + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DatabasesSchema" + } + } + } + } + }, + "security": [ + { + "apiKey": [] + } + ] + } + } + }, + "components": { + "securitySchemes": { + "apiKey": { + "type": "apiKey", + "name": "Authorization", + "in": "header" + } + }, + "parameters": { + "Information-Mediator-Client": { + "in": "header", + "name": "Information-Mediator-Client", + "example": "eGovStack/GOV/90000009/eregistrations-dev", + "description": "Format is: INSTANCE/CLASS/MEMBER/SUBSYSTEM", + "schema": { + "type": "string" + }, + "required": true + } + }, + "schemas": { + "DatabaseInfo": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "Database ID", + "example": 353 + }, + "version": { + "type": "string", + "description": "Database version number", + "example": "2.7" + }, + "name": { + "type": "string", + "description": "Database name", + "example": "MCTS" + }, + "description": { + "type": "string", + "description": "Database description", + "example": "Database holding information about MCTS objects" + }, + "institution": { + "type": "string", + "description": "Owner of the database (institution)", + "example": "Ministry of Social Affairs" + }, + "number_format": { + "type": "string", + "description": "Number format in database", + "example": "{code}{indexNoByCode}" + }, + "schema": { + "$ref": "#/components/schemas/DatabaseSchema" + }, + "schema_tags": { + "type": "array", + "description": "List of different schema tags that are related to the database", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "example": "" + }, + "path": { + "type": "string", + "example": "/Child/Citizenship" + }, + "is_fulltext": { + "type": "boolean", + "example": true + } + } + } + }, + "schema_flags": { + "type": "array", + "description": "List of different schema flags that are related to the database", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "example": "mandatory" + }, + "path": { + "type": "string", + "example": "/ID" + } + } + } + }, + "fields_uniques": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "string", + "example": "" + } + } + }, + "is_draft": { + "type": "boolean", + "description": "Shows database draft status (is draft true/false)", + "example": false + }, + "is_disabled": { + "type": "boolean", + "description": "Shows if database is disabled or not", + "example": false + }, + "is_archived": { + "type": "boolean", + "description": "Shows if database is archived or not", + "example": false + }, + "modified_at": { + "type": "string", + "description": "Shows database last modification time", + "example": "2021-10-03T08:35:01.775915Z" + }, + "by_user_name": { + "type": "string", + "description": "Shows user name of a person who created the database", + "example": "ingmar.dev" + }, + "by_user_auth_id": { + "type": "integer", + "description": "Shows id of a person who created the database", + "example": 1 + }, + "by_on_behalf_of_user_auth_id": { + "type": "integer", + "description": "Shows user id whose behalf was this database created", + "example": null + }, + "by_on_behalf_of_user_name": { + "type": "string", + "description": "Shows user name whose behalf was this database created", + "example": null + }, + "generic_services": { + "type": "array", + "description": "List of possible API services for this database", + "items": { + "type": "object", + "properties": { + "service_id": { + "type": "integer", + "example": 1 + }, + "name": { + "type": "string", + "example": "data-create" + }, + "is_visible": { + "type": "boolean", + "example": true + }, + "used_count": { + "type": "integer", + "example": 0 + } + } + } + }, + "data_index_increment": { + "type": "integer", + "description": "Shows database increment", + "example": 0 + }, + "has_logo": { + "type": "boolean", + "description": "Shows if this database has logo or not", + "example": false + } + } + }, + "DatabaseSchema": { + "type": "object", + "description": "Schema object describing the database", + "properties": { + "type": { + "type": "string", + "example": "object" + }, + "properties": { + "type": "object", + "properties": { + "ID": { + "type": "object", + "properties": { + "type": { + "type": "string", + "example": "string" + }, + "triggers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "conditions": { + "type": "array", + "items": { + "type": "object", + "properties": { + "logic": { + "type": "string", + "example": "==" + }, + "value": { + "type": "string", + "example": "" + }, + "gate": { + "type": "string", + "example": "&&" + } + } + } + }, + "actions": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "example": "set-value" + }, + "value": { + "type": "string", + "example": "MCTS{indexNoByCode}" + }, + "field_id": { + "type": "integer", + "example": 1 + } + } + } + } + } + } + }, + "primaryKey": { + "type": "boolean", + "example": true + }, + "readOnly": { + "type": "boolean", + "example": true + }, + "description": { + "type": "string", + "example": "Registration ID" + }, + "example": { + "type": "string", + "example": "MCTS31" + }, + "id": { + "type": "integer", + "example": 1 + } + } + }, + "Child": { + "type": "object", + "properties": { + "type": { + "type": "string", + "example": "string" + }, + "properties": { + "type": "object", + "properties": { + "ID": { + "type": "object", + "properties": { + "type": { + "type": "string", + "example": "string" + }, + "description": { + "type": "string", + "example": "Child ID" + }, + "example": { + "type": "string", + "example": "ID2" + }, + "id": { + "type": "integer", + "example": 13 + } + } + } + } + } + } + } + } + }, + "incrementIndex": { + "type": "integer", + "example": 20 + }, + "required": { + "type": "array", + "items": { + "type": "string", + "example": "ID" + } + } + } + }, + "DatabasesSchema": { + "type": "object", + "description": "Example of databases API request response body", + "properties": { + "id": { + "type": "integer", + "description": "ID of databases", + "example": 85 + }, + "name": { + "type": "string", + "description": "Name of databases group", + "example": "Mother and Child" + }, + "code": { + "type": "string", + "description": "Short name of databases group", + "example": "MCTS" + }, + "databases": { + "type": "array", + "description": "Array of databases schemas", + "items": { + "$ref": "#/components/schemas/DatabaseInfo" + } + }, + "group_id": { + "type": "integer", + "description": "ID of databases group", + "example": 10 + }, + "order": { + "type": "integer", + "description": "Order number of databases group", + "example": 76 + }, + "data_index_increment": { + "type": "integer", + "description": "Data index increment of databases group", + "example": 3 + } + } + } + } + } +} \ No newline at end of file From c23b20c0c605473928e4405ade46dac04c8d0af0 Mon Sep 17 00:00:00 2001 From: ingmarvali Date: Thu, 28 Jul 2022 18:24:48 +0300 Subject: [PATCH 07/10] Plan Test Plan for the Registration BB --- RegistrationBB/Test/Plan | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 RegistrationBB/Test/Plan diff --git a/RegistrationBB/Test/Plan b/RegistrationBB/Test/Plan new file mode 100644 index 0000000..8b9c97a --- /dev/null +++ b/RegistrationBB/Test/Plan @@ -0,0 +1,33 @@ +# Test Plan for the Registration BB + +Non-functional tests: + +1. All `examples` must be runnable via `docker compose up`. + +2. Tests in `/test` will include the expected HTTP status codes for the current endpoints. + +3. Via a basic SSH script we will recurse through the `examples` directory, run `docker compose up` for + each example, wait until we get a running set of containers, and then execute + the api endpoint tests for _that_ example. + +Functional tests: + +1. ensure that application can be launched via docker with a adaptor and a security server (Information Mediator integration). +2. check that all defined API endpoints in the openAPI-spec.json return proper response codes. +3. check UI functionality for new registration service creation, User Interface and Flow Builder, rule engine configuration. Two different domain e-services will be created. +4. check UI for new integrated service, where one e-service contains two or more registration applications integrated into one service. +4. check UI for service publish. +5. check UI for published Online Registration services. +6. check UI for processing screens in Online Registration services. +7. process test applications sent via Registration BB from end to end. +8. integration test with Digital Registries BB: send data to a registry via Information Mediator after processing; +pull data to the form from Digital Registries BB (or any BB); Evaluate user information from Rest API via Information Mediator. + + + + +The output will be a ✅ or ❌ for _each_ example, for each of the tests. + +## Comments + +**Next Step:** From 9247f2da041387ac0b7c0a8d141d09e9fccd3a14 Mon Sep 17 00:00:00 2001 From: ingmarvali Date: Thu, 28 Jul 2022 18:27:40 +0300 Subject: [PATCH 08/10] Version Small changes in text. --- RegistrationBB/README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RegistrationBB/README b/RegistrationBB/README index 785b271..79f877b 100644 --- a/RegistrationBB/README +++ b/RegistrationBB/README @@ -7,7 +7,7 @@ Acknowledgement This specification was prepared by a team comprising Frank Grozel (UNCTAD), Ingmar Vali (UNCTAD), Tambet Artma (Centre of Registers and Information Systems), Saurav Bhattarai (GIZ), Dr Ramkumar (ITU), Rauno Kulla (UNCTAD). Status -Current status of the specification is v.1.0 Currently under review. +Current status of the specification is v.1.0. Reference UNCTAD eRegistrations: https://digitalgovernment.world/ From 7c27692495e17eb33b7b146426540ce0b42cb766 Mon Sep 17 00:00:00 2001 From: ingmarvali Date: Thu, 28 Jul 2022 18:41:14 +0300 Subject: [PATCH 09/10] Create Plan.md Test plan for Digital Registries BB to validate products compatibility with GovStack functional descriptions. --- DigitalRegistriesBB/Test/Plan.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 DigitalRegistriesBB/Test/Plan.md diff --git a/DigitalRegistriesBB/Test/Plan.md b/DigitalRegistriesBB/Test/Plan.md new file mode 100644 index 0000000..8ecf009 --- /dev/null +++ b/DigitalRegistriesBB/Test/Plan.md @@ -0,0 +1,22 @@ +# Test Plan for the Digital Registries BB + +Non-functional tests: + +1. All `examples` must be runnable via `docker compose up`. + +2. Tests in `/test` will include the expected HTTP status codes for the current endpoints. + +3. Via a basic SSH script we will recurse through the `examples` directory, run `docker compose up` for + each example, wait until we get a running set of containers, and then execute + the api endpoint tests for _that_ example. + +Functional tests: + +1. ensure that application can be launched via docker with a adaptor and a security server (Information Mediator integration). +2. check that all defined API endpoints in the openAPI-spec.json return proper response codes. +3. test API endpoints for DB schema and data. +4. test UI functionality, CRUD a registry database schema and updates to the registry DB. +5. test UI functionality, CRUD data of the registry DB. +6. test multiple registries in one instance (multi-tenant). +7. test user rights management. +8. test log system. From 2940a1b7aba3464eca0ded5385d2b4d81fb5ccb7 Mon Sep 17 00:00:00 2001 From: ingmarvali Date: Thu, 28 Jul 2022 18:42:06 +0300 Subject: [PATCH 10/10] Rename Plan to Plan.md --- RegistrationBB/Test/{Plan => Plan.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename RegistrationBB/Test/{Plan => Plan.md} (100%) diff --git a/RegistrationBB/Test/Plan b/RegistrationBB/Test/Plan.md similarity index 100% rename from RegistrationBB/Test/Plan rename to RegistrationBB/Test/Plan.md