From f14201f6b87e384ec637366e627319360014d858 Mon Sep 17 00:00:00 2001 From: Idoia Murua <idoia.murua@tecnalia.com> Date: Wed, 24 Apr 2024 17:08:58 +0200 Subject: [PATCH] README initialization --- README.md | 40 ++ td_openapi.yaml | 966 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 1006 insertions(+) create mode 100644 README.md create mode 100644 td_openapi.yaml diff --git a/README.md b/README.md new file mode 100644 index 0000000..b461e33 --- /dev/null +++ b/README.md @@ -0,0 +1,40 @@ +# User Journey Services Engine + +The Transparency Dashboard (TD) can be installed via docker compose. The composition includes: +- A MySQL database. +- The TD backend, with its HTTP API. +- The TD frontend, and angular application. + +The HTTP API offered by the TD backend is specified [here](./td_openapi.yaml). + +## Installation requirements +TD requires the following ACROSS components to be already installed: + +- [Usage Control](https://git.code.tecnalia.com/across/public/citizen-data-ownership-and-usage-control/usage-control/Usagecontrol): to do the enforcement of the usage policies defined by the citizen +- [Service Catalogue](https://git.code.tecnalia.com/across/public/data-harmonization-and-connectors/service-registry/Public_Service_Catalog_ENG) +- An Identity Server, as Keycloak, installed and configured with its corresponding realm and clients. + +To install the project, you need to have Docker and Docker-compose installed on your machine. If you don't have it, you can install it by following the instructions on the official Docker website. + + +## Identity Server configuration +Two clients named `trans-db-be` and `trans-db-fe`, with the `citizen` role within the realm to be used for all the Across clients must be configured in the Identity Server. + + +## Installation +Clone this repository: + +``` bash +git clone https://git.code.tecnalia.com/across/public/citizen-front-end/transparency-dashboard/transparency-dashboard-ui.git +``` + +Create and start the containers specified in the docker-compose.yml file: + +``` bash +docker-compose up -d +``` + +## License + +Read the [license file](./LICENSE) for more information. + diff --git a/td_openapi.yaml b/td_openapi.yaml new file mode 100644 index 0000000..e0954a8 --- /dev/null +++ b/td_openapi.yaml @@ -0,0 +1,966 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Across API", + "description": "API to use all the data related with ACROSS", + "version": "V0.0.3" + }, + "servers": [ + { + "url": "https://transparency-dashboard-be-td-dev.k8s.across-h2020.eu", + "description": "Generated server url" + } + ], + "security": [ + { + "openId": [] + } + ], + "paths": { + "/api/rest/v1/personal-data-consent": { + "put": { + "tags": [ + "personal-data-consents-controller" + ], + "operationId": "update", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PersonalDataConsentDto" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Consent" + } + } + } + } + } + } + }, + "/api/rest/v1/consent/{id}": { + "get": { + "tags": [ + "consents-controller" + ], + "operationId": "findById", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Consent" + } + } + } + } + } + }, + "put": { + "tags": [ + "consents-controller" + ], + "operationId": "update_1", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Consent" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Consent" + } + } + } + } + } + } + }, + "/api/rest/v1/consent/{id}/personal-data": { + "put": { + "tags": [ + "consents-controller" + ], + "operationId": "savePersonalData", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PersonalDataConsent" + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Consent" + } + } + } + } + } + } + }, + "/api/rest/v1/consent": { + "get": { + "tags": [ + "consents-controller" + ], + "operationId": "findAll", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Consent" + } + } + } + } + } + } + }, + "post": { + "tags": [ + "consents-controller" + ], + "operationId": "save", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Consent" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/Consent" + } + } + } + } + } + } + }, + "/api/rest/v1/consent/user/{userId}/services": { + "post": { + "tags": [ + "consents-controller" + ], + "operationId": "selectServicesByUser", + "parameters": [ + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Consent" + } + } + } + } + } + } + } + }, + "/api/rest/v1/consent/user/{userId}/services/without-consent": { + "post": { + "tags": [ + "consents-controller" + ], + "operationId": "getNotConsentGivenServicesList", + "parameters": [ + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ServiceInfo" + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ServiceInfo" + } + } + } + } + } + } + } + }, + "/api/rest/v1/consent/user/{userId}/services/status/{status}": { + "post": { + "tags": [ + "consents-controller" + ], + "operationId": "findByUserIdAndServiceIdInAndStatus", + "parameters": [ + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "status", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Consent" + } + } + } + } + } + } + } + }, + "/api/rest/v1/consent/external-consents": { + "post": { + "tags": [ + "consents-controller" + ], + "operationId": "saveExternalConsents", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExternalConsent" + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Consent" + } + } + } + } + } + } + } + }, + "/api/rest/v1/consent-event-log/user/{userId}/service/usage": { + "post": { + "tags": [ + "event-logs-controller" + ], + "operationId": "savePersonalDataUse", + "parameters": [ + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "serviceId", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EventLog" + } + } + } + } + } + } + } + }, + "/api/rest/v1/consent/user": { + "get": { + "tags": [ + "consents-controller" + ], + "operationId": "findByUserId", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Consent" + } + } + } + } + } + } + } + }, + "/api/rest/v1/consent/user/{userId}/status/{status}": { + "get": { + "tags": [ + "consents-controller" + ], + "operationId": "findByUserIdAndStatus", + "parameters": [ + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "status", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Consent" + } + } + } + } + } + } + } + }, + "/api/rest/v1/consent/user/{userId}/service/check-status-consent/{status}": { + "get": { + "tags": [ + "consents-controller" + ], + "operationId": "checkStatusConsentByServiceIdAndUserId", + "parameters": [ + { + "name": "userId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "status", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "serviceId", + "in": "query", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "boolean" + } + } + } + } + } + } + }, + "/api/rest/v1/consent/user/totals": { + "get": { + "tags": [ + "consents-controller" + ], + "operationId": "totals", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "$ref": "#/components/schemas/ConsentTotals" + } + } + } + } + } + } + }, + "/api/rest/v1/consent/user/status/{status}": { + "get": { + "tags": [ + "consents-controller" + ], + "operationId": "findByUserIdAndStatus_1", + "parameters": [ + { + "name": "status", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Consent" + } + } + } + } + } + } + } + }, + "/api/rest/v1/consent/user/status/not-null": { + "get": { + "tags": [ + "consents-controller" + ], + "operationId": "findByUserIdAndStatusNotNull", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Consent" + } + } + } + } + } + } + } + }, + "/api/rest/v1/consent/user/services": { + "get": { + "tags": [ + "consents-controller" + ], + "operationId": "findByUserIdAndServiceIdIn", + "parameters": [ + { + "name": "serviceId", + "in": "query", + "required": true, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Consent" + } + } + } + } + } + } + } + }, + "/api/rest/v1/consent/user/service-selected/{selectedService}": { + "get": { + "tags": [ + "consents-controller" + ], + "operationId": "findByUserIdAndSelectedService", + "parameters": [ + { + "name": "selectedService", + "in": "path", + "required": true, + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Consent" + } + } + } + } + } + } + } + }, + "/api/rest/v1/consent/user/count/pending/{pending}": { + "get": { + "tags": [ + "consents-controller" + ], + "operationId": "countByUserIdAndPending", + "parameters": [ + { + "name": "pending", + "in": "path", + "required": true, + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "integer", + "format": "int64" + } + } + } + } + } + } + }, + "/api/rest/v1/consent/test": { + "get": { + "tags": [ + "consents-controller" + ], + "operationId": "testService", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/api/rest/v1/consent/revoke-all": { + "get": { + "tags": [ + "consents-controller" + ], + "operationId": "revokeAllConsentsByUserId", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Consent" + } + } + } + } + } + } + } + }, + "/api/rest/v1/consent-event-log/user": { + "get": { + "tags": [ + "event-logs-controller" + ], + "operationId": "findByUserId_1", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/EventLog" + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "PersonalDataConsentDto": { + "type": "object", + "properties": { + "personalDataConsentId": { + "type": "string", + "format": "uuid" + }, + "grantConsent": { + "type": "boolean" + }, + "updateConsentStatus": { + "type": "boolean" + } + } + }, + "Consent": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "userId": { + "type": "string", + "format": "uuid" + }, + "serviceId": { + "type": "string" + }, + "selectedService": { + "type": "boolean" + }, + "selectedServiceDate": { + "type": "string" + }, + "pending": { + "type": "boolean" + }, + "status": { + "type": "string" + }, + "statusDate": { + "type": "string" + }, + "personalData": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PersonalDataConsent" + } + } + } + }, + "PersonalDataConsent": { + "required": [ + "dateGrantConsent", + "grantConsent", + "personalDataId" + ], + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "consentId": { + "$ref": "#/components/schemas/Consent" + }, + "personalDataId": { + "type": "string" + }, + "grantConsent": { + "type": "boolean" + }, + "dateGrantConsent": { + "type": "string" + } + } + }, + "ServiceInfo": { + "type": "object", + "properties": { + "serviceId": { + "type": "string" + }, + "serviceName": { + "type": "string" + } + } + }, + "ExternalConsent": { + "type": "object", + "properties": { + "userId": { + "type": "string", + "format": "uuid" + }, + "externalConsentServices": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ExternalConsentService" + } + } + } + }, + "ExternalConsentService": { + "type": "object", + "properties": { + "serviceId": { + "type": "string" + }, + "required": { + "type": "boolean" + } + } + }, + "EventLog": { + "required": [ + "action", + "createdOn", + "serviceName", + "userId" + ], + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "userId": { + "type": "string", + "format": "uuid" + }, + "createdOn": { + "type": "string" + }, + "serviceName": { + "type": "string" + }, + "action": { + "type": "string" + }, + "dataName": { + "type": "string" + }, + "dataValue": { + "type": "string" + } + } + }, + "ConsentTotals": { + "type": "object", + "properties": { + "selectedServices": { + "type": "integer", + "format": "int64" + }, + "givenConsents": { + "type": "integer", + "format": "int64" + } + } + } + }, + "securitySchemes": { + "openId": { + "type": "openIdConnect", + "openIdConnectUrl": "https://idp-security-dev.k8s.across-h2020.eu/realms/eidas-greece/.well-known/openid-configuration" + } + } + } +} \ No newline at end of file -- GitLab