From 79f8778a6f00276a0afcb523fb540c17f0014925 Mon Sep 17 00:00:00 2001 From: George J Padayatti Date: Sat, 21 Oct 2023 04:03:56 +0530 Subject: [PATCH] Upd: Add service endpoints Signed-off-by: George J Padayatti --- openapi/v2023.8.2/bundled.yaml | 863 ++++++++---------- .../definitions/DataAgreementRecord.yaml | 61 ++ .../definitions/DataAttributeIntegrity.yaml | 18 + openapi/v2023.8.2/index.yaml | 72 +- .../parameters/dataAgreementRecordId.yaml | 6 + .../v2023.8.2/parameters/individualId.yaml | 6 + openapi/v2023.8.2/parameters/policyId.yaml | 6 + ...figListDataAttributesForDataAgreement.yaml | 4 +- .../paths/serviceAgreementDataRead.yaml | 38 - .../v2023.8.2/paths/serviceAgreementList.yaml | 31 + .../v2023.8.2/paths/serviceAgreementRead.yaml | 15 +- .../serviceCreateIndividualConsentRecord.yaml | 34 +- ...teIndividualConsentRecordAndSignature.yaml | 26 +- ...iceCreateIndividualConsentRecordDraft.yaml | 11 +- ...reateIndividualConsentRecordSignature.yaml | 5 +- .../paths/serviceDeleteAllRecords.yaml | 4 +- ...iceListDataAttributesForDataAgreement.yaml | 32 + ...tIndividualAgreementConsentRecordList.yaml | 53 +- ...erviceListIndividualConsentRecordList.yaml | 32 +- .../v2023.8.2/paths/servicePolicyRead.yaml | 43 +- .../serviceReadIndividualRecordRead.yaml | 18 +- .../serviceUpdateIndividualConsentRecord.yaml | 34 +- ...pdateIndividualConsentRecordSignature.yaml | 40 +- ...erificationAgreementConsentRecordRead.yaml | 22 +- .../serviceVerificationAgreementList.yaml | 32 +- .../serviceVerificationConsentRecordList.yaml | 57 +- 26 files changed, 754 insertions(+), 809 deletions(-) create mode 100644 openapi/v2023.8.2/definitions/DataAgreementRecord.yaml create mode 100644 openapi/v2023.8.2/definitions/DataAttributeIntegrity.yaml create mode 100644 openapi/v2023.8.2/parameters/dataAgreementRecordId.yaml create mode 100644 openapi/v2023.8.2/parameters/individualId.yaml create mode 100644 openapi/v2023.8.2/parameters/policyId.yaml delete mode 100644 openapi/v2023.8.2/paths/serviceAgreementDataRead.yaml create mode 100644 openapi/v2023.8.2/paths/serviceAgreementList.yaml create mode 100644 openapi/v2023.8.2/paths/serviceListDataAttributesForDataAgreement.yaml diff --git a/openapi/v2023.8.2/bundled.yaml b/openapi/v2023.8.2/bundled.yaml index d0c908d..71ef737 100644 --- a/openapi/v2023.8.2/bundled.yaml +++ b/openapi/v2023.8.2/bundled.yaml @@ -1156,7 +1156,7 @@ paths: x-specification-usecase: UC-C-PIC-A-003 '/config/data-agreement/{dataAgreementId}/data-attributes': get: - description: LIST - Fetch all data attributes for the data agreement + description: READ - Read all data attributes for the data agreement operationId: configListDataAttribute parameters: - $ref: '#/paths/~1config~1data-agreement~1%7BdataAgreementId%7D~1revisions/get/parameters/0' @@ -1182,7 +1182,7 @@ paths: description: bad input parameter security: - BearerAuth: [] - summary: LIST - List all data attributes for the data agreement + summary: READ - Read all data attributes for the data agreement tags: - config x-specification-crudl-model: DataAttribute @@ -3362,9 +3362,42 @@ paths: x-specification-pii-or-sensitive: 'False' x-specification-scenario: '' x-specification-usecase: UC-C-PIC-A-003 + /service/data-agreements: + get: + description: LIST - List active data agreements + operationId: serviceAgreementList + parameters: + - $ref: '#/paths/~1config~1data-agreements/get/parameters/0' + - $ref: '#/paths/~1config~1policies/get/parameters/1' + - $ref: '#/paths/~1config~1policies/get/parameters/2' + responses: + '200': + content: + application/json: + schema: + type: object + properties: + dataAgreements: + items: + $ref: '#/components/schemas/DataAgreement' + type: array + pagination: + $ref: '#/components/schemas/Pagination' + description: '' + '400': + description: bad input parameter + security: + - BearerAuth: [] + summary: LIST - List active data agreements + tags: + - service + x-specification-crudl-model: DataAgreement + x-specification-pii-or-sensitive: 'False' + x-specification-scenario: '' + x-specification-usecase: UC-C-PIC-A-003 '/service/data-agreement/{dataAgreementId}': get: - description: READ - Fetches the latest version of an DataAgreement + description: READ - Read data agreement operationId: serviceAgreementRead parameters: - description: Unique ID of an object @@ -3378,17 +3411,20 @@ paths: content: application/json: schema: - items: - oneOf: - - $ref: '#/components/schemas/DataAgreement' - - $ref: '#/components/schemas/Revision' type: array + items: + type: object + properties: + dataAgreement: + $ref: '#/components/schemas/DataAgreement' + revision: + $ref: '#/components/schemas/Revision' description: '' '400': description: bad input parameter security: - BearerAuth: [] - summary: READ - Fetches the latest version of an DataAgreement + summary: READ - Read data agreement tags: - service x-specification-crudl-model: DataAgreement @@ -3397,336 +3433,242 @@ paths: x-specification-usecase: UC-C-PIC-A-003 '/service/data-agreement/{dataAgreementId}/data-attributes': get: - description: READ - Fetch all latest versions of AgreementData associated with an DataAgreement and the presented revisionId of that DataAgreement + description: READ - Fetch all latest versions of data attribute associated with an DataAgreement and the presented revisionId of that DataAgreement operationId: serviceAgreementDataRead parameters: - - description: Unique ID of an object - in: path - name: dataAgreementId - required: true - schema: - type: string - - description: An object with id revisionId - in: query - name: revisionId - required: false - schema: - type: string + - $ref: '#/paths/~1config~1data-agreement~1%7BdataAgreementId%7D~1revisions/get/parameters/0' + - $ref: '#/paths/~1config~1policies/get/parameters/1' + - $ref: '#/paths/~1config~1policies/get/parameters/2' + - $ref: '#/paths/~1config~1data-agreements/get/parameters/0' responses: '200': content: application/json: schema: - items: - oneOf: - - $ref: '#/components/schemas/AgreementData' - type: array + type: object + properties: + dataAttributes: + items: + $ref: '#/paths/~1config~1data-agreements~1data-attribute/post/responses/200/content/application~1json/schema/properties/dataAttribute' + type: array + pagination: + $ref: '#/components/schemas/Pagination' description: '' '400': description: bad input parameter security: - BearerAuth: [] - summary: READ - Fetch all latest versions of AgreementData associated with an DataAgreement and the presented revisionId of that DataAgreement + summary: READ - Fetch all data attributes for data agreement tags: - service x-specification-crudl-model: AgreementData x-specification-pii-or-sensitive: 'False' x-specification-scenario: '' x-specification-usecase: UC-C-PIC-A-003 - /service/individual: - post: - description: CREATE - Create an individual in the consent system - operationId: serviceIndividualCreate - parameters: [] - requestBody: - content: - application/json: - schema: - properties: - individual: - $ref: '#/components/schemas/Individual' - description: An object of type Individual - required: - - individual - type: object + '/service/policy/{policyId}': + get: + description: READ - Fetch the latest version of a Policy and the presented revisionId of an associated DataAgreement + operationId: servicePolicyRead + parameters: + - description: Unique ID of an object + in: path + name: policyId + required: true + schema: + type: string + - $ref: '#/paths/~1config~1data-agreements/get/parameters/0' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/Individual' + type: object + properties: + policy: + $ref: '#/components/schemas/Policy' + revision: + $ref: '#/components/schemas/Revision' description: '' '400': description: bad input parameter security: - BearerAuth: [] - summary: CREATE - Create an individual in the consent system + summary: READ - Read policy tags: - service - x-specification-crudl-model: Individual - x-specification-pii-or-sensitive: 'True' + x-specification-crudl-model: Policy + x-specification-pii-or-sensitive: 'False' x-specification-scenario: '' - x-specification-usecase: '' - /service/individual/data-agreement-records: - delete: - description: 'DELETE - Cascading delete operation for Right To Be Forgotten, deletes all data agreement records that shall not be retained and have a "forgettable" DataAgreement. May also delete an unsigned data agreement record, for instance in cases where the user exits the signing process. Individual ID supplied as HTTP header.' - operationId: serviceDeleteAllRecords - parameters: [] + x-specification-usecase: UC-C-PIC-A-003 + /service/verification/data-agreements: + get: + description: LIST - Fetch all data agreement records + operationId: serviceVerificationAgreementList + parameters: + - $ref: '#/paths/~1config~1policies/get/parameters/1' + - $ref: '#/paths/~1config~1policies/get/parameters/2' responses: '200': + content: + application/json: + schema: + type: object + properties: + dataAgreementRecords: + type: array + items: + $ref: '#/paths/~1service~1individual~1record~1data-agreement-record/post/responses/200/content/application~1json/schema/properties/dataAgreementRecord' + pagination: + $ref: '#/components/schemas/Pagination' description: '' '400': description: bad input parameter security: - BearerAuth: [] - summary: DELETE - Delete all data agreement records + summary: LIST - Fetch all data agreement records tags: - service x-specification-crudl-model: '' - x-specification-pii-or-sensitive: 'True' - x-specification-scenario: '' - x-specification-usecase: UC-C-PIC-I-003 + x-specification-pii-or-sensitive: 'False' + x-specification-scenario: '1.1' + x-specification-usecase: UC-C-PIC-A-003 + '/service/verification/data-agreement/{dataAgreementId}': get: - description: LIST - Fetch all current unambiguous data agreement records stored for individualId supplied as HTTP header. - operationId: serviceListIndividualConsentRecordList + description: READ - Fetch a data agreement record (latest revision). The individualId is supplied as HTTP header. + operationId: serviceVerificationAgreementConsentRecordRead parameters: - - description: Requested index for start of resources to be provided in response requested by client - in: query - name: offset - required: false - schema: - type: integer - - description: Requested number of resources to be provided in response requested by client - in: query - name: limit - required: false - schema: - type: integer + - $ref: '#/paths/~1config~1data-agreement~1%7BdataAgreementId%7D~1revisions/get/parameters/0' responses: '200': content: application/json: schema: - items: - oneOf: - - $ref: '#/components/schemas/ConsentRecord' - type: array + type: object + properties: + dataAgreementRecord: + $ref: '#/paths/~1service~1individual~1record~1data-agreement-record/post/responses/200/content/application~1json/schema/properties/dataAgreementRecord' + revision: + $ref: '#/components/schemas/Revision' description: '' '400': description: bad input parameter security: - BearerAuth: [] - summary: LIST - Fetch all consent records for individual + summary: READ - Fetch a data agreement record (latest revision) tags: - service x-specification-crudl-model: '' - x-specification-pii-or-sensitive: 'True' - x-specification-scenario: '' - x-specification-usecase: UC-C-PIC-I-001 - /service/individual/record/data-agreement-record: - post: - description: CREATE - Create a paired consent record and signature object. Returns the same objects with the PK defined. - operationId: serviceCreateIndividualConsentRecordAndSignature - parameters: [] - requestBody: - content: - application/json: - schema: - properties: - consentRecord: - $ref: '#/components/schemas/ConsentRecord' - description: An object of type ConsentRecord - signature: - $ref: '#/components/schemas/Signature' - description: An object of type Signature - required: - - consentRecord - - signature - type: object + x-specification-pii-or-sensitive: 'False' + x-specification-scenario: '1.2' + x-specification-usecase: UC-C-PIC-A-003 + /service/verification/data-agreement-records: + get: + description: LIST - Fetch data agreement records (latest revision). + operationId: serviceVerificationConsentRecordList + parameters: + - $ref: '#/paths/~1config~1policies/get/parameters/1' + - $ref: '#/paths/~1config~1policies/get/parameters/2' responses: '200': content: application/json: schema: - items: - oneOf: - - $ref: '#/components/schemas/ConsentRecord' - - $ref: '#/components/schemas/Revision' - - $ref: '#/components/schemas/Signature' - type: array + type: object + properties: + dataAgreementRecords: + type: array + items: + $ref: '#/paths/~1service~1individual~1record~1data-agreement-record/post/responses/200/content/application~1json/schema/properties/dataAgreementRecord' + pagination: + $ref: '#/components/schemas/Pagination' description: '' '400': description: bad input parameter security: - BearerAuth: [] - summary: CREATE - Create a paired consent record and signature object + summary: LIST - Fetch data agreement records (latest revision) tags: - service x-specification-crudl-model: '' x-specification-pii-or-sensitive: 'True' - x-specification-scenario: '1.2' - x-specification-usecase: UC-C-PIC-I-002 - '/service/individual/record/data-agreement-record/{dataAgreementRecordId}': - put: - description: UPDATE* - Update a particular data agreement record. The individualId supplied as HTTP header. Note that updating a signed Consent Record invalidates its signature. - operationId: serviceUpdateIndividualConsentRecord + x-specification-scenario: '3.1, 1.2' + x-specification-usecase: UC-C-PIC-A-003 + '/service/individual/record/data-agreement/{dataAgreementId}': + post: + description: 'CREATE - For a particular individual and a particular data agreement, create a new data agreement record pointing to the current revision of a given data agreement.' + operationId: serviceCreateIndividualConsentRecord parameters: + - $ref: '#/paths/~1config~1data-agreement~1%7BdataAgreementId%7D~1revisions/get/parameters/0' - description: Unique ID of an object in: path - name: dataAgreementRecordId - required: true - schema: - type: string - - description: An object with id individualId - in: query name: individualId required: true schema: type: string - - description: An object with id dataAgreementId - in: query - name: dataAgreementId - required: true - schema: - type: string - - description: An object with id revisionId - in: query - name: revisionId - required: false - schema: - type: string + - $ref: '#/paths/~1config~1data-agreements/get/parameters/0' responses: '200': content: application/json: schema: - items: - oneOf: - - $ref: '#/components/schemas/ConsentRecord' - - $ref: '#/components/schemas/Revision' - type: array + type: object + properties: + dataAgreementRecord: + $ref: '#/paths/~1service~1individual~1record~1data-agreement-record/post/responses/200/content/application~1json/schema/properties/dataAgreementRecord' + revision: + $ref: '#/components/schemas/Revision' description: '' '400': description: bad input parameter security: - BearerAuth: [] - summary: UPDATE* - Update a particular data agreement record + summary: CREATE - Create a data agreement record tags: - service x-specification-crudl-model: '' x-specification-pii-or-sensitive: 'True' - x-specification-scenario: '' - x-specification-usecase: UC-C-PIC-I-003 - '/service/individual/record/data-agreement-record/{dataAgreementRecordId}/signature': - post: - description: CREATE - Creates and returns a blank Signature object for the data agreement record - operationId: serviceCreateIndividualConsentRecordSignature + x-specification-scenario: '1.2' + x-specification-usecase: UC-C-PIC-I-002 + get: + description: READ - Read data agreement record. There should be one unambiguous DataAgreementRecord for an Individual and an DataAgreement. + operationId: serviceReadIndividualRecordRead parameters: - - description: Unique ID of an object - in: path - name: dataAgreementRecordId - required: true - schema: - type: string + - $ref: '#/paths/~1config~1data-agreement~1%7BdataAgreementId%7D~1revisions/get/parameters/0' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/Signature' + type: object + properties: + dataAgreementRecord: + $ref: '#/paths/~1service~1individual~1record~1data-agreement-record/post/responses/200/content/application~1json/schema/properties/dataAgreementRecord' description: '' '400': description: bad input parameter security: - BearerAuth: [] - summary: CREATE - Creates and returns a blank Signature object for the data agreement record + summary: READ - Read data agreement record tags: - service x-specification-crudl-model: '' x-specification-pii-or-sensitive: 'True' x-specification-scenario: '' - x-specification-usecase: UC-Post-Partum-001-Registration_PostPartum_and_InfantCare - put: - description: UPDATE - Updates a Signature object for a Consent Record. This is used to add a signature to an existing unsigned Signature object. Consent BB is responsible for updating the Consent Record state. - operationId: serviceUpdateIndividualConsentRecordSignature + x-specification-usecase: UC-C-PIC-I-001 + /service/individual/record/data-agreement-record/draft: + post: + description: CREATE - Create a DRAFT (unsaved) consent record and signature objects (without a PK) for a given dataAgreementId. + operationId: serviceCreateIndividualConsentRecordDraft parameters: - - description: Unique ID of an object - in: path - name: dataAgreementRecordId + - description: An object with id individualId + in: query + name: individualId required: true schema: type: string - requestBody: - content: - application/json: - schema: - properties: - signature: - $ref: '#/components/schemas/Signature' - description: An object of type Signature - required: - - signature - type: object - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Signature' - description: '' - '400': - description: bad input parameter - security: - - BearerAuth: [] - summary: UPDATE - Updates a Signature object for a Consent Record - tags: - - service - x-specification-crudl-model: '' - x-specification-pii-or-sensitive: 'True' - x-specification-scenario: '' - x-specification-usecase: UC-Post-Partum-001-Registration_PostPartum_and_InfantCare - '/service/individual/record/data-agreement/{dataAgreementId}': - get: - description: READ - Fetch the current record for data agreement. There should be one unambiguous ConsentRecord for an Individual and an DataAgreement. The individualId is supplied as HTTP header. - operationId: serviceReadIndividualRecordRead - parameters: - - description: Unique ID of an object - in: path - name: dataAgreementId - required: true - schema: - type: string - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ConsentRecord' - description: '' - '400': - description: bad input parameter - security: - - BearerAuth: [] - summary: READ - Fetch the current record for data agreement - tags: - - service - x-specification-crudl-model: '' - x-specification-pii-or-sensitive: 'True' - x-specification-scenario: '' - x-specification-usecase: UC-C-PIC-I-001 - post: - description: 'CREATE - For a particular individual and a particular data agreement, create a new data agreement record pointing to the current revision of a given data agreement. The individualId supplied as HTTP header.' - operationId: serviceCreateIndividualConsentRecord - parameters: - - description: Unique ID of an object - in: path - name: dataAgreementId - required: true - schema: - type: string - - description: An object with id individualId + - description: An object with id dataAgreementId in: query - name: individualId + name: dataAgreementId required: true schema: type: string @@ -3741,209 +3683,203 @@ paths: content: application/json: schema: - items: - oneOf: - - $ref: '#/components/schemas/ConsentRecord' - - $ref: '#/components/schemas/Revision' - type: array + type: object + properties: + dataAgreementRecord: + $ref: '#/paths/~1service~1individual~1record~1data-agreement-record/post/responses/200/content/application~1json/schema/properties/dataAgreementRecord' + signature: + $ref: '#/components/schemas/Signature' description: '' '400': description: bad input parameter security: - BearerAuth: [] - summary: CREATE - Create a data agreement record + summary: CREATE - Create a DRAFT (unsaved) consent record and signature objects (without a PK) for a given dataAgreementId. tags: - service x-specification-crudl-model: '' x-specification-pii-or-sensitive: 'True' x-specification-scenario: '1.2' x-specification-usecase: UC-C-PIC-I-002 - '/service/individual/record/data-agreement/{dataAgreementId}/all': - get: - description: LIST - Fetches all data agreement records given to a data agreement. The individualId is supplied as header. - operationId: serviceListIndividualAgreementConsentRecordList - parameters: - - description: Unique ID of an object - in: path - name: dataAgreementId - required: true - schema: - type: string - - description: Requested index for start of resources to be provided in response requested by client - in: query - name: offset - required: false - schema: - type: integer - - description: Requested number of resources to be provided in response requested by client - in: query - name: limit - required: false - schema: - type: integer + /service/individual/record/data-agreement-record: + post: + description: CREATE - Create a paired data agreement record and signature object. Returns the same objects with the PK defined. + operationId: serviceCreateIndividualConsentRecordAndSignature + parameters: [] + requestBody: + content: + application/json: + schema: + properties: + dataAgreementRecord: + $ref: '#/paths/~1service~1individual~1record~1data-agreement-record/post/responses/200/content/application~1json/schema/properties/dataAgreementRecord' + description: An object of type DataAgreementRecord + signature: + $ref: '#/components/schemas/Signature' + description: An object of type Signature + required: + - dataAgreementRecord + - signature + type: object responses: '200': content: application/json: schema: - items: - oneOf: - - $ref: '#/components/schemas/ConsentRecord' - type: array + type: object + properties: + dataAgreementRecord: + type: object + title: DataAgreementRecord + description: 'A data agreement record expresses consent (as defined in this building block''s specification) to a single DataAgreement. There must be a UNIQUE constraint on (data agreement revision, individual)' + x-not-in-database: false + required: + - id + - agreementRevisionHash + - state + properties: + id: + type: string + format: '' + example: '' + description: 'Objects may be passed back by some API endpoints without an id (PK), denoting that they are a "draft", i.e. a ConsentRecord that is not yet stored in the database and only exist in transit. Draft ConsentRecords do not have a Revision, but if paired up with a Signature, a valid Revision should be generated.' + dataAgreementId: + type: string + x-fk-model: DataAgreement + description: The DataAgreement to which consent has been given + dataAgreementRevisionId: + type: string + x-fk-model: Revision + description: The Revision of the data agreement which consent has been given to + dataAgreementRevisionHash: + type: string + format: '' + example: '' + description: Copy of the revision hash. The hash is the included in the signature and ensures against tampering with the original agreement. + dataAttributes: + type: array + items: + type: object + title: DataAttributeIntegrity + properties: + dataAttributeId: + type: string + description: Data attribute id + dataAttributeRevisionId: + type: string + x-fk-model: Revision + description: The Revision of the data attribute which consent has been given to + dataAttributeRevisionHash: + type: string + format: '' + example: '' + description: Copy of the revision hash. The hash is the included in the signature and ensures against tampering with the original data attribute. + individualId: + type: string + x-fk-model: Individual + description: The Individual who has signed this data agreement record + optIn: + type: boolean + format: '' + example: '' + description: 'True: The individual has positively opted in. False: The individual has explicitly said no (or withdrawn a previous consent).' + state: + type: string + format: '' + example: '' + description: 'The state field is used to record state changes after-the-fact. It is maintained by the Consent BB itself. Valid states: unsigned/pending more signatures/signed' + enum: + - unsigned + - signed + signatureId: + type: string + x-fk-model: Signature + description: 'A signature that hashes all the values of the data agreement record and has signed it with the key of the Invidiual, making it verifiable and tamper-proof. TBD: Relation to a Signature schema?' + revision: + $ref: '#/components/schemas/Revision' + signature: + $ref: '#/components/schemas/Signature' description: '' '400': description: bad input parameter security: - BearerAuth: [] - summary: LIST - Fetches all data agreement records given to a data agreement + summary: CREATE - Create a paired data agreement record and signature object tags: - service x-specification-crudl-model: '' x-specification-pii-or-sensitive: 'True' - x-specification-scenario: '' - x-specification-usecase: UC-C-PIC-I-001 - '/service/individual/{individualId}': + x-specification-scenario: '1.2' + x-specification-usecase: UC-C-PIC-I-002 delete: - description: DELETE - Entirely removes an individual from the system and cascades necessary actions to related ConsentRecord objects - operationId: serviceIndividualDelete - parameters: - - description: Unique ID of an object - in: path - name: individualId - required: true - schema: - type: string + description: 'DELETE - Cascading delete operation for Right To Be Forgotten, deletes all data agreement records that shall not be retained and have a "forgettable" DataAgreement. May also delete an unsigned data agreement record, for instance in cases where the user exits the signing process.' + operationId: serviceDeleteAllRecords + parameters: [] responses: '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Individual' description: '' '400': description: bad input parameter security: - BearerAuth: [] - summary: DELETE - Entirely removes an individual from the system and cascades necessary actions to related ConsentRecord objects + summary: DELETE - Delete all data agreement records for an individual tags: - service - x-specification-crudl-model: Individual + x-specification-crudl-model: '' x-specification-pii-or-sensitive: 'True' x-specification-scenario: '' - x-specification-usecase: '' + x-specification-usecase: UC-C-PIC-I-003 get: - description: READ - Fetch an Individual in the Consent system - operationId: serviceIndividualRead + description: LIST - Fetch all current unambiguous data agreement records stored for individual + operationId: serviceListIndividualConsentRecordList parameters: - - description: Unique ID of an object - in: path - name: individualId - required: true - schema: - type: string + - $ref: '#/paths/~1config~1policies/get/parameters/1' + - $ref: '#/paths/~1config~1policies/get/parameters/2' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/Individual' + type: object + properties: + dataAgreementRecords: + items: + $ref: '#/paths/~1service~1individual~1record~1data-agreement-record/post/responses/200/content/application~1json/schema/properties/dataAgreementRecord' + type: array + pagination: + $ref: '#/components/schemas/Pagination' description: '' '400': description: bad input parameter security: - BearerAuth: [] - summary: READ - Fetch an Individual in the Consent system + summary: LIST - Fetch all consent records for individual tags: - service - x-specification-crudl-model: Individual + x-specification-crudl-model: '' x-specification-pii-or-sensitive: 'True' x-specification-scenario: '' - x-specification-usecase: '' + x-specification-usecase: UC-C-PIC-I-001 + '/service/individual/record/data-agreement-record/{dataAgreementRecordId}': put: - description: UPDATE - Updates an Individual in the Consent system - operationId: serviceIndividualUpdate + description: UPDATE* - Update a data agreement record. Note that updating a signed data agreement record invalidates its signature. + operationId: serviceUpdateIndividualConsentRecord parameters: - description: Unique ID of an object in: path - name: individualId + name: dataAgreementRecordId required: true schema: type: string - requestBody: - content: - application/json: - schema: - properties: - individual: - $ref: '#/components/schemas/Individual' - description: An object of type Individual - required: - - individual - type: object - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Individual' - description: '' - '400': - description: bad input parameter - security: - - BearerAuth: [] - summary: UPDATE - Updates an Individual in the Consent system - tags: - - service - x-specification-crudl-model: Individual - x-specification-pii-or-sensitive: 'True' - x-specification-scenario: '' - x-specification-usecase: '' - /service/individuals: - get: - description: LIST - List all individuals in the system - operationId: serviceIndividualList - parameters: - - description: Requested index for start of resources to be provided in response requested by client + - description: An object with id individualId in: query - name: offset - required: false + name: individualId + required: true schema: - type: integer - - description: Requested number of resources to be provided in response requested by client + type: string + - description: An object with id dataAgreementId in: query - name: limit - required: false - schema: - type: integer - responses: - '200': - content: - application/json: - schema: - items: - oneOf: - - $ref: '#/components/schemas/Individual' - type: array - description: '' - '400': - description: bad input parameter - security: - - BearerAuth: [] - summary: LIST - List all individuals in the system - tags: - - service - x-specification-crudl-model: Individual - x-specification-pii-or-sensitive: 'True' - x-specification-scenario: '' - x-specification-usecase: '' - '/service/policy/{policyId}': - get: - description: READ - Fetch the latest version of a Policy and the presented revisionId of an associated DataAgreement - operationId: servicePolicyRead - parameters: - - description: Unique ID of an object - in: path - name: policyId + name: dataAgreementId required: true schema: type: string @@ -3953,85 +3889,48 @@ paths: required: false schema: type: string - responses: - '200': - content: - application/json: - schema: - items: - oneOf: - - $ref: '#/components/schemas/Policy' - - $ref: '#/components/schemas/Revision' - type: array - description: '' - '400': - description: bad input parameter - security: - - BearerAuth: [] - summary: READ - Fetch the latest version of a Policy and the presented revisionId of an associated DataAgreement - tags: - - service - x-specification-crudl-model: Policy - x-specification-pii-or-sensitive: 'False' - x-specification-scenario: '' - x-specification-usecase: UC-C-PIC-A-003 - /service/verification/data-agreement-records: - post: - description: 'LIST - Fetch consent records (latest revision). For a given ConsentRecordFilter, query if consent exists.' - operationId: serviceVerificationConsentRecordList - parameters: - - description: Requested index for start of resources to be provided in response requested by client - in: query - name: offset - required: false - schema: - type: integer - - description: Requested number of resources to be provided in response requested by client - in: query - name: limit - required: false - schema: - type: integer requestBody: content: application/json: schema: properties: - consentRecordFilter: - $ref: '#/components/schemas/ConsentRecordFilter' - description: An object of type ConsentRecordFilter - required: - - consentRecordFilter + optIn: + type: boolean + format: '' + example: '' + description: 'True: The individual has positively opted in. False: The individual has explicitly said no (or withdrawn a previous consent).' type: object responses: '200': content: application/json: schema: - items: - oneOf: - - $ref: '#/components/schemas/ConsentRecord' - type: array + type: object + properties: + dataAgreementRecord: + $ref: '#/paths/~1service~1individual~1record~1data-agreement-record/post/responses/200/content/application~1json/schema/properties/dataAgreementRecord' + revision: + $ref: '#/components/schemas/Revision' description: '' '400': description: bad input parameter security: - BearerAuth: [] - summary: 'LIST - Fetch consent records (latest revision). For a given ConsentRecordFilter, query if consent exists.' + summary: UPDATE* - Update a data agreement record tags: - service x-specification-crudl-model: '' x-specification-pii-or-sensitive: 'True' - x-specification-scenario: '3.1, 1.2' - x-specification-usecase: UC-C-PIC-A-003 - '/service/verification/data-agreement/{dataAgreementId}': - get: - description: READ - Fetch a specific data agreement record (latest revision). The individualId is supplied as HTTP header. - operationId: serviceVerificationAgreementConsentRecordRead + x-specification-scenario: '' + x-specification-usecase: UC-C-PIC-I-003 + '/service/individual/record/data-agreement-record/{dataAgreementRecordId}/signature': + post: + description: CREATE - Creates and returns a blank Signature object for the data agreement record + operationId: serviceCreateIndividualConsentRecordSignature parameters: - description: Unique ID of an object in: path - name: dataAgreementId + name: dataAgreementRecordId required: true schema: type: string @@ -4040,109 +3939,97 @@ paths: content: application/json: schema: - items: - oneOf: - - $ref: '#/components/schemas/ConsentRecord' - - $ref: '#/components/schemas/Revision' - type: array + type: object + properties: + signature: + $ref: '#/components/schemas/Signature' description: '' '400': description: bad input parameter security: - BearerAuth: [] - summary: READ - Fetch a specific data agreement record (latest revision) + summary: CREATE - Creates and returns a blank Signature object for the data agreement record tags: - service x-specification-crudl-model: '' - x-specification-pii-or-sensitive: 'False' - x-specification-scenario: '1.2' - x-specification-usecase: UC-C-PIC-A-003 - /service/verification/data-agreements: - get: - description: LIST - Fetch all consent records - operationId: serviceVerificationAgreementList + x-specification-pii-or-sensitive: 'True' + x-specification-scenario: '' + x-specification-usecase: UC-Post-Partum-001-Registration_PostPartum_and_InfantCare + put: + description: UPDATE - Updates a Signature object for a Data Agreement Record. This is used to add a signature to an existing unsigned Signature object. Consent BB is responsible for updating the Data Agreement Record state. + operationId: serviceUpdateIndividualConsentRecordSignature parameters: - - description: Requested index for start of resources to be provided in response requested by client - in: query - name: offset - required: false - schema: - type: integer - - description: Requested number of resources to be provided in response requested by client - in: query - name: limit - required: false + - description: Unique ID of an object + in: path + name: dataAgreementRecordId + required: true schema: - type: integer + type: string + requestBody: + content: + application/json: + schema: + properties: + signature: + $ref: '#/components/schemas/Signature' + description: An object of type Signature + required: + - signature + type: object responses: '200': content: application/json: schema: - items: - oneOf: - - $ref: '#/components/schemas/ConsentRecord' - type: array + type: object + properties: + signature: + $ref: '#/components/schemas/Signature' description: '' '400': description: bad input parameter security: - BearerAuth: [] - summary: LIST - Fetch all consent records + summary: UPDATE - Updates a Signature object for a Data Agreement Record tags: - service x-specification-crudl-model: '' - x-specification-pii-or-sensitive: 'False' - x-specification-scenario: '1.1' - x-specification-usecase: UC-C-PIC-A-003 - post: - description: LIST - Fetch consent records for supplied AgreementFilter - operationId: serviceVerificationAgreementListFilter + x-specification-pii-or-sensitive: 'True' + x-specification-scenario: '' + x-specification-usecase: UC-Post-Partum-001-Registration_PostPartum_and_InfantCare + '/service/individual/record/data-agreement/{dataAgreementId}/all': + get: + description: LIST - Fetch data agreement records given to a data agreement. + operationId: serviceListIndividualAgreementConsentRecordList parameters: - - description: Requested index for start of resources to be provided in response requested by client - in: query - name: offset - required: false - schema: - type: integer - - description: Requested number of resources to be provided in response requested by client - in: query - name: limit - required: false - schema: - type: integer - requestBody: - content: - application/json: - schema: - properties: - agreementFilter: - $ref: '#/components/schemas/AgreementFilter' - description: An object of type AgreementFilter - required: - - agreementFilter - type: object + - $ref: '#/paths/~1config~1data-agreement~1%7BdataAgreementId%7D~1revisions/get/parameters/0' + - $ref: '#/paths/~1config~1policies/get/parameters/1' + - $ref: '#/paths/~1config~1policies/get/parameters/2' responses: '200': content: application/json: schema: - items: - oneOf: - - $ref: '#/components/schemas/ConsentRecord' - type: array + type: object + properties: + dataAgreementRecords: + items: + $ref: '#/paths/~1service~1individual~1record~1data-agreement-record/post/responses/200/content/application~1json/schema/properties/dataAgreementRecord' + type: array + pagination: + $ref: '#/components/schemas/Pagination' description: '' '400': description: bad input parameter security: - BearerAuth: [] - summary: LIST - Fetch consent records for supplied AgreementFilter + summary: LIST - Fetch data agreement records given to a data agreement tags: - service x-specification-crudl-model: '' - x-specification-pii-or-sensitive: 'False' - x-specification-scenario: '1.1' - x-specification-usecase: UC-C-PIC-A-003 + x-specification-pii-or-sensitive: 'True' + x-specification-scenario: '' + x-specification-usecase: UC-C-PIC-I-001 /audit/admin/logs: get: operationId: auditAdminLogs diff --git a/openapi/v2023.8.2/definitions/DataAgreementRecord.yaml b/openapi/v2023.8.2/definitions/DataAgreementRecord.yaml new file mode 100644 index 0000000..e286d6f --- /dev/null +++ b/openapi/v2023.8.2/definitions/DataAgreementRecord.yaml @@ -0,0 +1,61 @@ +type: object +title: DataAgreementRecord +description: "A data agreement record expresses consent (as defined in this building block's specification) to a single DataAgreement. There must be a UNIQUE constraint on (data agreement revision, individual)" +x-not-in-database: false + +required: + - id + - agreementRevisionHash + - state +properties: + id: + type: string + format: "" + example: "" + description: 'Objects may be passed back by some API endpoints without an id (PK), denoting that they are a "draft", i.e. a ConsentRecord that is not yet stored in the database and only exist in transit. Draft ConsentRecords do not have a Revision, but if paired up with a Signature, a valid Revision should be generated.' + + dataAgreementId: + type: string + x-fk-model: "DataAgreement" + description: "The DataAgreement to which consent has been given" + + dataAgreementRevisionId: + type: string + x-fk-model: "Revision" + description: "The Revision of the data agreement which consent has been given to" + + dataAgreementRevisionHash: + type: string + format: "" + example: "" + description: "Copy of the revision hash. The hash is the included in the signature and ensures against tampering with the original agreement." + + dataAttributes: + type: array + items: + $ref: "./DataAttributeIntegrity.yaml" + + individualId: + type: string + x-fk-model: "Individual" + description: "The Individual who has signed this data agreement record" + + optIn: + type: boolean + format: "" + example: "" + description: "True: The individual has positively opted in. False: The individual has explicitly said no (or withdrawn a previous consent)." + + state: + type: string + format: "" + example: "" + description: "The state field is used to record state changes after-the-fact. It is maintained by the Consent BB itself. Valid states: unsigned/pending more signatures/signed" + enum: + - unsigned + - signed + + signatureId: + type: string + x-fk-model: "Signature" + description: "A signature that hashes all the values of the data agreement record and has signed it with the key of the Invidiual, making it verifiable and tamper-proof. TBD: Relation to a Signature schema?" diff --git a/openapi/v2023.8.2/definitions/DataAttributeIntegrity.yaml b/openapi/v2023.8.2/definitions/DataAttributeIntegrity.yaml new file mode 100644 index 0000000..bb29e1e --- /dev/null +++ b/openapi/v2023.8.2/definitions/DataAttributeIntegrity.yaml @@ -0,0 +1,18 @@ +type: object +title: DataAttributeIntegrity +properties: + dataAttributeId: + type: string + description: "Data attribute id" + + dataAttributeRevisionId: + type: string + x-fk-model: "Revision" + description: "The Revision of the data attribute which consent has been given to" + + dataAttributeRevisionHash: + type: string + format: "" + example: "" + description: "Copy of the revision hash. The hash is the included in the signature and ensures against tampering with the original data attribute." + \ No newline at end of file diff --git a/openapi/v2023.8.2/index.yaml b/openapi/v2023.8.2/index.yaml index 7f7ceec..f528ea4 100644 --- a/openapi/v2023.8.2/index.yaml +++ b/openapi/v2023.8.2/index.yaml @@ -251,63 +251,63 @@ paths: /service/idp/open-id: get: $ref: ./paths/serviceReadIdp.yaml + /service/data-agreements: + get: + $ref: ./paths/serviceAgreementList.yaml /service/data-agreement/{dataAgreementId}: get: $ref: ./paths/serviceAgreementRead.yaml /service/data-agreement/{dataAgreementId}/data-attributes: get: - $ref: ./paths/serviceAgreementDataRead.yaml - /service/individual: + $ref: ./paths/serviceListDataAttributesForDataAgreement.yaml + /service/policy/{policyId}: + get: + $ref: ./paths/servicePolicyRead.yaml + + /service/verification/data-agreements: + get: + $ref: ./paths/serviceVerificationAgreementList.yaml + /service/verification/data-agreement/{dataAgreementId}: + get: + $ref: ./paths/serviceVerificationAgreementConsentRecordRead.yaml + + /service/verification/data-agreement-records: + get: + $ref: ./paths/serviceVerificationConsentRecordList.yaml + + /service/individual/record/data-agreement/{dataAgreementId}: post: - $ref: ./paths/serviceIndividualCreate.yaml - /service/individual/data-agreement-records: - delete: - $ref: ./paths/serviceDeleteAllRecords.yaml + $ref: ./paths/serviceCreateIndividualConsentRecord.yaml get: - $ref: ./paths/serviceListIndividualConsentRecordList.yaml + $ref: ./paths/serviceReadIndividualRecordRead.yaml + + /service/individual/record/data-agreement-record/draft: + post: + $ref: ./paths/serviceCreateIndividualConsentRecordDraft.yaml + /service/individual/record/data-agreement-record: post: $ref: ./paths/serviceCreateIndividualConsentRecordAndSignature.yaml + delete: + $ref: ./paths/serviceDeleteAllRecords.yaml + get: + $ref: ./paths/serviceListIndividualConsentRecordList.yaml + /service/individual/record/data-agreement-record/{dataAgreementRecordId}: put: $ref: ./paths/serviceUpdateIndividualConsentRecord.yaml + /service/individual/record/data-agreement-record/{dataAgreementRecordId}/signature: post: $ref: ./paths/serviceCreateIndividualConsentRecordSignature.yaml put: $ref: ./paths/serviceUpdateIndividualConsentRecordSignature.yaml - /service/individual/record/data-agreement/{dataAgreementId}: - get: - $ref: ./paths/serviceReadIndividualRecordRead.yaml - post: - $ref: ./paths/serviceCreateIndividualConsentRecord.yaml + /service/individual/record/data-agreement/{dataAgreementId}/all: get: $ref: ./paths/serviceListIndividualAgreementConsentRecordList.yaml - /service/individual/{individualId}: - delete: - $ref: ./paths/serviceIndividualDelete.yaml - get: - $ref: ./paths/serviceIndividualRead.yaml - put: - $ref: ./paths/serviceIndividualUpdate.yaml - /service/individuals: - get: - $ref: ./paths/serviceIndividualList.yaml - /service/policy/{policyId}: - get: - $ref: ./paths/servicePolicyRead.yaml - /service/verification/data-agreement-records: - post: - $ref: ./paths/serviceVerificationConsentRecordList.yaml - /service/verification/data-agreement/{dataAgreementId}: - get: - $ref: ./paths/serviceVerificationAgreementConsentRecordRead.yaml - /service/verification/data-agreements: - get: - $ref: ./paths/serviceVerificationAgreementList.yaml - post: - $ref: ./paths/serviceVerificationAgreementListFilter.yaml + + /audit/admin/logs: get: $ref: ./paths/auditAdminLogs.yaml diff --git a/openapi/v2023.8.2/parameters/dataAgreementRecordId.yaml b/openapi/v2023.8.2/parameters/dataAgreementRecordId.yaml new file mode 100644 index 0000000..bd6111f --- /dev/null +++ b/openapi/v2023.8.2/parameters/dataAgreementRecordId.yaml @@ -0,0 +1,6 @@ +description: Unique ID of an object +in: path +name: dataAgreementRecordId +required: true +schema: + type: string \ No newline at end of file diff --git a/openapi/v2023.8.2/parameters/individualId.yaml b/openapi/v2023.8.2/parameters/individualId.yaml new file mode 100644 index 0000000..94c41e6 --- /dev/null +++ b/openapi/v2023.8.2/parameters/individualId.yaml @@ -0,0 +1,6 @@ +description: Unique ID of an object +in: path +name: individualId +required: true +schema: + type: string \ No newline at end of file diff --git a/openapi/v2023.8.2/parameters/policyId.yaml b/openapi/v2023.8.2/parameters/policyId.yaml new file mode 100644 index 0000000..ffcd924 --- /dev/null +++ b/openapi/v2023.8.2/parameters/policyId.yaml @@ -0,0 +1,6 @@ +description: Unique ID of an object +in: path +name: policyId +required: true +schema: + type: string \ No newline at end of file diff --git a/openapi/v2023.8.2/paths/configListDataAttributesForDataAgreement.yaml b/openapi/v2023.8.2/paths/configListDataAttributesForDataAgreement.yaml index 550990d..4544e15 100644 --- a/openapi/v2023.8.2/paths/configListDataAttributesForDataAgreement.yaml +++ b/openapi/v2023.8.2/paths/configListDataAttributesForDataAgreement.yaml @@ -1,4 +1,4 @@ -description: LIST - Fetch all data attributes for the data agreement +description: READ - Read all data attributes for the data agreement operationId: configListDataAttribute parameters: - $ref: "../parameters/dataAgreementId.yaml" @@ -24,7 +24,7 @@ responses: description: bad input parameter security: - BearerAuth: [] -summary: LIST - List all data attributes for the data agreement +summary: READ - Read all data attributes for the data agreement tags: - config x-specification-crudl-model: DataAttribute diff --git a/openapi/v2023.8.2/paths/serviceAgreementDataRead.yaml b/openapi/v2023.8.2/paths/serviceAgreementDataRead.yaml deleted file mode 100644 index 4373e22..0000000 --- a/openapi/v2023.8.2/paths/serviceAgreementDataRead.yaml +++ /dev/null @@ -1,38 +0,0 @@ -description: READ - Fetch all latest versions of AgreementData associated - with an DataAgreement and the presented revisionId of that DataAgreement -operationId: serviceAgreementDataRead -parameters: -- description: Unique ID of an object - in: path - name: dataAgreementId - required: true - schema: - type: string -- description: An object with id revisionId - in: query - name: revisionId - required: false - schema: - type: string -responses: - '200': - content: - application/json: - schema: - items: - oneOf: - - $ref: ../definitions/AgreementData.yaml - type: array - description: '' - '400': - description: bad input parameter -security: - - BearerAuth: [] -summary: READ - Fetch all latest versions of AgreementData associated with - an DataAgreement and the presented revisionId of that DataAgreement -tags: -- service -x-specification-crudl-model: AgreementData -x-specification-pii-or-sensitive: 'False' -x-specification-scenario: '' -x-specification-usecase: UC-C-PIC-A-003 diff --git a/openapi/v2023.8.2/paths/serviceAgreementList.yaml b/openapi/v2023.8.2/paths/serviceAgreementList.yaml new file mode 100644 index 0000000..13dfb73 --- /dev/null +++ b/openapi/v2023.8.2/paths/serviceAgreementList.yaml @@ -0,0 +1,31 @@ +description: LIST - List active data agreements +operationId: serviceAgreementList +parameters: + - $ref: "../parameters/revisionId.yaml" + - $ref: "../parameters/offset.yaml" + - $ref: "../parameters/limit.yaml" +responses: + "200": + content: + application/json: + schema: + type: object + properties: + dataAgreements: + items: + $ref: ../definitions/DataAgreement.yaml + type: array + pagination: + $ref: "../definitions/Pagination.yaml" + description: "" + "400": + description: bad input parameter +security: + - BearerAuth: [] +summary: LIST - List active data agreements +tags: + - service +x-specification-crudl-model: DataAgreement +x-specification-pii-or-sensitive: "False" +x-specification-scenario: "" +x-specification-usecase: UC-C-PIC-A-003 diff --git a/openapi/v2023.8.2/paths/serviceAgreementRead.yaml b/openapi/v2023.8.2/paths/serviceAgreementRead.yaml index 6da8d36..1de81f6 100644 --- a/openapi/v2023.8.2/paths/serviceAgreementRead.yaml +++ b/openapi/v2023.8.2/paths/serviceAgreementRead.yaml @@ -1,4 +1,4 @@ -description: READ - Fetches the latest version of an DataAgreement +description: READ - Read data agreement operationId: serviceAgreementRead parameters: - description: Unique ID of an object @@ -12,17 +12,20 @@ responses: content: application/json: schema: - items: - oneOf: - - $ref: ../definitions/DataAgreement.yaml - - $ref: ../definitions/Revision.yaml type: array + items: + type: object + properties: + dataAgreement: + $ref: ../definitions/DataAgreement.yaml + revision: + $ref: ../definitions/Revision.yaml description: '' '400': description: bad input parameter security: - BearerAuth: [] -summary: READ - Fetches the latest version of an DataAgreement +summary: READ - Read data agreement tags: - service x-specification-crudl-model: DataAgreement diff --git a/openapi/v2023.8.2/paths/serviceCreateIndividualConsentRecord.yaml b/openapi/v2023.8.2/paths/serviceCreateIndividualConsentRecord.yaml index c56a76c..c655f0d 100644 --- a/openapi/v2023.8.2/paths/serviceCreateIndividualConsentRecord.yaml +++ b/openapi/v2023.8.2/paths/serviceCreateIndividualConsentRecord.yaml @@ -1,36 +1,22 @@ description: CREATE - For a particular individual and a particular data agreement, create - a new data agreement record pointing to the current revision of a given data agreement. The individualId supplied as HTTP header. + a new data agreement record pointing to the current revision of a given data agreement. operationId: serviceCreateIndividualConsentRecord parameters: - - description: Unique ID of an object - in: path - name: dataAgreementId - required: true - schema: - type: string - - description: An object with id individualId - in: query - name: individualId - required: true - schema: - type: string - - description: An object with id revisionId - in: query - name: revisionId - required: false - schema: - type: string + - $ref: "../parameters/dataAgreementId.yaml" + - $ref: "../parameters/individualId.yaml" + - $ref: "../parameters/revisionId.yaml" responses: "200": content: application/json: schema: - items: - oneOf: - - $ref: ../definitions/ConsentRecord.yaml - - $ref: ../definitions/Revision.yaml - type: array + type: object + properties: + dataAgreementRecord: + $ref: ../definitions/DataAgreementRecord.yaml + revision: + $ref: ../definitions/Revision.yaml description: "" "400": description: bad input parameter diff --git a/openapi/v2023.8.2/paths/serviceCreateIndividualConsentRecordAndSignature.yaml b/openapi/v2023.8.2/paths/serviceCreateIndividualConsentRecordAndSignature.yaml index 8bb275f..4569ff8 100644 --- a/openapi/v2023.8.2/paths/serviceCreateIndividualConsentRecordAndSignature.yaml +++ b/openapi/v2023.8.2/paths/serviceCreateIndividualConsentRecordAndSignature.yaml @@ -1,4 +1,4 @@ -description: CREATE - Create a paired consent record and signature object. Returns +description: CREATE - Create a paired data agreement record and signature object. Returns the same objects with the PK defined. operationId: serviceCreateIndividualConsentRecordAndSignature parameters: [] @@ -7,14 +7,14 @@ requestBody: application/json: schema: properties: - consentRecord: - $ref: ../definitions/ConsentRecord.yaml - description: An object of type ConsentRecord + dataAgreementRecord: + $ref: ../definitions/DataAgreementRecord.yaml + description: An object of type DataAgreementRecord signature: $ref: ../definitions/Signature.yaml description: An object of type Signature required: - - consentRecord + - dataAgreementRecord - signature type: object responses: @@ -22,18 +22,20 @@ responses: content: application/json: schema: - items: - oneOf: - - $ref: ../definitions/ConsentRecord.yaml - - $ref: ../definitions/Revision.yaml - - $ref: ../definitions/Signature.yaml - type: array + type: object + properties: + dataAgreementRecord: + $ref: ../definitions/DataAgreementRecord.yaml + revision: + $ref: ../definitions/Revision.yaml + signature: + $ref: ../definitions/Signature.yaml description: '' '400': description: bad input parameter security: - BearerAuth: [] -summary: CREATE - Create a paired consent record and signature object +summary: CREATE - Create a paired data agreement record and signature object tags: - service x-specification-crudl-model: '' diff --git a/openapi/v2023.8.2/paths/serviceCreateIndividualConsentRecordDraft.yaml b/openapi/v2023.8.2/paths/serviceCreateIndividualConsentRecordDraft.yaml index bed8a63..8cc0e4a 100644 --- a/openapi/v2023.8.2/paths/serviceCreateIndividualConsentRecordDraft.yaml +++ b/openapi/v2023.8.2/paths/serviceCreateIndividualConsentRecordDraft.yaml @@ -25,11 +25,12 @@ responses: content: application/json: schema: - items: - oneOf: - - $ref: ../definitions/ConsentRecord.yaml - - $ref: ../definitions/Signature.yaml - type: array + type: object + properties: + dataAgreementRecord: + $ref: ../definitions/DataAgreementRecord.yaml + signature: + $ref: ../definitions/Signature.yaml description: '' '400': description: bad input parameter diff --git a/openapi/v2023.8.2/paths/serviceCreateIndividualConsentRecordSignature.yaml b/openapi/v2023.8.2/paths/serviceCreateIndividualConsentRecordSignature.yaml index 8c3ba5c..881699b 100644 --- a/openapi/v2023.8.2/paths/serviceCreateIndividualConsentRecordSignature.yaml +++ b/openapi/v2023.8.2/paths/serviceCreateIndividualConsentRecordSignature.yaml @@ -12,7 +12,10 @@ responses: content: application/json: schema: - $ref: ../definitions/Signature.yaml + type: object + properties: + signature: + $ref: ../definitions/Signature.yaml description: '' '400': description: bad input parameter diff --git a/openapi/v2023.8.2/paths/serviceDeleteAllRecords.yaml b/openapi/v2023.8.2/paths/serviceDeleteAllRecords.yaml index ebe4ae0..6266e51 100644 --- a/openapi/v2023.8.2/paths/serviceDeleteAllRecords.yaml +++ b/openapi/v2023.8.2/paths/serviceDeleteAllRecords.yaml @@ -1,7 +1,7 @@ description: DELETE - Cascading delete operation for Right To Be Forgotten, deletes all data agreement records that shall not be retained and have a "forgettable" DataAgreement. May also delete an unsigned data agreement record, for instance in cases where the user - exits the signing process. Individual ID supplied as HTTP header. + exits the signing process. operationId: serviceDeleteAllRecords parameters: [] responses: @@ -11,7 +11,7 @@ responses: description: bad input parameter security: - BearerAuth: [] -summary: DELETE - Delete all data agreement records +summary: DELETE - Delete all data agreement records for an individual tags: - service x-specification-crudl-model: '' diff --git a/openapi/v2023.8.2/paths/serviceListDataAttributesForDataAgreement.yaml b/openapi/v2023.8.2/paths/serviceListDataAttributesForDataAgreement.yaml new file mode 100644 index 0000000..78943ce --- /dev/null +++ b/openapi/v2023.8.2/paths/serviceListDataAttributesForDataAgreement.yaml @@ -0,0 +1,32 @@ +description: READ - Fetch all latest versions of data attribute associated with an DataAgreement and the presented revisionId of that DataAgreement +operationId: serviceAgreementDataRead +parameters: + - $ref: "../parameters/dataAgreementId.yaml" + - $ref: "../parameters/offset.yaml" + - $ref: "../parameters/limit.yaml" + - $ref: "../parameters/revisionId.yaml" +responses: + '200': + content: + application/json: + schema: + type: object + properties: + dataAttributes: + items: + $ref: ../definitions/DataAttribute.yaml + type: array + pagination: + $ref: "../definitions/Pagination.yaml" + description: '' + '400': + description: bad input parameter +security: + - BearerAuth: [] +summary: READ - Fetch all data attributes for data agreement +tags: +- service +x-specification-crudl-model: AgreementData +x-specification-pii-or-sensitive: 'False' +x-specification-scenario: '' +x-specification-usecase: UC-C-PIC-A-003 diff --git a/openapi/v2023.8.2/paths/serviceListIndividualAgreementConsentRecordList.yaml b/openapi/v2023.8.2/paths/serviceListIndividualAgreementConsentRecordList.yaml index 7ac1234..694fc68 100644 --- a/openapi/v2023.8.2/paths/serviceListIndividualAgreementConsentRecordList.yaml +++ b/openapi/v2023.8.2/paths/serviceListIndividualAgreementConsentRecordList.yaml @@ -1,44 +1,31 @@ -description: LIST - Fetches all data agreement records given to a data agreement. The individualId is supplied as header. +description: LIST - Fetch data agreement records given to a data agreement. operationId: serviceListIndividualAgreementConsentRecordList parameters: -- description: Unique ID of an object - in: path - name: dataAgreementId - required: true - schema: - type: string -- description: Requested index for start of resources to be provided in response requested - by client - in: query - name: offset - required: false - schema: - type: integer -- description: Requested number of resources to be provided in response requested - by client - in: query - name: limit - required: false - schema: - type: integer + - $ref: "../parameters/dataAgreementId.yaml" + - $ref: "../parameters/offset.yaml" + - $ref: "../parameters/limit.yaml" responses: - '200': + "200": content: application/json: schema: - items: - oneOf: - - $ref: ../definitions/ConsentRecord.yaml - type: array - description: '' - '400': + type: object + properties: + dataAgreementRecords: + items: + $ref: ../definitions/DataAgreementRecord.yaml + type: array + pagination: + $ref: "../definitions/Pagination.yaml" + description: "" + "400": description: bad input parameter security: - BearerAuth: [] -summary: LIST - Fetches all data agreement records given to a data agreement +summary: LIST - Fetch data agreement records given to a data agreement tags: -- service -x-specification-crudl-model: '' -x-specification-pii-or-sensitive: 'True' -x-specification-scenario: '' + - service +x-specification-crudl-model: "" +x-specification-pii-or-sensitive: "True" +x-specification-scenario: "" x-specification-usecase: UC-C-PIC-I-001 diff --git a/openapi/v2023.8.2/paths/serviceListIndividualConsentRecordList.yaml b/openapi/v2023.8.2/paths/serviceListIndividualConsentRecordList.yaml index 21f6818..7baba02 100644 --- a/openapi/v2023.8.2/paths/serviceListIndividualConsentRecordList.yaml +++ b/openapi/v2023.8.2/paths/serviceListIndividualConsentRecordList.yaml @@ -1,31 +1,21 @@ -description: LIST - Fetch all current unambiguous data agreement records stored for individualId supplied as HTTP header. +description: LIST - Fetch all current unambiguous data agreement records stored for individual operationId: serviceListIndividualConsentRecordList parameters: - - description: - Requested index for start of resources to be provided in response requested - by client - in: query - name: offset - required: false - schema: - type: integer - - description: - Requested number of resources to be provided in response requested - by client - in: query - name: limit - required: false - schema: - type: integer + - $ref: "../parameters/offset.yaml" + - $ref: "../parameters/limit.yaml" responses: "200": content: application/json: schema: - items: - oneOf: - - $ref: ../definitions/ConsentRecord.yaml - type: array + type: object + properties: + dataAgreementRecords: + items: + $ref: ../definitions/DataAgreementRecord.yaml + type: array + pagination: + $ref: "../definitions/Pagination.yaml" description: "" "400": description: bad input parameter diff --git a/openapi/v2023.8.2/paths/servicePolicyRead.yaml b/openapi/v2023.8.2/paths/servicePolicyRead.yaml index 79b837b..2dd4882 100644 --- a/openapi/v2023.8.2/paths/servicePolicyRead.yaml +++ b/openapi/v2023.8.2/paths/servicePolicyRead.yaml @@ -1,39 +1,28 @@ -description: READ - Fetch the latest version of a Policy and the presented revisionId - of an associated DataAgreement +description: READ - Fetch the latest version of a Policy and the presented revisionId of an associated DataAgreement operationId: servicePolicyRead parameters: -- description: Unique ID of an object - in: path - name: policyId - required: true - schema: - type: string -- description: An object with id revisionId - in: query - name: revisionId - required: false - schema: - type: string + - $ref: "../parameters/policyId.yaml" + - $ref: "../parameters/revisionId.yaml" responses: - '200': + "200": content: application/json: schema: - items: - oneOf: - - $ref: ../definitions/Policy.yaml - - $ref: ../definitions/Revision.yaml - type: array - description: '' - '400': + type: object + properties: + policy: + $ref: ../definitions/Policy.yaml + revision: + $ref: ../definitions/Revision.yaml + description: "" + "400": description: bad input parameter security: - BearerAuth: [] -summary: READ - Fetch the latest version of a Policy and the presented revisionId - of an associated DataAgreement +summary: READ - Read policy tags: -- service + - service x-specification-crudl-model: Policy -x-specification-pii-or-sensitive: 'False' -x-specification-scenario: '' +x-specification-pii-or-sensitive: "False" +x-specification-scenario: "" x-specification-usecase: UC-C-PIC-A-003 diff --git a/openapi/v2023.8.2/paths/serviceReadIndividualRecordRead.yaml b/openapi/v2023.8.2/paths/serviceReadIndividualRecordRead.yaml index bc7effc..4ffc724 100644 --- a/openapi/v2023.8.2/paths/serviceReadIndividualRecordRead.yaml +++ b/openapi/v2023.8.2/paths/serviceReadIndividualRecordRead.yaml @@ -1,26 +1,24 @@ description: - READ - Fetch the current record for data agreement. There should be one unambiguous ConsentRecord for an Individual - and an DataAgreement. The individualId is supplied as HTTP header. + READ - Read data agreement record. There should be one unambiguous DataAgreementRecord for an Individual + and an DataAgreement. operationId: serviceReadIndividualRecordRead parameters: - - description: Unique ID of an object - in: path - name: dataAgreementId - required: true - schema: - type: string + - $ref: "../parameters/dataAgreementId.yaml" responses: "200": content: application/json: schema: - $ref: ../definitions/ConsentRecord.yaml + type: object + properties: + dataAgreementRecord: + $ref: ../definitions/DataAgreementRecord.yaml description: "" "400": description: bad input parameter security: - BearerAuth: [] -summary: READ - Fetch the current record for data agreement +summary: READ - Read data agreement record tags: - service x-specification-crudl-model: "" diff --git a/openapi/v2023.8.2/paths/serviceUpdateIndividualConsentRecord.yaml b/openapi/v2023.8.2/paths/serviceUpdateIndividualConsentRecord.yaml index 2445231..073541f 100644 --- a/openapi/v2023.8.2/paths/serviceUpdateIndividualConsentRecord.yaml +++ b/openapi/v2023.8.2/paths/serviceUpdateIndividualConsentRecord.yaml @@ -1,13 +1,7 @@ -description: UPDATE* - Update a particular data agreement record. The individualId supplied - as HTTP header. Note that updating a signed Consent Record invalidates its signature. +description: UPDATE* - Update a data agreement record. Note that updating a signed data agreement record invalidates its signature. operationId: serviceUpdateIndividualConsentRecord parameters: -- description: Unique ID of an object - in: path - name: dataAgreementRecordId - required: true - schema: - type: string +- $ref: "../parameters/dataAgreementRecordId.yaml" - description: An object with id individualId in: query name: individualId @@ -26,22 +20,34 @@ parameters: required: false schema: type: string +requestBody: + content: + application/json: + schema: + properties: + optIn: + type: boolean + format: "" + example: "" + description: "True: The individual has positively opted in. False: The individual has explicitly said no (or withdrawn a previous consent)." + type: object responses: '200': content: application/json: schema: - items: - oneOf: - - $ref: ../definitions/ConsentRecord.yaml - - $ref: ../definitions/Revision.yaml - type: array + type: object + properties: + dataAgreementRecord: + $ref: ../definitions/DataAgreementRecord.yaml + revision: + $ref: ../definitions/Revision.yaml description: '' '400': description: bad input parameter security: - BearerAuth: [] -summary: UPDATE* - Update a particular data agreement record +summary: UPDATE* - Update a data agreement record tags: - service x-specification-crudl-model: '' diff --git a/openapi/v2023.8.2/paths/serviceUpdateIndividualConsentRecordSignature.yaml b/openapi/v2023.8.2/paths/serviceUpdateIndividualConsentRecordSignature.yaml index e5556aa..dd4e7be 100644 --- a/openapi/v2023.8.2/paths/serviceUpdateIndividualConsentRecordSignature.yaml +++ b/openapi/v2023.8.2/paths/serviceUpdateIndividualConsentRecordSignature.yaml @@ -1,14 +1,15 @@ -description: UPDATE - Updates a Signature object for a Consent Record. This is used +description: + UPDATE - Updates a Signature object for a Data Agreement Record. This is used to add a signature to an existing unsigned Signature object. Consent BB is responsible - for updating the Consent Record state. + for updating the Data Agreement Record state. operationId: serviceUpdateIndividualConsentRecordSignature parameters: -- description: Unique ID of an object - in: path - name: dataAgreementRecordId - required: true - schema: - type: string + - description: Unique ID of an object + in: path + name: dataAgreementRecordId + required: true + schema: + type: string requestBody: content: application/json: @@ -18,23 +19,26 @@ requestBody: $ref: ../definitions/Signature.yaml description: An object of type Signature required: - - signature + - signature type: object responses: - '200': + "200": content: application/json: schema: - $ref: ../definitions/Signature.yaml - description: '' - '400': + type: object + properties: + signature: + $ref: ../definitions/Signature.yaml + description: "" + "400": description: bad input parameter security: - BearerAuth: [] -summary: UPDATE - Updates a Signature object for a Consent Record +summary: UPDATE - Updates a Signature object for a Data Agreement Record tags: -- service -x-specification-crudl-model: '' -x-specification-pii-or-sensitive: 'True' -x-specification-scenario: '' + - service +x-specification-crudl-model: "" +x-specification-pii-or-sensitive: "True" +x-specification-scenario: "" x-specification-usecase: UC-Post-Partum-001-Registration_PostPartum_and_InfantCare diff --git a/openapi/v2023.8.2/paths/serviceVerificationAgreementConsentRecordRead.yaml b/openapi/v2023.8.2/paths/serviceVerificationAgreementConsentRecordRead.yaml index 4a77c23..6a0527e 100644 --- a/openapi/v2023.8.2/paths/serviceVerificationAgreementConsentRecordRead.yaml +++ b/openapi/v2023.8.2/paths/serviceVerificationAgreementConsentRecordRead.yaml @@ -1,28 +1,24 @@ -description: READ - Fetch a specific data agreement record (latest revision). The individualId is supplied as HTTP header. +description: READ - Fetch a data agreement record (latest revision). The individualId is supplied as HTTP header. operationId: serviceVerificationAgreementConsentRecordRead parameters: -- description: Unique ID of an object - in: path - name: dataAgreementId - required: true - schema: - type: string +- $ref: "../parameters/dataAgreementId.yaml" responses: '200': content: application/json: schema: - items: - oneOf: - - $ref: ../definitions/ConsentRecord.yaml - - $ref: ../definitions/Revision.yaml - type: array + type: object + properties: + dataAgreementRecord: + $ref: "../definitions/DataAgreementRecord.yaml" + revision: + $ref: "../definitions/Revision.yaml" description: '' '400': description: bad input parameter security: - BearerAuth: [] -summary: READ - Fetch a specific data agreement record (latest revision) +summary: READ - Fetch a data agreement record (latest revision) tags: - service x-specification-crudl-model: '' diff --git a/openapi/v2023.8.2/paths/serviceVerificationAgreementList.yaml b/openapi/v2023.8.2/paths/serviceVerificationAgreementList.yaml index 1c5f778..d6ee49a 100644 --- a/openapi/v2023.8.2/paths/serviceVerificationAgreementList.yaml +++ b/openapi/v2023.8.2/paths/serviceVerificationAgreementList.yaml @@ -1,35 +1,27 @@ -description: LIST - Fetch all consent records +description: LIST - Fetch all data agreement records operationId: serviceVerificationAgreementList parameters: -- description: Requested index for start of resources to be provided in response requested - by client - in: query - name: offset - required: false - schema: - type: integer -- description: Requested number of resources to be provided in response requested - by client - in: query - name: limit - required: false - schema: - type: integer +- $ref: "../parameters/offset.yaml" +- $ref: "../parameters/limit.yaml" responses: '200': content: application/json: schema: - items: - oneOf: - - $ref: ../definitions/ConsentRecord.yaml - type: array + type: object + properties: + dataAgreementRecords: + type: array + items: + $ref: ../definitions/DataAgreementRecord.yaml + pagination: + $ref: "../definitions/Pagination.yaml" description: '' '400': description: bad input parameter security: - BearerAuth: [] -summary: LIST - Fetch all consent records +summary: LIST - Fetch all data agreement records tags: - service x-specification-crudl-model: '' diff --git a/openapi/v2023.8.2/paths/serviceVerificationConsentRecordList.yaml b/openapi/v2023.8.2/paths/serviceVerificationConsentRecordList.yaml index 10549c7..acd10c8 100644 --- a/openapi/v2023.8.2/paths/serviceVerificationConsentRecordList.yaml +++ b/openapi/v2023.8.2/paths/serviceVerificationConsentRecordList.yaml @@ -1,51 +1,30 @@ -description: LIST - Fetch consent records (latest revision). For a given ConsentRecordFilter, - query if consent exists. +description: LIST - Fetch data agreement records (latest revision). operationId: serviceVerificationConsentRecordList parameters: -- description: Requested index for start of resources to be provided in response requested - by client - in: query - name: offset - required: false - schema: - type: integer -- description: Requested number of resources to be provided in response requested - by client - in: query - name: limit - required: false - schema: - type: integer -requestBody: - content: - application/json: - schema: - properties: - consentRecordFilter: - $ref: ../definitions/ConsentRecordFilter.yaml - description: An object of type ConsentRecordFilter - required: - - consentRecordFilter - type: object + - $ref: "../parameters/offset.yaml" + - $ref: "../parameters/limit.yaml" responses: - '200': + "200": content: application/json: schema: - items: - oneOf: - - $ref: ../definitions/ConsentRecord.yaml - type: array - description: '' - '400': + type: object + properties: + dataAgreementRecords: + type: array + items: + $ref: ../definitions/DataAgreementRecord.yaml + pagination: + $ref: "../definitions/Pagination.yaml" + description: "" + "400": description: bad input parameter security: - BearerAuth: [] -summary: LIST - Fetch consent records (latest revision). For a given ConsentRecordFilter, - query if consent exists. +summary: LIST - Fetch data agreement records (latest revision) tags: -- service -x-specification-crudl-model: '' -x-specification-pii-or-sensitive: 'True' + - service +x-specification-crudl-model: "" +x-specification-pii-or-sensitive: "True" x-specification-scenario: 3.1, 1.2 x-specification-usecase: UC-C-PIC-A-003