Skip to content

Commit

Permalink
Upd: Add service endpoints
Browse files Browse the repository at this point in the history
Signed-off-by: George J Padayatti <[email protected]>
  • Loading branch information
georgepadayatti committed Oct 20, 2023
1 parent afc40fa commit 79f8778
Show file tree
Hide file tree
Showing 26 changed files with 754 additions and 809 deletions.
863 changes: 375 additions & 488 deletions openapi/v2023.8.2/bundled.yaml

Large diffs are not rendered by default.

61 changes: 61 additions & 0 deletions openapi/v2023.8.2/definitions/DataAgreementRecord.yaml
Original file line number Diff line number Diff line change
@@ -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?"
18 changes: 18 additions & 0 deletions openapi/v2023.8.2/definitions/DataAttributeIntegrity.yaml
Original file line number Diff line number Diff line change
@@ -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."

72 changes: 36 additions & 36 deletions openapi/v2023.8.2/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions openapi/v2023.8.2/parameters/dataAgreementRecordId.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
description: Unique ID of an object
in: path
name: dataAgreementRecordId
required: true
schema:
type: string
6 changes: 6 additions & 0 deletions openapi/v2023.8.2/parameters/individualId.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
description: Unique ID of an object
in: path
name: individualId
required: true
schema:
type: string
6 changes: 6 additions & 0 deletions openapi/v2023.8.2/parameters/policyId.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
description: Unique ID of an object
in: path
name: policyId
required: true
schema:
type: string
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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
Expand Down
38 changes: 0 additions & 38 deletions openapi/v2023.8.2/paths/serviceAgreementDataRead.yaml

This file was deleted.

31 changes: 31 additions & 0 deletions openapi/v2023.8.2/paths/serviceAgreementList.yaml
Original file line number Diff line number Diff line change
@@ -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
15 changes: 9 additions & 6 deletions openapi/v2023.8.2/paths/serviceAgreementRead.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
34 changes: 10 additions & 24 deletions openapi/v2023.8.2/paths/serviceCreateIndividualConsentRecord.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading

0 comments on commit 79f8778

Please sign in to comment.