From f5527dbb0f2ae6964beb97d9cb1a3cc53e012319 Mon Sep 17 00:00:00 2001 From: Zaptoss Date: Thu, 12 Sep 2024 08:50:55 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20=20@=20afcf7?= =?UTF-8?q?6598289d769df6c83af4ad38257a4d58e86=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- openapi.json | 202 +++++++++++++++++++++++++++++++++++++++++++++++++++ openapi.yaml | 136 ++++++++++++++++++++++++++++++++++ 2 files changed, 338 insertions(+) diff --git a/openapi.json b/openapi.json index 5c83531..61f1cce 100644 --- a/openapi.json +++ b/openapi.json @@ -238,6 +238,49 @@ } } }, + "/integrations/geo-forms-svc/v1/image/{id}": { + "get": { + "tags": [ + "User form" + ], + "summary": "Get market", + "description": "Get single market", + "parameters": [ + { + "$ref": "#/components/parameters/pathID" + }, + { + "in": "query", + "name": "api", + "required": true, + "schema": { + "type": "string", + "example": "dc3d2b96-9ff1-4f54-9fb6-005a518089fe", + "description": "Api key for limit access to images" + } + } + ], + "operationId": "getImage", + "responses": { + "302": { + "description": "OK" + }, + "403": { + "description": "You must provide a valid api key.", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/Errors" + } + } + } + }, + "500": { + "$ref": "#/components/responses/internalError" + } + } + } + }, "/integrations/geo-forms-svc/v1/status/{id}": { "get": { "tags": [ @@ -336,6 +379,77 @@ } } } + }, + "/integrations/geo-forms-svc/v2/image": { + "post": { + "tags": [ + "User form" + ], + "summary": "Generate two pre-signed urls", + "description": "Generate pre-signed URL for the provided content-length \nand content-type for selfie and passport image, with a configurable lifetime. \nThe response contains a URL with a signature and \nother information that should be used to upload image \nin S3 Storage. The name is generated on the server side.\n'verified: true' must be specified in the JWT.\nThe cooldown of this endpoint is the same as in the submit form.\nThis endpoint creates an empty form that can be submitted on `/form`\n", + "operationId": "uploadImageV2", + "security": [ + { + "BearerAuth": [] + } + ], + "requestBody": { + "content": { + "application/vnd.api+json": { + "schema": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/UploadImageV2" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/vnd.api+json": { + "schema": { + "type": "object", + "required": [ + "data" + ], + "properties": { + "data": { + "$ref": "#/components/schemas/UploadImageResponseV2" + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/invalidParameter" + }, + "401": { + "$ref": "#/components/responses/invalidAuth" + }, + "429": { + "description": "It is necessary to wait some time before sending the next form", + "content": { + "application/vnd.api+json": { + "schema": { + "$ref": "#/components/schemas/Errors" + } + } + } + }, + "500": { + "$ref": "#/components/responses/internalError" + } + } + } } }, "components": { @@ -481,6 +595,11 @@ "description": "base64 encoded image with max size 4 MB or\nURL for S3 storage with image up to 4 mb\n", "example": "https://geoforms.nyc3.digitaloceanspaces.com/awesome_phono.jpg" }, + "passport_image": { + "type": "string", + "description": "base64 encoded image with max size 4 MB or\nURL for S3 storage with image up to 4 mb\n", + "example": "https://geoforms.nyc3.digitaloceanspaces.com/awesome_phono.jpg" + }, "created_at": { "type": "integer", "format": "int64", @@ -530,6 +649,26 @@ } } }, + "ImageData": { + "type": "object", + "required": [ + "content_type", + "content_length" + ], + "properties": { + "content_type": { + "type": "string", + "example": "image/png", + "description": "Allowed content-type is `image/png`, `image/jpeg` or `image/x-jp2`" + }, + "content_length": { + "type": "integer", + "format": "int64", + "example": 150000, + "description": "Image size. It cannot be more than 4 megabytes." + } + } + }, "UploadImage": { "allOf": [ { @@ -626,6 +765,69 @@ ] } } + }, + "UploadImageResponseV2": { + "allOf": [ + { + "$ref": "#/components/schemas/UploadImageResponseKey" + }, + { + "type": "object", + "required": [ + "attributes" + ], + "properties": { + "attributes": { + "type": "object", + "required": [ + "selfie_image_url" + ], + "properties": { + "selfie_image_url": { + "type": "string", + "description": "Pre-signed URL to upload the file", + "example": "https://bucket.nyc3.digitaloceanspaces.com/somefile?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=DO00PTJRCBZELX6E4EEK%2F20240722%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240722T133921Z&X-Amz-Expires=300&X-Amz-SignedHeaders=host&X-Amz-Signature=940c9058b90e8836b03470fdb51af1f24baabc16a7a83b80352d3d618aa4f23f" + }, + "passport_image_url": { + "type": "string", + "description": "Pre-signed URL to upload the file", + "example": "https://bucket.nyc3.digitaloceanspaces.com/somefile?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=DO00PTJRCBZELX6E4EEK%2F20240722%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240722T133921Z&X-Amz-Expires=300&X-Amz-SignedHeaders=host&X-Amz-Signature=940c9058b90e8836b03470fdb51af1f24baabc16a7a83b80352d3d618aa4f23f" + } + } + } + } + } + ] + }, + "UploadImageV2": { + "allOf": [ + { + "$ref": "#/components/schemas/UploadImageKey" + }, + { + "type": "object", + "x-go-is-request": true, + "required": [ + "attributes" + ], + "properties": { + "attributes": { + "type": "object", + "required": [ + "selfie_image" + ], + "properties": { + "selfie_image": { + "$ref": "#/components/schemas/ImageData" + }, + "passport_image": { + "$ref": "#/components/schemas/ImageData" + } + } + } + } + } + ] } }, "responses": { diff --git a/openapi.yaml b/openapi.yaml index 9c74b7d..d08b70a 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -163,6 +163,33 @@ paths: $ref: '#/components/schemas/Errors' '500': $ref: '#/components/responses/internalError' + '/integrations/geo-forms-svc/v1/image/{id}': + get: + tags: + - User form + summary: Get market + description: Get single market + parameters: + - $ref: '#/components/parameters/pathID' + - in: query + name: api + required: true + schema: + type: string + example: dc3d2b96-9ff1-4f54-9fb6-005a518089fe + description: Api key for limit access to images + operationId: getImage + responses: + '302': + description: OK + '403': + description: You must provide a valid api key. + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/Errors' + '500': + $ref: '#/components/responses/internalError' '/integrations/geo-forms-svc/v1/status/{id}': get: tags: @@ -225,6 +252,57 @@ paths: $ref: '#/components/responses/notFound' '500': $ref: '#/components/responses/internalError' + /integrations/geo-forms-svc/v2/image: + post: + tags: + - User form + summary: Generate two pre-signed urls + description: | + Generate pre-signed URL for the provided content-length + and content-type for selfie and passport image, with a configurable lifetime. + The response contains a URL with a signature and + other information that should be used to upload image + in S3 Storage. The name is generated on the server side. + 'verified: true' must be specified in the JWT. + The cooldown of this endpoint is the same as in the submit form. + This endpoint creates an empty form that can be submitted on `/form` + operationId: uploadImageV2 + security: + - BearerAuth: [] + requestBody: + content: + application/vnd.api+json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/UploadImageV2' + responses: + '200': + description: Success + content: + application/vnd.api+json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/UploadImageResponseV2' + '400': + $ref: '#/components/responses/invalidParameter' + '401': + $ref: '#/components/responses/invalidAuth' + '429': + description: It is necessary to wait some time before sending the next form + content: + application/vnd.api+json: + schema: + $ref: '#/components/schemas/Errors' + '500': + $ref: '#/components/responses/internalError' components: schemas: Errors: @@ -342,6 +420,12 @@ components: base64 encoded image with max size 4 MB or URL for S3 storage with image up to 4 mb example: 'https://geoforms.nyc3.digitaloceanspaces.com/awesome_phono.jpg' + passport_image: + type: string + description: | + base64 encoded image with max size 4 MB or + URL for S3 storage with image up to 4 mb + example: 'https://geoforms.nyc3.digitaloceanspaces.com/awesome_phono.jpg' created_at: type: integer format: int64 @@ -383,6 +467,21 @@ components: enum: - form - submit_form + ImageData: + type: object + required: + - content_type + - content_length + properties: + content_type: + type: string + example: image/png + description: 'Allowed content-type is `image/png`, `image/jpeg` or `image/x-jp2`' + content_length: + type: integer + format: int64 + example: 150000 + description: Image size. It cannot be more than 4 megabytes. UploadImage: allOf: - $ref: '#/components/schemas/UploadImageKey' @@ -444,6 +543,43 @@ components: type: string enum: - upload_image_response + UploadImageResponseV2: + allOf: + - $ref: '#/components/schemas/UploadImageResponseKey' + - type: object + required: + - attributes + properties: + attributes: + type: object + required: + - selfie_image_url + properties: + selfie_image_url: + type: string + description: Pre-signed URL to upload the file + example: 'https://bucket.nyc3.digitaloceanspaces.com/somefile?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=DO00PTJRCBZELX6E4EEK%2F20240722%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240722T133921Z&X-Amz-Expires=300&X-Amz-SignedHeaders=host&X-Amz-Signature=940c9058b90e8836b03470fdb51af1f24baabc16a7a83b80352d3d618aa4f23f' + passport_image_url: + type: string + description: Pre-signed URL to upload the file + example: 'https://bucket.nyc3.digitaloceanspaces.com/somefile?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=DO00PTJRCBZELX6E4EEK%2F20240722%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240722T133921Z&X-Amz-Expires=300&X-Amz-SignedHeaders=host&X-Amz-Signature=940c9058b90e8836b03470fdb51af1f24baabc16a7a83b80352d3d618aa4f23f' + UploadImageV2: + allOf: + - $ref: '#/components/schemas/UploadImageKey' + - type: object + x-go-is-request: true + required: + - attributes + properties: + attributes: + type: object + required: + - selfie_image + properties: + selfie_image: + $ref: '#/components/schemas/ImageData' + passport_image: + $ref: '#/components/schemas/ImageData' responses: internalError: description: Internal server error