Created
April 23, 2021 20:47
-
-
Save fgeorgatos/b827d8623c4c874fedffdace45b1ba47 to your computer and use it in GitHub Desktop.
sdc openapi yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
openapi: "3.0.2" | |
info: | |
version: "1.0" | |
title: Custodian API | |
description: "We offer some API that provides custodian services" | |
contact: | |
name: Custodian team | |
url: https://gitlab.datascience.ch/custodian/contact | |
servers: | |
- url: "https://testing.swisscustodian.ch" ## FIXME | |
description: Test server | |
tags: | |
- name: "CME" | |
description: "Consent Management Engine" | |
externalDocs: | |
description: "" | |
url: "" # FIXME: put link to documentation here | |
- name: "Access Control" | |
description: "Endpoints for PDP, PIP, ..." | |
externalDocs: | |
description: "" | |
url: "" # FIXME: put link to documentation here | |
- name: "GPS" | |
description: "Endpoints for the GPS application" | |
externalDocs: | |
description: "" | |
url: "" # FIXME: put link to documentation here | |
paths: | |
/accesscontrol-pdp/verify: | |
get: | |
tags: | |
- "Access Control" | |
summary: "Verify an authorization" | |
parameters: | |
- in: query | |
name: oid | |
schema: | |
type: string | |
required: true | |
description: OID of the data owner | |
- in: query | |
name: consent_author_oid | |
schema: | |
type: string | |
required: true | |
description: OID of the consent author | |
- in: query | |
name: fields | |
schema: | |
type: array | |
items: | |
type: string | |
required: true | |
description: the data fields whose permission must be verified | |
responses: | |
'200': | |
description: OK | |
/accesscontrol-pip/authorization: | |
get: | |
tags: | |
- "Access Control" | |
summary: "Get the consent corresponding to the owner oid, consent author oid and requested data fields, if it exists" | |
parameters: | |
- in: query | |
name: oid | |
schema: | |
type: string | |
required: true | |
description: OID of the data owner | |
- in: query | |
name: consent_author_oid | |
schema: | |
type: string | |
required: true | |
description: OID of the consent author | |
- in: query | |
name: fields | |
schema: | |
type: array | |
items: | |
type: string | |
required: true | |
description: the data fields whose permission must be verified | |
responses: | |
'200': | |
description: OK | |
/cme-signing/sign: | |
post: | |
tags: | |
- "CME" | |
summary: "Sign a consent" | |
requestBody: | |
required: true | |
description: "Consent signing template" | |
content: | |
application/json: | |
schema: | |
$ref: '#/components/schemas/ConsentAuthorization' | |
responses: | |
'200': | |
description: OK | |
/cme-signing/revoke: | |
put: | |
tags: | |
- "CME" | |
summary: "Revoke a consent consent" | |
requestBody: | |
required: true | |
description: "Consent signing template" | |
content: | |
application/json: | |
schema: | |
$ref: '#/components/schemas/ConsentAuthorization' | |
responses: | |
'200': | |
description: OK | |
/cme-consent/upload: | |
post: | |
tags: | |
- "CME" | |
summary: "Upload a new consent" | |
requestBody: | |
required: true | |
description: "Consent description" | |
content: | |
application/json: | |
schema: | |
$ref: '#/components/schemas/ConsentEnvelope' | |
responses: | |
'200': | |
description: OK | |
/cme-consent/modify: | |
put: | |
tags: | |
- "CME" | |
summary: "Modify consent" | |
requestBody: | |
required: true | |
description: "Consent description" | |
content: | |
application/json: | |
schema: | |
$ref: '#/components/schemas/ConsentEnvelope' | |
responses: | |
'200': | |
description: OK | |
/cme-consent/delete: | |
parameters: | |
- in: query | |
name: oid | |
description: The OID of the consent. | |
schema: | |
type: string | |
delete: | |
tags: | |
- "CME" | |
summary: "Remove an existing consent" | |
responses: | |
'200': | |
description: OK | |
/gps-cmd/submit: | |
post: | |
tags: | |
- "GPS" | |
summary: "submit gps data" | |
requestBody: | |
required: true | |
description: "Consent description" | |
content: | |
application/json: | |
schema: | |
$ref: '#/components/schemas/Submission' | |
responses: | |
'200': | |
description: OK | |
/gps-read/submission/{OID}: | |
get: | |
tags: | |
- "GPS" | |
summary: Get a submission by ID | |
parameters: | |
- in: path | |
name: OID | |
schema: | |
type: string | |
required: true | |
description: OID of the submission to get | |
responses: | |
'200': | |
description: Confirmation | |
content: | |
application/json: | |
schema: | |
$ref: '#/components/schemas/Submission' | |
/create: | |
post: | |
tags: | |
- "IMS" | |
summary: "Create a new user" | |
requestBody: | |
required: true | |
description: "User Description" | |
content: | |
application/json: | |
schema: | |
$ref: '#/components/schemas/User' | |
responses: | |
'200': | |
description: OK | |
/pk: | |
get: | |
tags: | |
- "IMS" | |
summary: "Get a user's public key base on his/her temporary OID" | |
parameters: | |
- in: query | |
name: oid | |
schema: | |
type: string | |
required: true | |
description: User's temporary OID | |
responses: | |
'200': | |
description: OK | |
put: | |
tags: | |
- "IMS" | |
summary: "Add a public key to a user" | |
parameters: | |
- in: query | |
name: oid | |
schema: | |
type: string | |
required: true | |
description: One of the user's temporary OIDs | |
- in: query | |
name: pk | |
schema: | |
type: string | |
required: true | |
description: New public key | |
responses: | |
'200': | |
description: OK | |
components: | |
responses: | |
NotFound: | |
description: The specified resource was not found | |
content: | |
application/json: | |
schema: | |
$ref: '#/components/schemas/Error' | |
Unauthorized: | |
description: Unauthorized | |
content: | |
application/json: | |
schema: | |
$ref: '#/components/schemas/Error' | |
schemas: | |
Error: | |
type: object | |
properties: | |
code: | |
type: string | |
message: | |
type: string | |
required: | |
- code | |
- message | |
ConsentEnvelope: | |
type: object | |
required: | |
- consent_body | |
- consent_header | |
properties: | |
consent_header: | |
$ref: '#/components/schemas/ConsentHeader' | |
consent_body: | |
$ref: '#/components/schemas/ConsentBody' | |
ConsentHeader: | |
type: object | |
required: | |
- signatory_party_oid | |
- signed_hash_b64 | |
- timestamp | |
properties: | |
signatory_party_oid: | |
type: string | |
signed_hash_b64: | |
type: string | |
timestamp: | |
type: string | |
ConsentBody: | |
type: object | |
required: | |
- title | |
- description | |
- field | |
- creation_date | |
- expiration_date | |
- author_oid | |
properties: | |
title: | |
type: string | |
description: | |
type: string | |
field: | |
type: string | |
creation_date: | |
type: string | |
expiration_date: | |
type: string | |
author_oid: | |
type: string | |
ConsentAuthorization: | |
type: object | |
required: | |
- user_oid | |
- consent_oid | |
- signed_hash_b64 | |
- timestamp | |
- validity | |
properties: | |
user_oid: | |
type: string | |
consent_oid: | |
type: string | |
signed_hash_b64: | |
type: string | |
timestamp: | |
type: string | |
validity: | |
type: boolean | |
Submission: | |
type: object | |
required: | |
- owner_oid | |
- data_content | |
properties: | |
owner_oid: | |
type: string | |
data_content: | |
type: object | |
User: | |
type: object | |
required: | |
- username | |
- attributes | |
properties: | |
username: | |
type: string | |
attributes: | |
$ref: '#/components/schemas/Attributes' | |
Attributes: | |
type: object | |
additionalProperties: | |
type: array | |
items: | |
type: string | |
externalDocs: | |
description: Documentation and main site | |
url: https://data-custodian.gitlab.io/documentation/ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment