[#32] Add route to form full binary bearer token

Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
Denis Kirillov 2022-08-18 17:35:53 +03:00 committed by Kirillov Denis
parent ada5bf5f9f
commit 07786dd94b
12 changed files with 703 additions and 5 deletions

View file

@ -110,7 +110,7 @@ func init() {
],
"responses": {
"200": {
"description": "Base64 encoded stable binary marshaled bearer token.",
"description": "Base64 encoded stable binary marshaled bearer token bodies.",
"schema": {
"type": "array",
"items": {
@ -149,6 +149,45 @@ func init() {
}
}
},
"/auth/bearer": {
"get": {
"produces": [
"application/json"
],
"summary": "Form binary bearer token",
"operationId": "formBinaryBearer",
"parameters": [
{
"$ref": "#/parameters/signatureParam"
},
{
"$ref": "#/parameters/signatureKeyParam"
},
{
"$ref": "#/parameters/signatureScheme"
}
],
"responses": {
"200": {
"description": "Base64 encoded stable binary marshaled bearer token.",
"schema": {
"$ref": "#/definitions/BinaryBearer"
},
"headers": {
"Access-Control-Allow-Origin": {
"type": "string"
}
}
},
"400": {
"description": "Bad request",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
}
}
}
},
"/containers": {
"get": {
"security": [],
@ -844,6 +883,22 @@ func init() {
}
]
},
"BinaryBearer": {
"description": "Bearer token for object operations that is represented in binary form.",
"type": "object",
"required": [
"token"
],
"properties": {
"token": {
"description": "Base64 encoded bearer token.",
"type": "string"
}
},
"example": {
"token": "ChIKDAoAGggIARABIgIIAxoCCGQSZgohA+J5jFWFMiOpyvMZBu9wwPTKsWsG0q206kVe63iuWP/wEkEE4SIV0QngnKppDf54QezUKmar7UQby6HzufT5yVIOvj7QEqZnOavrKW0chCeCwP0khda/j9k00ct6NMEDxQFW+g=="
}
},
"ContainerInfo": {
"description": "Information about container.",
"type": "object",
@ -1649,7 +1704,7 @@ func init() {
],
"responses": {
"200": {
"description": "Base64 encoded stable binary marshaled bearer token.",
"description": "Base64 encoded stable binary marshaled bearer token bodies.",
"schema": {
"type": "array",
"items": {
@ -1688,6 +1743,57 @@ func init() {
}
}
},
"/auth/bearer": {
"get": {
"produces": [
"application/json"
],
"summary": "Form binary bearer token",
"operationId": "formBinaryBearer",
"parameters": [
{
"type": "string",
"description": "Base64 encoded signature for bearer token.",
"name": "X-Bearer-Signature",
"in": "header",
"required": true
},
{
"type": "string",
"description": "Hex encoded the public part of the key that signed the bearer token.",
"name": "X-Bearer-Signature-Key",
"in": "header",
"required": true
},
{
"type": "boolean",
"default": false,
"description": "Use wallet connect signature scheme or native NeoFS signature.",
"name": "walletConnect",
"in": "query"
}
],
"responses": {
"200": {
"description": "Base64 encoded stable binary marshaled bearer token.",
"schema": {
"$ref": "#/definitions/BinaryBearer"
},
"headers": {
"Access-Control-Allow-Origin": {
"type": "string"
}
}
},
"400": {
"description": "Bad request",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
}
}
}
},
"/containers": {
"get": {
"security": [],
@ -2491,6 +2597,22 @@ func init() {
}
]
},
"BinaryBearer": {
"description": "Bearer token for object operations that is represented in binary form.",
"type": "object",
"required": [
"token"
],
"properties": {
"token": {
"description": "Base64 encoded bearer token.",
"type": "string"
}
},
"example": {
"token": "ChIKDAoAGggIARABIgIIAxoCCGQSZgohA+J5jFWFMiOpyvMZBu9wwPTKsWsG0q206kVe63iuWP/wEkEE4SIV0QngnKppDf54QezUKmar7UQby6HzufT5yVIOvj7QEqZnOavrKW0chCeCwP0khda/j9k00ct6NMEDxQFW+g=="
}
},
"ContainerInfo": {
"description": "Information about container.",
"type": "object",