df/bff/doc/swagger/df.swagger.json
itsscb 91903b9a2e ft/adds additional endpoints and refactors others
New:
- GetAccount
- ListAccounts
- CreatePerson

Refactored:
- CreateAccount
- RefreshToken
- UpdateAccount
2023-10-06 00:18:53 +02:00

937 lines
23 KiB
JSON

{
"swagger": "2.0",
"info": {
"title": "df API",
"version": "1.0",
"contact": {
"name": "itsscb",
"url": "https://github.com/itsscb/df",
"email": "dev@itsscb.de"
}
},
"tags": [
{
"name": "df",
"description": "df"
}
],
"schemes": [
"http",
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {
"/v1/block_session": {
"patch": {
"operationId": "df_BlockSession",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/pbBlockSessionResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "body",
"description": "Block a Session",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/pbBlockSessionRequest"
}
}
],
"tags": [
"df"
],
"security": [
{
"BearerAuth": []
}
]
}
},
"/v1/create_account": {
"post": {
"operationId": "df_CreateAccount",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/pbCreateAccountResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "body",
"description": "Create an Account",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/pbCreateAccountRequest"
}
}
],
"tags": [
"df"
]
}
},
"/v1/create_person": {
"post": {
"operationId": "df_CreatePerson",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/pbCreatePersonResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "body",
"description": "Create an Person",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/pbCreatePersonRequest"
}
}
],
"tags": [
"df"
],
"security": [
{
"BearerAuth": []
}
]
}
},
"/v1/get_account": {
"get": {
"operationId": "df_GetAccount",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/pbGetAccountResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "id",
"in": "query",
"required": true,
"type": "string",
"format": "int64"
}
],
"tags": [
"df"
],
"security": [
{
"BearerAuth": []
}
]
}
},
"/v1/list_accounts": {
"get": {
"operationId": "df_ListAccounts",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/pbListAccountsResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "pageId",
"in": "query",
"required": false,
"type": "integer",
"format": "int32"
},
{
"name": "pageSize",
"in": "query",
"required": false,
"type": "integer",
"format": "int32"
}
],
"tags": [
"df"
],
"security": [
{
"BearerAuth": []
}
]
}
},
"/v1/login": {
"post": {
"operationId": "df_Login",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/pbLoginResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "body",
"description": "Login an Account",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/pbLoginRequest"
}
}
],
"tags": [
"df"
]
}
},
"/v1/refresh_token": {
"post": {
"operationId": "df_RefreshToken",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/pbRefreshTokenResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "body",
"description": "Get a new Access Token by submitting the Refresh Token",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/pbRefreshTokenRequest"
}
}
],
"tags": [
"df"
]
}
},
"/v1/update_account": {
"patch": {
"operationId": "df_UpdateAccount",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/pbUpdateAccountResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "body",
"description": "Update an Account",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/pbUpdateAccountRequest"
}
}
],
"tags": [
"df"
],
"security": [
{
"BearerAuth": []
}
]
}
},
"/v1/update_account_privacy": {
"patch": {
"operationId": "df_UpdateAccountPrivacy",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/pbUpdateAccountPrivacyResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "body",
"description": "Update the Privacy Consent of an Account",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/pbUpdateAccountPrivacyRequest"
}
}
],
"tags": [
"df"
],
"security": [
{
"BearerAuth": []
}
]
}
}
},
"definitions": {
"pbAccount": {
"type": "object",
"example": {
"id": "1",
"email": "john.doe@example.com",
"firstname": "John",
"lastname": "Doe",
"phone": "",
"street": "Death Star 2",
"zip": "0815",
"city": "New York",
"country": "USA",
"birthday": "1990-10-05T00:00:00Z",
"privacy_accepted": false,
"privacy_accepted_date": "0001-01-01T00:00:00Z",
"creator": "john.doe@example.com",
"created": "2023-10-05T02:30:53Z",
"changer": "john.doe@example.com",
"changed": "2023-10-05T02:30:53Z"
},
"properties": {
"id": {
"type": "string",
"format": "int64"
},
"email": {
"type": "string"
},
"firstname": {
"type": "string"
},
"lastname": {
"type": "string"
},
"street": {
"type": "string"
},
"city": {
"type": "string"
},
"zip": {
"type": "string"
},
"country": {
"type": "string"
},
"birthday": {
"type": "string",
"format": "date-time",
"example": "1990-10-05T00:00:00Z"
},
"phone": {
"type": "string"
},
"privacyAccepted": {
"type": "boolean"
},
"privacyAcceptedDate": {
"type": "string",
"format": "date-time",
"example": "2023-10-05T00:00:00Z"
},
"permissionLevel": {
"type": "integer",
"format": "int32",
"description": "Default is 0 (non-priviledged)"
},
"creator": {
"type": "string"
},
"created": {
"type": "string",
"format": "date-time",
"example": "2023-10-05T00:00:00Z"
},
"changer": {
"type": "string"
},
"changed": {
"type": "string",
"format": "date-time",
"example": "2023-10-05T00:00:00Z"
}
},
"title": "Account"
},
"pbBlockSessionRequest": {
"type": "object",
"example": {
"session_id": "5e1d67da-7c9b-4365-a4d5-3cc0a051241e"
},
"properties": {
"sessionId": {
"type": "string",
"format": "uuid",
"example": "5e1d67da-7c9b-4365-a4d5-3cc0a051241e"
}
},
"description": "Block a Session",
"title": "Block Session",
"required": [
"sessionId"
]
},
"pbBlockSessionResponse": {
"type": "object",
"example": {
"session_id": "5e1d67da-7c9b-4365-a4d5-3cc0a051241e",
"blocked": true
},
"properties": {
"sessionId": {
"type": "string",
"format": "uuid",
"example": "5e1d67da-7c9b-4365-a4d5-3cc0a051241e"
},
"blocked": {
"type": "boolean",
"example": true
}
},
"title": "Blocked Session"
},
"pbCreateAccountRequest": {
"type": "object",
"example": {
"email": "john.doe@example.com",
"password": "MayTheForceBeWithYou!",
"firstname": "John",
"lastname": "Doe",
"street": "Main Street 1",
"zip": "0815",
"city": "New York",
"country": "USA",
"birthday": "1990-10-05T00:00:00Z"
},
"properties": {
"email": {
"type": "string"
},
"password": {
"type": "string"
},
"firstname": {
"type": "string"
},
"lastname": {
"type": "string"
},
"street": {
"type": "string"
},
"city": {
"type": "string"
},
"zip": {
"type": "string"
},
"country": {
"type": "string"
},
"phone": {
"type": "string"
},
"birthday": {
"type": "string",
"format": "date-time",
"example": "1990-10-05T00:00:00Z"
},
"privacyAccepted": {
"type": "boolean",
"example": true
}
},
"description": "Create an Account",
"title": "Create Account",
"required": [
"email",
"password",
"firstname",
"lastname",
"street",
"city",
"zip",
"country",
"birthday"
]
},
"pbCreateAccountResponse": {
"type": "object",
"properties": {
"account": {
"$ref": "#/definitions/pbAccount"
}
},
"description": "Returns the created Account",
"title": "Created Account"
},
"pbCreatePersonRequest": {
"type": "object",
"example": {
"account_id": "1",
"firstname": "John",
"lastname": "Doe",
"street": "Main Street 1",
"zip": "0815",
"city": "New York",
"country": "USA",
"birthday": "1990-10-05T00:00:00Z"
},
"properties": {
"accountId": {
"type": "string",
"format": "int64"
},
"firstname": {
"type": "string"
},
"lastname": {
"type": "string"
},
"street": {
"type": "string"
},
"city": {
"type": "string"
},
"zip": {
"type": "string"
},
"country": {
"type": "string"
},
"birthday": {
"type": "string",
"format": "date-time",
"example": "1990-10-05T00:00:00Z"
}
},
"description": "Create an Person",
"title": "Create Person",
"required": [
"firstname",
"lastname",
"street",
"city",
"zip",
"country",
"birthday"
]
},
"pbCreatePersonResponse": {
"type": "object",
"properties": {
"person": {
"$ref": "#/definitions/pbPerson"
}
},
"description": "Returns the created Person",
"title": "Created Person"
},
"pbGetAccountResponse": {
"type": "object",
"properties": {
"account": {
"$ref": "#/definitions/pbAccount"
}
},
"description": "Returns the Account",
"title": "GetAccount Response"
},
"pbListAccountsResponse": {
"type": "object",
"properties": {
"account": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/pbAccount"
}
}
},
"description": "Returns the Account",
"title": "ListAccounts Response"
},
"pbLoginRequest": {
"type": "object",
"example": {
"email": "john.doe@example.com",
"password": "MayTheForceBeWithYou!"
},
"properties": {
"email": {
"type": "string",
"format": "email",
"example": "john.doe@example.com"
},
"password": {
"type": "string",
"format": "password",
"example": "MayTheForceBeWithYou!"
}
},
"description": "Login an Account",
"title": "Login",
"required": [
"email",
"password"
]
},
"pbLoginResponse": {
"type": "object",
"properties": {
"sessionId": {
"type": "string",
"format": "uuid",
"example": "5e1d67da-7c9b-4365-a4d5-3cc0a051241e"
},
"accessToken": {
"type": "string",
"example": "v4.public.eyJlbWFpbCI6ImEyQGIuZGUiLCJleHAiOiIyMDIzLTEwLTA1VDAxOjE3OjA5KzAyOjAwIiwiaWF0IjoiMjAyMy0xMC0wNVQwMTowMjowOSswMjowMCIsImlkIjoiZjlhMjE2OWQtMWYxYS00YThiLTgzZWEtNzkxMzY5YjY3ZmYxIiwibmJmIjoiMjAyMy0xMC0wNVQwMTowMjowOSswMjowMCJ9Ah0bVbx9S1LR-pf8hLWVRQPUfK9zrHZvA7ApJ5aZXwhA7H1j-kHhccBjOAGYXZQT-ts7Jq3SJlzo5vtUjGBtDg"
},
"accessTokenExpiresAt": {
"type": "string",
"format": "date-time"
},
"refreshToken": {
"type": "string",
"example": "v4.public.eyJlbWFpbCI6ImEyQGIuZGUiLCJleHAiOiIyMDIzLTEwLTA2VDAxOjAyOjA5KzAyOjAwIiwiaWF0IjoiMjAyMy0xMC0wNVQwMTowMjowOSswMjowMCIsImlkIjoiNWUxZDY3ZGEtN2M5Yi00MzY1LWE0ZDUtM2NjMGEwNTEyNDFlIiwibmJmIjoiMjAyMy0xMC0wNVQwMTowMjowOSswMjowMCJ9BoX36w0po1vvHSjsBP_KWeFxV1xRbQayqbJuIoK2jKqy1Bt2RoHyJbLoCEO15CRT5DnQ6P0AHlBzjsXt61aDDw"
},
"refreshTokenExpiresAt": {
"type": "string",
"format": "date-time"
},
"email": {
"type": "string",
"format": "email",
"example": "john.doe@example.com"
}
},
"title": "Login Response"
},
"pbPerson": {
"type": "object",
"example": {
"id": "1",
"email": "john.doe@example.com",
"firstname": "John",
"lastname": "Doe",
"phone": "",
"street": "Death Star 2",
"zip": "0815",
"city": "New York",
"country": "USA",
"birthday": "1990-10-05T00:00:00Z",
"privacy_accepted": false,
"privacy_accepted_date": "0001-01-01T00:00:00Z",
"creator": "john.doe@example.com",
"created": "2023-10-05T02:30:53Z",
"changer": "john.doe@example.com",
"changed": "2023-10-05T02:30:53Z"
},
"properties": {
"accountId": {
"type": "string",
"format": "int64"
},
"firstname": {
"type": "string"
},
"lastname": {
"type": "string"
},
"street": {
"type": "string"
},
"city": {
"type": "string"
},
"zip": {
"type": "string"
},
"country": {
"type": "string"
},
"birthday": {
"type": "string",
"format": "date-time",
"example": "1990-10-05T00:00:00Z"
},
"creator": {
"type": "string"
},
"created": {
"type": "string",
"format": "date-time",
"example": "2023-10-05T00:00:00Z"
},
"changer": {
"type": "string"
},
"changed": {
"type": "string",
"format": "date-time",
"example": "2023-10-05T00:00:00Z"
}
},
"title": "Person"
},
"pbRefreshTokenRequest": {
"type": "object",
"example": {
"refresh_token": "v4.public.eyJlbWFpbCI6ImEyQGIuZGUiLCJleHAiOiIyMDIzLTEwLTA2VDAxOjAyOjA5KzAyOjAwIiwiaWF0IjoiMjAyMy0xMC0wNVQwMTowMjowOSswMjowMCIsImlkIjoiNWUxZDY3ZGEtN2M5Yi00MzY1LWE0ZDUtM2NjMGEwNTEyNDFlIiwibmJmIjoiMjAyMy0xMC0wNVQwMTowMjowOSswMjowMCJ9BoX36w0po1vvHSjsBP_KWeFxV1xRbQayqbJuIoK2jKqy1Bt2RoHyJbLoCEO15CRT5DnQ6P0AHlBzjsXt61aDDw"
},
"properties": {
"refreshToken": {
"type": "string",
"example": "v4.public.eyJlbWFpbCI6ImEyQGIuZGUiLCJleHAiOiIyMDIzLTEwLTA2VDAxOjAyOjA5KzAyOjAwIiwiaWF0IjoiMjAyMy0xMC0wNVQwMTowMjowOSswMjowMCIsImlkIjoiNWUxZDY3ZGEtN2M5Yi00MzY1LWE0ZDUtM2NjMGEwNTEyNDFlIiwibmJmIjoiMjAyMy0xMC0wNVQwMTowMjowOSswMjowMCJ9BoX36w0po1vvHSjsBP_KWeFxV1xRbQayqbJuIoK2jKqy1Bt2RoHyJbLoCEO15CRT5DnQ6P0AHlBzjsXt61aDDw",
"title": "Refresh Token"
}
},
"description": "Get a new Access Token by submitting the Refresh Token",
"title": "Refresh Token Request",
"required": [
"refreshToken"
]
},
"pbRefreshTokenResponse": {
"type": "object",
"example": {
"access_token": "v4.public.eyJlbWFpbCI6ImEyQGIuZGUiLCJleHAiOiIyMDIzLTEwLTA1VDAxOjE3OjA5KzAyOjAwIiwiaWF0IjoiMjAyMy0xMC0wNVQwMTowMjowOSswMjowMCIsImlkIjoiZjlhMjE2OWQtMWYxYS00YThiLTgzZWEtNzkxMzY5YjY3ZmYxIiwibmJmIjoiMjAyMy0xMC0wNVQwMTowMjowOSswMjowMCJ9Ah0bVbx9S1LR-pf8hLWVRQPUfK9zrHZvA7ApJ5aZXwhA7H1j-kHhccBjOAGYXZQT-ts7Jq3SJlzo5vtUjGBtDg"
},
"properties": {
"accessToken": {
"type": "string",
"example": "v4.public.eyJlbWFpbCI6ImEyQGIuZGUiLCJleHAiOiIyMDIzLTEwLTA1VDAxOjE3OjA5KzAyOjAwIiwiaWF0IjoiMjAyMy0xMC0wNVQwMTowMjowOSswMjowMCIsImlkIjoiZjlhMjE2OWQtMWYxYS00YThiLTgzZWEtNzkxMzY5YjY3ZmYxIiwibmJmIjoiMjAyMy0xMC0wNVQwMTowMjowOSswMjowMCJ9Ah0bVbx9S1LR-pf8hLWVRQPUfK9zrHZvA7ApJ5aZXwhA7H1j-kHhccBjOAGYXZQT-ts7Jq3SJlzo5vtUjGBtDg",
"title": "Access Token"
},
"accessTokenExpiresAt": {
"type": "string",
"format": "date-time"
}
},
"title": "Refresh Token Response"
},
"pbUpdateAccountPrivacyRequest": {
"type": "object",
"example": {
"id": "1",
"privacy_accepted": true
},
"properties": {
"id": {
"type": "string",
"format": "int64",
"example": 1
},
"privacyAccepted": {
"type": "boolean",
"example": false
}
},
"description": "Update the Privacy Consent of an Account",
"title": "Update Account Privacy Consent",
"required": [
"id",
"privacyAccepted"
]
},
"pbUpdateAccountPrivacyResponse": {
"type": "object",
"properties": {
"account": {
"$ref": "#/definitions/pbAccount",
"title": "Updated Account"
}
},
"title": "Update Account Privacy Response"
},
"pbUpdateAccountRequest": {
"type": "object",
"example": {
"id": "195",
"street": "Death Star 2"
},
"properties": {
"id": {
"type": "string",
"format": "int64"
},
"email": {
"type": "string"
},
"password": {
"type": "string"
},
"firstname": {
"type": "string"
},
"lastname": {
"type": "string"
},
"street": {
"type": "string"
},
"city": {
"type": "string"
},
"zip": {
"type": "string"
},
"country": {
"type": "string"
},
"phone": {
"type": "string"
},
"birthday": {
"type": "string",
"format": "date-time",
"example": "1990-10-05T00:00:00Z"
}
},
"description": "Update an Account",
"title": "Update Account",
"required": [
"id"
]
},
"pbUpdateAccountResponse": {
"type": "object",
"properties": {
"account": {
"$ref": "#/definitions/pbAccount"
}
},
"description": "Returns the updated Account",
"title": "Updated Account"
},
"protobufAny": {
"type": "object",
"properties": {
"@type": {
"type": "string"
}
},
"additionalProperties": {}
},
"rpcStatus": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/protobufAny"
}
}
}
}
},
"securityDefinitions": {
"BearerAuth": {
"type": "apiKey",
"name": "Authorization",
"in": "header"
}
}
}