2022-04-11 09:35:06 +00:00
|
|
|
// Code generated by go-swagger; DO NOT EDIT.
|
|
|
|
|
|
|
|
package restapi
|
|
|
|
|
|
|
|
// This file was generated by the swagger tool.
|
|
|
|
// Editing this file might prove futile when you re-run the swagger generate command
|
|
|
|
|
|
|
|
import (
|
|
|
|
"encoding/json"
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
// SwaggerJSON embedded version of the swagger document used at generation time
|
|
|
|
SwaggerJSON json.RawMessage
|
|
|
|
// FlatSwaggerJSON embedded flattened version of the swagger document used at generation time
|
|
|
|
FlatSwaggerJSON json.RawMessage
|
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
SwaggerJSON = json.RawMessage([]byte(`{
|
|
|
|
"schemes": [
|
|
|
|
"http"
|
|
|
|
],
|
|
|
|
"swagger": "2.0",
|
|
|
|
"info": {
|
|
|
|
"description": "REST API NeoFS",
|
|
|
|
"title": "REST API NeoFS",
|
|
|
|
"version": "v1"
|
|
|
|
},
|
|
|
|
"host": "localhost:8090",
|
|
|
|
"basePath": "/v1",
|
|
|
|
"paths": {
|
|
|
|
"/auth": {
|
|
|
|
"post": {
|
|
|
|
"security": [],
|
|
|
|
"consumes": [
|
|
|
|
"application/json"
|
|
|
|
],
|
|
|
|
"produces": [
|
|
|
|
"application/json"
|
|
|
|
],
|
|
|
|
"summary": "Form bearer token to futher requests",
|
|
|
|
"operationId": "auth",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"enum": [
|
|
|
|
"object",
|
|
|
|
"container"
|
|
|
|
],
|
|
|
|
"type": "string",
|
|
|
|
"description": "Supported operation scope for token",
|
|
|
|
"name": "X-Neofs-Token-Scope",
|
|
|
|
"in": "header",
|
|
|
|
"required": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "string",
|
|
|
|
"description": "Public key of user",
|
|
|
|
"name": "X-Neofs-Token-Signature-Key",
|
|
|
|
"in": "header",
|
|
|
|
"required": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "integer",
|
|
|
|
"default": 100,
|
|
|
|
"description": "Token lifetime in epoch",
|
|
|
|
"name": "X-Neofs-Token-Lifetime",
|
|
|
|
"in": "header"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"description": "Bearer token",
|
|
|
|
"name": "token",
|
|
|
|
"in": "body",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/Bearer"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "Base64 encoded stable binary marshaled bearer token",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/TokenResponse"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"400": {
|
|
|
|
"description": "Bad request",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/Error"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"/containers": {
|
|
|
|
"put": {
|
|
|
|
"summary": "Create new container in NeoFS",
|
|
|
|
"operationId": "putContainer",
|
|
|
|
"parameters": [
|
2022-04-13 08:41:04 +00:00
|
|
|
{
|
|
|
|
"type": "boolean",
|
|
|
|
"default": false,
|
|
|
|
"description": "Provide this parameter to skip registration container name in NNS service",
|
|
|
|
"name": "skip-native-name",
|
|
|
|
"in": "query"
|
|
|
|
},
|
2022-04-11 09:35:06 +00:00
|
|
|
{
|
|
|
|
"description": "Container info",
|
|
|
|
"name": "container",
|
|
|
|
"in": "body",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
|
|
|
"containerName"
|
|
|
|
],
|
|
|
|
"properties": {
|
|
|
|
"basicAcl": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"containerName": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"placementPolicy": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"example": {
|
|
|
|
"basicAcl": "public-read-write",
|
|
|
|
"containerId": "container",
|
|
|
|
"placementPolicy": "REP 3"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "Address of uploaded objects",
|
|
|
|
"schema": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
|
|
|
"containerId"
|
|
|
|
],
|
|
|
|
"properties": {
|
|
|
|
"containerId": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"example": {
|
|
|
|
"containerId": "5HZTn5qkRnmgSz9gSrw22CEdPPk6nQhkwf2Mgzyvkikv"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"400": {
|
|
|
|
"description": "Bad request",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/Error"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"parameters": [
|
|
|
|
{
|
2022-04-11 11:18:26 +00:00
|
|
|
"$ref": "#/parameters/signatureParam"
|
2022-04-11 09:35:06 +00:00
|
|
|
},
|
|
|
|
{
|
2022-04-11 11:18:26 +00:00
|
|
|
"$ref": "#/parameters/signatureKeyParam"
|
2022-04-11 09:35:06 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"/containers/{containerId}": {
|
|
|
|
"get": {
|
|
|
|
"security": [],
|
|
|
|
"summary": "Get container by id",
|
|
|
|
"operationId": "getContainer",
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "Container info",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/ContainerInfo"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"400": {
|
|
|
|
"description": "Bad request",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/Error"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-04-13 08:41:04 +00:00
|
|
|
},
|
|
|
|
"delete": {
|
|
|
|
"summary": "Delete container by id",
|
|
|
|
"operationId": "deleteContainer",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"$ref": "#/parameters/signatureParam"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"$ref": "#/parameters/signatureKeyParam"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"204": {
|
|
|
|
"description": "Successul deletion"
|
|
|
|
},
|
|
|
|
"400": {
|
|
|
|
"description": "Bad request",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/Error"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"type": "string",
|
|
|
|
"description": "Base58 encoded container id",
|
|
|
|
"name": "containerId",
|
|
|
|
"in": "path",
|
|
|
|
"required": true
|
|
|
|
}
|
|
|
|
]
|
2022-04-11 09:35:06 +00:00
|
|
|
},
|
|
|
|
"/objects": {
|
|
|
|
"put": {
|
|
|
|
"consumes": [
|
|
|
|
"application/json"
|
|
|
|
],
|
|
|
|
"produces": [
|
|
|
|
"application/json"
|
|
|
|
],
|
|
|
|
"summary": "Upload object to NeoFS",
|
|
|
|
"operationId": "putObject",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"description": "Object info to upload",
|
|
|
|
"name": "object",
|
|
|
|
"in": "body",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
|
|
|
"containerId",
|
|
|
|
"fileName"
|
|
|
|
],
|
|
|
|
"properties": {
|
|
|
|
"containerId": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"fileName": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"payload": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"example": {
|
|
|
|
"containerId": "5HZTn5qkRnmgSz9gSrw22CEdPPk6nQhkwf2Mgzyvkikv",
|
|
|
|
"fileName": "myFile.txt",
|
|
|
|
"payload": "Y29udGVudCBvZiBmaWxl"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "Address of uploaded objects",
|
|
|
|
"schema": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
|
|
|
"objectId",
|
|
|
|
"containerId"
|
|
|
|
],
|
|
|
|
"properties": {
|
|
|
|
"containerId": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"objectId": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"example": {
|
|
|
|
"containerId": "5HZTn5qkRnmgSz9gSrw22CEdPPk6nQhkwf2Mgzyvkikv",
|
|
|
|
"objectId": "8N3o7Dtr6T1xteCt6eRwhpmJ7JhME58Hyu1dvaswuTDd"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"400": {
|
|
|
|
"description": "Bad request",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/Error"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"parameters": [
|
2022-04-11 11:18:26 +00:00
|
|
|
{
|
|
|
|
"$ref": "#/parameters/signatureParam"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"$ref": "#/parameters/signatureKeyParam"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"/objects/{containerId}/{objectId}": {
|
|
|
|
"get": {
|
|
|
|
"summary": "Get object info by address and",
|
|
|
|
"operationId": "getObjectInfo",
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "Object info",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/ObjectInfo"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"400": {
|
|
|
|
"description": "Bad request",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/Error"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"$ref": "#/parameters/signatureParam"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"$ref": "#/parameters/signatureKeyParam"
|
|
|
|
},
|
2022-04-11 09:35:06 +00:00
|
|
|
{
|
|
|
|
"type": "string",
|
2022-04-11 11:18:26 +00:00
|
|
|
"description": "Base58 encoded container id",
|
|
|
|
"name": "containerId",
|
|
|
|
"in": "path",
|
2022-04-11 09:35:06 +00:00
|
|
|
"required": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "string",
|
2022-04-11 11:18:26 +00:00
|
|
|
"description": "Base58 encoded object id",
|
|
|
|
"name": "objectId",
|
|
|
|
"in": "path",
|
2022-04-11 09:35:06 +00:00
|
|
|
"required": true
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"definitions": {
|
|
|
|
"Action": {
|
|
|
|
"type": "string",
|
|
|
|
"enum": [
|
|
|
|
"ALLOW",
|
|
|
|
"DENY"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"Attribute": {
|
|
|
|
"type": "object",
|
2022-04-11 11:18:26 +00:00
|
|
|
"required": [
|
|
|
|
"key",
|
|
|
|
"value"
|
|
|
|
],
|
2022-04-11 09:35:06 +00:00
|
|
|
"properties": {
|
|
|
|
"key": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"value": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"Bearer": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"container": {
|
|
|
|
"$ref": "#/definitions/Rule"
|
|
|
|
},
|
|
|
|
"object": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/definitions/Record"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"ContainerInfo": {
|
|
|
|
"type": "object",
|
2022-04-11 11:18:26 +00:00
|
|
|
"required": [
|
|
|
|
"containerId",
|
|
|
|
"version",
|
|
|
|
"ownerId",
|
|
|
|
"basicAcl",
|
|
|
|
"placementPolicy",
|
|
|
|
"attributes"
|
|
|
|
],
|
2022-04-11 09:35:06 +00:00
|
|
|
"properties": {
|
|
|
|
"attributes": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/definitions/Attribute"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"basicAcl": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"containerId": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"ownerId": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"placementPolicy": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"version": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"example": {
|
|
|
|
"attribute": [
|
|
|
|
{
|
|
|
|
"key": "Timestamp",
|
|
|
|
"value": "1648810072"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"key": "Name",
|
|
|
|
"value": "container"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"basicAcl": "0x1fbf9fff",
|
|
|
|
"containerId": "5HZTn5qkRnmgSz9gSrw22CEdPPk6nQhkwf2Mgzyvkikv",
|
|
|
|
"ownerId": "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM",
|
|
|
|
"placementPolicy": "REP 2",
|
|
|
|
"version": "2.11"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"Error": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"Filter": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
|
|
|
"headerType",
|
|
|
|
"matchType",
|
|
|
|
"key",
|
|
|
|
"value"
|
|
|
|
],
|
|
|
|
"properties": {
|
|
|
|
"headerType": {
|
|
|
|
"$ref": "#/definitions/HeaderType"
|
|
|
|
},
|
|
|
|
"key": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"matchType": {
|
|
|
|
"$ref": "#/definitions/MatchType"
|
|
|
|
},
|
|
|
|
"value": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"example": {
|
|
|
|
"headerType": "OBJECT",
|
|
|
|
"key": "FileName",
|
|
|
|
"matchType": "STRING_NOT_EQUAL",
|
|
|
|
"value": "myfile"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"HeaderType": {
|
|
|
|
"type": "string",
|
|
|
|
"enum": [
|
|
|
|
"REQUEST",
|
|
|
|
"OBJECT",
|
|
|
|
"SERVICE"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"MatchType": {
|
|
|
|
"type": "string",
|
|
|
|
"enum": [
|
|
|
|
"STRING_EQUAL",
|
|
|
|
"STRING_NOT_EQUAL"
|
|
|
|
]
|
|
|
|
},
|
2022-04-11 11:18:26 +00:00
|
|
|
"ObjectInfo": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
|
|
|
"containerId",
|
|
|
|
"objectId",
|
|
|
|
"ownerId",
|
|
|
|
"attributes"
|
|
|
|
],
|
|
|
|
"properties": {
|
|
|
|
"attributes": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/definitions/Attribute"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"containerId": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"objectId": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"ownerId": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"example": {
|
|
|
|
"attribute": [
|
|
|
|
{
|
|
|
|
"key": "Timestamp",
|
|
|
|
"value": "1648810072"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"key": "Name",
|
|
|
|
"value": "object"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"containerId": "5HZTn5qkRnmgSz9gSrw22CEdPPk6nQhkwf2Mgzyvkikv",
|
|
|
|
"objectId": "8N3o7Dtr6T1xteCt6eRwhpmJ7JhME58Hyu1dvaswuTDd",
|
|
|
|
"ownerId": "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM"
|
|
|
|
}
|
|
|
|
},
|
2022-04-11 09:35:06 +00:00
|
|
|
"Operation": {
|
|
|
|
"type": "string",
|
|
|
|
"enum": [
|
|
|
|
"GET",
|
|
|
|
"HEAD",
|
|
|
|
"PUT",
|
|
|
|
"DELETE",
|
|
|
|
"SEARCH",
|
|
|
|
"RANGE",
|
|
|
|
"RANGEHASH"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"Principal": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"Record": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
|
|
|
"action",
|
|
|
|
"operation",
|
|
|
|
"filters",
|
|
|
|
"targets"
|
|
|
|
],
|
|
|
|
"properties": {
|
|
|
|
"action": {
|
|
|
|
"$ref": "#/definitions/Action"
|
|
|
|
},
|
|
|
|
"filters": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/definitions/Filter"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"operation": {
|
|
|
|
"$ref": "#/definitions/Operation"
|
|
|
|
},
|
|
|
|
"targets": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/definitions/Target"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"example": {
|
|
|
|
"action": "ALLOW",
|
|
|
|
"filters": null,
|
|
|
|
"operation": "GET",
|
|
|
|
"targets": [
|
|
|
|
{
|
|
|
|
"keys": null,
|
|
|
|
"role": "OTHERS"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"Role": {
|
|
|
|
"type": "string",
|
|
|
|
"enum": [
|
|
|
|
"USER",
|
|
|
|
"SYSTEM",
|
|
|
|
"OTHERS"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"Rule": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
|
|
|
"verb"
|
|
|
|
],
|
|
|
|
"properties": {
|
|
|
|
"containerId": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"verb": {
|
|
|
|
"$ref": "#/definitions/Verb"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"Target": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
|
|
|
"role",
|
|
|
|
"keys"
|
|
|
|
],
|
|
|
|
"properties": {
|
|
|
|
"keys": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"role": {
|
|
|
|
"$ref": "#/definitions/Role"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"example": {
|
|
|
|
"keys": [
|
|
|
|
"021dc56fc6d81d581ae7605a8e00e0e0bab6cbad566a924a527339475a97a8e38e"
|
|
|
|
],
|
|
|
|
"role": "USER"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"TokenResponse": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
|
|
|
"type",
|
|
|
|
"token"
|
|
|
|
],
|
|
|
|
"properties": {
|
|
|
|
"token": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"type": {
|
|
|
|
"$ref": "#/definitions/TokenType"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"example": [
|
|
|
|
{
|
|
|
|
"token": "sometoken-todo-add",
|
|
|
|
"type": "object"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"token": "ChCpanIBJCpJuJz42KOmGMSnEhsKGTWquaX2Lq6GhhO4faOYkLD0f9WkXuYJlq4aBAhnGAMiIQJgFcIEghQB5lq3AJZOVswInwc1IGhlQ7NCUh4DFO3UATIECAEQAQ==",
|
|
|
|
"type": "container"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"TokenType": {
|
|
|
|
"type": "string",
|
|
|
|
"enum": [
|
|
|
|
"object",
|
|
|
|
"container"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"Verb": {
|
|
|
|
"type": "string",
|
|
|
|
"enum": [
|
|
|
|
"PUT",
|
|
|
|
"DELETE",
|
|
|
|
"SETEACL"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2022-04-11 11:18:26 +00:00
|
|
|
"parameters": {
|
|
|
|
"signatureKeyParam": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "Hex encoded the public part of the key that signed the bearer token",
|
|
|
|
"name": "X-Neofs-Token-Signature-Key",
|
|
|
|
"in": "header",
|
|
|
|
"required": true
|
|
|
|
},
|
|
|
|
"signatureParam": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "Base64 encoded signature for bearer token",
|
|
|
|
"name": "X-Neofs-Token-Signature",
|
|
|
|
"in": "header",
|
|
|
|
"required": true
|
|
|
|
}
|
|
|
|
},
|
2022-04-11 09:35:06 +00:00
|
|
|
"securityDefinitions": {
|
|
|
|
"BearerAuth": {
|
2022-04-11 11:18:26 +00:00
|
|
|
"description": "Bearer token body to provide with NeoFS request. Must have 'Bearer ' prefix.",
|
2022-04-11 09:35:06 +00:00
|
|
|
"type": "apiKey",
|
|
|
|
"name": "Authorization",
|
|
|
|
"in": "header"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"security": [
|
|
|
|
{
|
|
|
|
"BearerAuth": []
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}`))
|
|
|
|
FlatSwaggerJSON = json.RawMessage([]byte(`{
|
|
|
|
"schemes": [
|
|
|
|
"http"
|
|
|
|
],
|
|
|
|
"swagger": "2.0",
|
|
|
|
"info": {
|
|
|
|
"description": "REST API NeoFS",
|
|
|
|
"title": "REST API NeoFS",
|
|
|
|
"version": "v1"
|
|
|
|
},
|
|
|
|
"host": "localhost:8090",
|
|
|
|
"basePath": "/v1",
|
|
|
|
"paths": {
|
|
|
|
"/auth": {
|
|
|
|
"post": {
|
|
|
|
"security": [],
|
|
|
|
"consumes": [
|
|
|
|
"application/json"
|
|
|
|
],
|
|
|
|
"produces": [
|
|
|
|
"application/json"
|
|
|
|
],
|
|
|
|
"summary": "Form bearer token to futher requests",
|
|
|
|
"operationId": "auth",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"enum": [
|
|
|
|
"object",
|
|
|
|
"container"
|
|
|
|
],
|
|
|
|
"type": "string",
|
|
|
|
"description": "Supported operation scope for token",
|
|
|
|
"name": "X-Neofs-Token-Scope",
|
|
|
|
"in": "header",
|
|
|
|
"required": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "string",
|
|
|
|
"description": "Public key of user",
|
|
|
|
"name": "X-Neofs-Token-Signature-Key",
|
|
|
|
"in": "header",
|
|
|
|
"required": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "integer",
|
|
|
|
"default": 100,
|
|
|
|
"description": "Token lifetime in epoch",
|
|
|
|
"name": "X-Neofs-Token-Lifetime",
|
|
|
|
"in": "header"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"description": "Bearer token",
|
|
|
|
"name": "token",
|
|
|
|
"in": "body",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/Bearer"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "Base64 encoded stable binary marshaled bearer token",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/TokenResponse"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"400": {
|
|
|
|
"description": "Bad request",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/Error"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"/containers": {
|
|
|
|
"put": {
|
|
|
|
"summary": "Create new container in NeoFS",
|
|
|
|
"operationId": "putContainer",
|
|
|
|
"parameters": [
|
2022-04-13 08:41:04 +00:00
|
|
|
{
|
|
|
|
"type": "boolean",
|
|
|
|
"default": false,
|
|
|
|
"description": "Provide this parameter to skip registration container name in NNS service",
|
|
|
|
"name": "skip-native-name",
|
|
|
|
"in": "query"
|
|
|
|
},
|
2022-04-11 09:35:06 +00:00
|
|
|
{
|
|
|
|
"description": "Container info",
|
|
|
|
"name": "container",
|
|
|
|
"in": "body",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
|
|
|
"containerName"
|
|
|
|
],
|
|
|
|
"properties": {
|
|
|
|
"basicAcl": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"containerName": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"placementPolicy": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"example": {
|
|
|
|
"basicAcl": "public-read-write",
|
|
|
|
"containerId": "container",
|
|
|
|
"placementPolicy": "REP 3"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "Address of uploaded objects",
|
|
|
|
"schema": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
|
|
|
"containerId"
|
|
|
|
],
|
|
|
|
"properties": {
|
|
|
|
"containerId": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"example": {
|
|
|
|
"containerId": "5HZTn5qkRnmgSz9gSrw22CEdPPk6nQhkwf2Mgzyvkikv"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"400": {
|
|
|
|
"description": "Bad request",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/Error"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"type": "string",
|
|
|
|
"description": "Base64 encoded signature for bearer token",
|
|
|
|
"name": "X-Neofs-Token-Signature",
|
|
|
|
"in": "header",
|
|
|
|
"required": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "string",
|
|
|
|
"description": "Hex encoded the public part of the key that signed the bearer token",
|
2022-04-11 11:18:26 +00:00
|
|
|
"name": "X-Neofs-Token-Signature-Key",
|
2022-04-11 09:35:06 +00:00
|
|
|
"in": "header",
|
|
|
|
"required": true
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"/containers/{containerId}": {
|
|
|
|
"get": {
|
|
|
|
"security": [],
|
|
|
|
"summary": "Get container by id",
|
|
|
|
"operationId": "getContainer",
|
2022-04-13 08:41:04 +00:00
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "Container info",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/ContainerInfo"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"400": {
|
|
|
|
"description": "Bad request",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/Error"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"delete": {
|
|
|
|
"summary": "Delete container by id",
|
|
|
|
"operationId": "deleteContainer",
|
2022-04-11 09:35:06 +00:00
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"type": "string",
|
2022-04-13 08:41:04 +00:00
|
|
|
"description": "Base64 encoded signature for bearer token",
|
|
|
|
"name": "X-Neofs-Token-Signature",
|
|
|
|
"in": "header",
|
|
|
|
"required": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "string",
|
|
|
|
"description": "Hex encoded the public part of the key that signed the bearer token",
|
|
|
|
"name": "X-Neofs-Token-Signature-Key",
|
|
|
|
"in": "header",
|
2022-04-11 09:35:06 +00:00
|
|
|
"required": true
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
2022-04-13 08:41:04 +00:00
|
|
|
"204": {
|
|
|
|
"description": "Successul deletion"
|
2022-04-11 09:35:06 +00:00
|
|
|
},
|
|
|
|
"400": {
|
|
|
|
"description": "Bad request",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/Error"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-04-13 08:41:04 +00:00
|
|
|
},
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"type": "string",
|
|
|
|
"description": "Base58 encoded container id",
|
|
|
|
"name": "containerId",
|
|
|
|
"in": "path",
|
|
|
|
"required": true
|
|
|
|
}
|
|
|
|
]
|
2022-04-11 09:35:06 +00:00
|
|
|
},
|
|
|
|
"/objects": {
|
|
|
|
"put": {
|
|
|
|
"consumes": [
|
|
|
|
"application/json"
|
|
|
|
],
|
|
|
|
"produces": [
|
|
|
|
"application/json"
|
|
|
|
],
|
|
|
|
"summary": "Upload object to NeoFS",
|
|
|
|
"operationId": "putObject",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"description": "Object info to upload",
|
|
|
|
"name": "object",
|
|
|
|
"in": "body",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
|
|
|
"containerId",
|
|
|
|
"fileName"
|
|
|
|
],
|
|
|
|
"properties": {
|
|
|
|
"containerId": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"fileName": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"payload": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"example": {
|
|
|
|
"containerId": "5HZTn5qkRnmgSz9gSrw22CEdPPk6nQhkwf2Mgzyvkikv",
|
|
|
|
"fileName": "myFile.txt",
|
|
|
|
"payload": "Y29udGVudCBvZiBmaWxl"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "Address of uploaded objects",
|
|
|
|
"schema": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
|
|
|
"objectId",
|
|
|
|
"containerId"
|
|
|
|
],
|
|
|
|
"properties": {
|
|
|
|
"containerId": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"objectId": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"example": {
|
|
|
|
"containerId": "5HZTn5qkRnmgSz9gSrw22CEdPPk6nQhkwf2Mgzyvkikv",
|
|
|
|
"objectId": "8N3o7Dtr6T1xteCt6eRwhpmJ7JhME58Hyu1dvaswuTDd"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"400": {
|
|
|
|
"description": "Bad request",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/Error"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"type": "string",
|
|
|
|
"description": "Base64 encoded signature for bearer token",
|
|
|
|
"name": "X-Neofs-Token-Signature",
|
|
|
|
"in": "header",
|
|
|
|
"required": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "string",
|
|
|
|
"description": "Hex encoded the public part of the key that signed the bearer token",
|
|
|
|
"name": "X-Neofs-Token-Signature-Key",
|
|
|
|
"in": "header",
|
|
|
|
"required": true
|
|
|
|
}
|
|
|
|
]
|
2022-04-11 11:18:26 +00:00
|
|
|
},
|
|
|
|
"/objects/{containerId}/{objectId}": {
|
|
|
|
"get": {
|
|
|
|
"summary": "Get object info by address and",
|
|
|
|
"operationId": "getObjectInfo",
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "Object info",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/ObjectInfo"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"400": {
|
|
|
|
"description": "Bad request",
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/Error"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"type": "string",
|
|
|
|
"description": "Base64 encoded signature for bearer token",
|
|
|
|
"name": "X-Neofs-Token-Signature",
|
|
|
|
"in": "header",
|
|
|
|
"required": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "string",
|
|
|
|
"description": "Hex encoded the public part of the key that signed the bearer token",
|
|
|
|
"name": "X-Neofs-Token-Signature-Key",
|
|
|
|
"in": "header",
|
|
|
|
"required": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "string",
|
|
|
|
"description": "Base58 encoded container id",
|
|
|
|
"name": "containerId",
|
|
|
|
"in": "path",
|
|
|
|
"required": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "string",
|
|
|
|
"description": "Base58 encoded object id",
|
|
|
|
"name": "objectId",
|
|
|
|
"in": "path",
|
|
|
|
"required": true
|
|
|
|
}
|
|
|
|
]
|
2022-04-11 09:35:06 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"definitions": {
|
|
|
|
"Action": {
|
|
|
|
"type": "string",
|
|
|
|
"enum": [
|
|
|
|
"ALLOW",
|
|
|
|
"DENY"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"Attribute": {
|
|
|
|
"type": "object",
|
2022-04-11 11:18:26 +00:00
|
|
|
"required": [
|
|
|
|
"key",
|
|
|
|
"value"
|
|
|
|
],
|
2022-04-11 09:35:06 +00:00
|
|
|
"properties": {
|
|
|
|
"key": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"value": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"Bearer": {
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"container": {
|
|
|
|
"$ref": "#/definitions/Rule"
|
|
|
|
},
|
|
|
|
"object": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/definitions/Record"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"ContainerInfo": {
|
|
|
|
"type": "object",
|
2022-04-11 11:18:26 +00:00
|
|
|
"required": [
|
|
|
|
"containerId",
|
|
|
|
"version",
|
|
|
|
"ownerId",
|
|
|
|
"basicAcl",
|
|
|
|
"placementPolicy",
|
|
|
|
"attributes"
|
|
|
|
],
|
2022-04-11 09:35:06 +00:00
|
|
|
"properties": {
|
|
|
|
"attributes": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/definitions/Attribute"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"basicAcl": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"containerId": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"ownerId": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"placementPolicy": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"version": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"example": {
|
|
|
|
"attribute": [
|
|
|
|
{
|
|
|
|
"key": "Timestamp",
|
|
|
|
"value": "1648810072"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"key": "Name",
|
|
|
|
"value": "container"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"basicAcl": "0x1fbf9fff",
|
|
|
|
"containerId": "5HZTn5qkRnmgSz9gSrw22CEdPPk6nQhkwf2Mgzyvkikv",
|
|
|
|
"ownerId": "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM",
|
|
|
|
"placementPolicy": "REP 2",
|
|
|
|
"version": "2.11"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"Error": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"Filter": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
|
|
|
"headerType",
|
|
|
|
"matchType",
|
|
|
|
"key",
|
|
|
|
"value"
|
|
|
|
],
|
|
|
|
"properties": {
|
|
|
|
"headerType": {
|
|
|
|
"$ref": "#/definitions/HeaderType"
|
|
|
|
},
|
|
|
|
"key": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"matchType": {
|
|
|
|
"$ref": "#/definitions/MatchType"
|
|
|
|
},
|
|
|
|
"value": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"example": {
|
|
|
|
"headerType": "OBJECT",
|
|
|
|
"key": "FileName",
|
|
|
|
"matchType": "STRING_NOT_EQUAL",
|
|
|
|
"value": "myfile"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"HeaderType": {
|
|
|
|
"type": "string",
|
|
|
|
"enum": [
|
|
|
|
"REQUEST",
|
|
|
|
"OBJECT",
|
|
|
|
"SERVICE"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"MatchType": {
|
|
|
|
"type": "string",
|
|
|
|
"enum": [
|
|
|
|
"STRING_EQUAL",
|
|
|
|
"STRING_NOT_EQUAL"
|
|
|
|
]
|
|
|
|
},
|
2022-04-11 11:18:26 +00:00
|
|
|
"ObjectInfo": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
|
|
|
"containerId",
|
|
|
|
"objectId",
|
|
|
|
"ownerId",
|
|
|
|
"attributes"
|
|
|
|
],
|
|
|
|
"properties": {
|
|
|
|
"attributes": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/definitions/Attribute"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"containerId": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"objectId": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"ownerId": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"example": {
|
|
|
|
"attribute": [
|
|
|
|
{
|
|
|
|
"key": "Timestamp",
|
|
|
|
"value": "1648810072"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"key": "Name",
|
|
|
|
"value": "object"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"containerId": "5HZTn5qkRnmgSz9gSrw22CEdPPk6nQhkwf2Mgzyvkikv",
|
|
|
|
"objectId": "8N3o7Dtr6T1xteCt6eRwhpmJ7JhME58Hyu1dvaswuTDd",
|
|
|
|
"ownerId": "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM"
|
|
|
|
}
|
|
|
|
},
|
2022-04-11 09:35:06 +00:00
|
|
|
"Operation": {
|
|
|
|
"type": "string",
|
|
|
|
"enum": [
|
|
|
|
"GET",
|
|
|
|
"HEAD",
|
|
|
|
"PUT",
|
|
|
|
"DELETE",
|
|
|
|
"SEARCH",
|
|
|
|
"RANGE",
|
|
|
|
"RANGEHASH"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"Principal": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"Record": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
|
|
|
"action",
|
|
|
|
"operation",
|
|
|
|
"filters",
|
|
|
|
"targets"
|
|
|
|
],
|
|
|
|
"properties": {
|
|
|
|
"action": {
|
|
|
|
"$ref": "#/definitions/Action"
|
|
|
|
},
|
|
|
|
"filters": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/definitions/Filter"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"operation": {
|
|
|
|
"$ref": "#/definitions/Operation"
|
|
|
|
},
|
|
|
|
"targets": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "#/definitions/Target"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"example": {
|
|
|
|
"action": "ALLOW",
|
|
|
|
"filters": [],
|
|
|
|
"operation": "GET",
|
|
|
|
"targets": [
|
|
|
|
{
|
|
|
|
"keys": [],
|
|
|
|
"role": "OTHERS"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"Role": {
|
|
|
|
"type": "string",
|
|
|
|
"enum": [
|
|
|
|
"USER",
|
|
|
|
"SYSTEM",
|
|
|
|
"OTHERS"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"Rule": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
|
|
|
"verb"
|
|
|
|
],
|
|
|
|
"properties": {
|
|
|
|
"containerId": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"verb": {
|
|
|
|
"$ref": "#/definitions/Verb"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"Target": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
|
|
|
"role",
|
|
|
|
"keys"
|
|
|
|
],
|
|
|
|
"properties": {
|
|
|
|
"keys": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"role": {
|
|
|
|
"$ref": "#/definitions/Role"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"example": {
|
|
|
|
"keys": [
|
|
|
|
"021dc56fc6d81d581ae7605a8e00e0e0bab6cbad566a924a527339475a97a8e38e"
|
|
|
|
],
|
|
|
|
"role": "USER"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"TokenResponse": {
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
|
|
|
"type",
|
|
|
|
"token"
|
|
|
|
],
|
|
|
|
"properties": {
|
|
|
|
"token": {
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"type": {
|
|
|
|
"$ref": "#/definitions/TokenType"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"example": [
|
|
|
|
{
|
|
|
|
"token": "sometoken-todo-add",
|
|
|
|
"type": "object"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"token": "ChCpanIBJCpJuJz42KOmGMSnEhsKGTWquaX2Lq6GhhO4faOYkLD0f9WkXuYJlq4aBAhnGAMiIQJgFcIEghQB5lq3AJZOVswInwc1IGhlQ7NCUh4DFO3UATIECAEQAQ==",
|
|
|
|
"type": "container"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"TokenType": {
|
|
|
|
"type": "string",
|
|
|
|
"enum": [
|
|
|
|
"object",
|
|
|
|
"container"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"Verb": {
|
|
|
|
"type": "string",
|
|
|
|
"enum": [
|
|
|
|
"PUT",
|
|
|
|
"DELETE",
|
|
|
|
"SETEACL"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2022-04-11 11:18:26 +00:00
|
|
|
"parameters": {
|
|
|
|
"signatureKeyParam": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "Hex encoded the public part of the key that signed the bearer token",
|
|
|
|
"name": "X-Neofs-Token-Signature-Key",
|
|
|
|
"in": "header",
|
|
|
|
"required": true
|
|
|
|
},
|
|
|
|
"signatureParam": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "Base64 encoded signature for bearer token",
|
|
|
|
"name": "X-Neofs-Token-Signature",
|
|
|
|
"in": "header",
|
|
|
|
"required": true
|
|
|
|
}
|
|
|
|
},
|
2022-04-11 09:35:06 +00:00
|
|
|
"securityDefinitions": {
|
|
|
|
"BearerAuth": {
|
2022-04-11 11:18:26 +00:00
|
|
|
"description": "Bearer token body to provide with NeoFS request. Must have 'Bearer ' prefix.",
|
2022-04-11 09:35:06 +00:00
|
|
|
"type": "apiKey",
|
|
|
|
"name": "Authorization",
|
|
|
|
"in": "header"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"security": [
|
|
|
|
{
|
|
|
|
"BearerAuth": []
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}`))
|
|
|
|
}
|