// 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 for native integration with NeoFS.", "title": "REST API NeoFS", "version": "v1" }, "host": "localhost:8090", "basePath": "/v1", "paths": { "/accounting/balance/{address}": { "get": { "security": [], "description": "Getting balance of provided wallet address in NeoFS.", "produces": [ "application/json" ], "summary": "Get balance in NeoFS", "operationId": "getBalance", "parameters": [ { "type": "string", "description": "Base58 encoded wallet address.", "name": "address", "in": "path", "required": true } ], "responses": { "200": { "description": "Balance of address in NeoFS", "schema": { "$ref": "#/definitions/Balance" }, "headers": { "Access-Control-Allow-Origin": { "type": "string" } } }, "400": { "description": "Bad request", "schema": { "$ref": "#/definitions/ErrorResponse" } } } } }, "/auth": { "post": { "security": [], "consumes": [ "application/json" ], "produces": [ "application/json" ], "summary": "Form bearer token to further requests", "operationId": "auth", "parameters": [ { "type": "string", "description": "Owner Id (wallet address) that will sign the token.", "name": "X-Bearer-Owner-Id", "in": "header", "required": true }, { "type": "integer", "default": 100, "description": "Token lifetime in epoch.", "name": "X-Bearer-Lifetime", "in": "header" }, { "description": "Bearer tokens to form.", "name": "tokens", "in": "body", "required": true, "schema": { "type": "array", "items": { "$ref": "#/definitions/Bearer" } } } ], "responses": { "200": { "description": "Base64 encoded stable binary marshaled bearer token.", "schema": { "type": "array", "items": { "$ref": "#/definitions/TokenResponse" } }, "headers": { "Access-Control-Allow-Origin": { "type": "string" } } }, "400": { "description": "Bad request", "schema": { "$ref": "#/definitions/ErrorResponse" } } } }, "options": { "security": [], "operationId": "optionsAuth", "responses": { "200": { "description": "CORS", "headers": { "Access-Control-Allow-Headers": { "type": "string" }, "Access-Control-Allow-Origin": { "type": "string" } } } } } }, "/containers": { "get": { "security": [], "summary": "Get list of containers", "operationId": "listContainers", "parameters": [ { "type": "string", "description": "Base58 encoded owner id.", "name": "ownerId", "in": "query", "required": true }, { "type": "integer", "default": 0, "description": "The number of containers to skip before starting to collect the result set.", "name": "offset", "in": "query" }, { "maximum": 10000, "minimum": 1, "type": "integer", "default": 100, "description": "The numbers of containers to return.", "name": "limit", "in": "query" } ], "responses": { "200": { "description": "Containers info.", "schema": { "$ref": "#/definitions/ContainerList" }, "headers": { "Access-Control-Allow-Origin": { "type": "string" } } }, "400": { "description": "Bad request.", "schema": { "$ref": "#/definitions/ErrorResponse" } } } }, "put": { "summary": "Create new container in NeoFS", "operationId": "putContainer", "parameters": [ { "$ref": "#/parameters/signatureParam" }, { "$ref": "#/parameters/signatureKeyParam" }, { "$ref": "#/parameters/signatureScheme" }, { "type": "boolean", "default": false, "description": "Provide this parameter to register container name in NNS service.", "name": "name-scope-global", "in": "query" }, { "description": "Container info", "name": "container", "in": "body", "required": true, "schema": { "$ref": "#/definitions/ContainerPutInfo" } } ], "responses": { "200": { "description": "Identifier of the created container.", "schema": { "type": "object", "required": [ "containerId" ], "properties": { "containerId": { "type": "string" } }, "example": { "containerId": "5HZTn5qkRnmgSz9gSrw22CEdPPk6nQhkwf2Mgzyvkikv" } }, "headers": { "Access-Control-Allow-Origin": { "type": "string" } } }, "400": { "description": "Bad request.", "schema": { "$ref": "#/definitions/ErrorResponse" } } } }, "options": { "security": [], "operationId": "optionsContainersPutList", "responses": { "200": { "description": "CORS", "headers": { "Access-Control-Allow-Headers": { "type": "string" }, "Access-Control-Allow-Methods": { "type": "string" }, "Access-Control-Allow-Origin": { "type": "string" } } } } } }, "/containers/{containerId}": { "get": { "security": [], "summary": "Get container by id", "operationId": "getContainer", "responses": { "200": { "description": "Container info.", "schema": { "$ref": "#/definitions/ContainerInfo" }, "headers": { "Access-Control-Allow-Origin": { "type": "string" } } }, "400": { "description": "Bad request.", "schema": { "$ref": "#/definitions/ErrorResponse" } } } }, "delete": { "summary": "Delete container by id", "operationId": "deleteContainer", "parameters": [ { "$ref": "#/parameters/signatureParam" }, { "$ref": "#/parameters/signatureKeyParam" }, { "$ref": "#/parameters/signatureScheme" } ], "responses": { "200": { "description": "Successful deletion.", "schema": { "$ref": "#/definitions/SuccessResponse" }, "headers": { "Access-Control-Allow-Origin": { "type": "string" } } }, "400": { "description": "Bad request.", "schema": { "$ref": "#/definitions/ErrorResponse" } } } }, "options": { "security": [], "operationId": "optionsContainersGetDelete", "responses": { "200": { "description": "CORS", "headers": { "Access-Control-Allow-Headers": { "type": "string" }, "Access-Control-Allow-Methods": { "type": "string" }, "Access-Control-Allow-Origin": { "type": "string" } } } } }, "parameters": [ { "$ref": "#/parameters/containerId" } ] }, "/containers/{containerId}/eacl": { "get": { "security": [], "summary": "Get container EACL by id", "operationId": "getContainerEACL", "responses": { "200": { "description": "Container EACL information.", "schema": { "$ref": "#/definitions/Eacl" }, "headers": { "Access-Control-Allow-Origin": { "type": "string" } } }, "400": { "description": "Bad request.", "schema": { "$ref": "#/definitions/ErrorResponse" } } } }, "put": { "summary": "Set container EACL by id", "operationId": "putContainerEACL", "parameters": [ { "$ref": "#/parameters/signatureParam" }, { "$ref": "#/parameters/signatureKeyParam" }, { "$ref": "#/parameters/signatureScheme" }, { "description": "EACL for container.", "name": "eacl", "in": "body", "required": true, "schema": { "$ref": "#/definitions/Eacl" } } ], "responses": { "200": { "description": "Successful EACL updating.", "schema": { "$ref": "#/definitions/SuccessResponse" }, "headers": { "Access-Control-Allow-Origin": { "type": "string" } } }, "400": { "description": "Bad request.", "schema": { "$ref": "#/definitions/ErrorResponse" } } } }, "options": { "security": [], "operationId": "optionsContainersEACL", "responses": { "200": { "description": "CORS", "headers": { "Access-Control-Allow-Headers": { "type": "string" }, "Access-Control-Allow-Methods": { "type": "string" }, "Access-Control-Allow-Origin": { "type": "string" } } } } }, "parameters": [ { "$ref": "#/parameters/containerId" } ] }, "/objects": { "put": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "summary": "Upload object to NeoFS", "operationId": "putObject", "parameters": [ { "$ref": "#/parameters/signatureParam" }, { "$ref": "#/parameters/signatureKeyParam" }, { "$ref": "#/parameters/signatureScheme" }, { "description": "Object info to upload", "name": "object", "in": "body", "required": true, "schema": { "$ref": "#/definitions/ObjectUpload" } } ], "responses": { "200": { "description": "Address of uploaded objects", "schema": { "$ref": "#/definitions/Address" }, "headers": { "Access-Control-Allow-Origin": { "type": "string" } } }, "400": { "description": "Bad request", "schema": { "$ref": "#/definitions/ErrorResponse" } } } }, "options": { "security": [], "operationId": "optionsObjectsPut", "responses": { "200": { "description": "CORS", "headers": { "Access-Control-Allow-Headers": { "type": "string" }, "Access-Control-Allow-Methods": { "type": "string" }, "Access-Control-Allow-Origin": { "type": "string" } } } } } }, "/objects/{containerId}/search": { "post": { "summary": "Search objects by filters", "operationId": "searchObjects", "parameters": [ { "$ref": "#/parameters/signatureParam" }, { "$ref": "#/parameters/signatureKeyParam" }, { "$ref": "#/parameters/signatureScheme" }, { "type": "integer", "default": 0, "description": "The number of containers to skip before starting to collect the result set.", "name": "offset", "in": "query" }, { "maximum": 10000, "minimum": 1, "type": "integer", "default": 100, "description": "The numbers of containers to return.", "name": "limit", "in": "query" }, { "description": "Filters to search objects.", "name": "searchFilters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/SearchFilters" } } ], "responses": { "200": { "description": "List of objects", "schema": { "$ref": "#/definitions/ObjectList" }, "headers": { "Access-Control-Allow-Origin": { "type": "string" } } }, "400": { "description": "Bad request", "schema": { "$ref": "#/definitions/ErrorResponse" } } } }, "options": { "security": [], "operationId": "optionsObjectsSearch", "responses": { "200": { "description": "Base64 encoded stable binary marshaled bearer token.", "headers": { "Access-Control-Allow-Headers": { "type": "string" }, "Access-Control-Allow-Origin": { "type": "string" } } } } }, "parameters": [ { "$ref": "#/parameters/containerId" } ] }, "/objects/{containerId}/{objectId}": { "get": { "summary": "Get object info by address", "operationId": "getObjectInfo", "parameters": [ { "$ref": "#/parameters/signatureParam" }, { "$ref": "#/parameters/signatureKeyParam" }, { "$ref": "#/parameters/signatureScheme" }, { "type": "integer", "description": "Range offset to start reading data.", "name": "range-offset", "in": "query" }, { "minimum": 1, "type": "integer", "description": "Length of data range.", "name": "range-length", "in": "query" }, { "maximum": 524288000, "type": "integer", "default": 4194304, "description": "Max payload size (in bytes) that can be included in the response.\nIf the actual size is greater than this params the payload won't be included in the response.\n", "name": "max-payload-size", "in": "query" } ], "responses": { "200": { "description": "Object info", "schema": { "$ref": "#/definitions/ObjectInfo" }, "headers": { "Access-Control-Allow-Origin": { "type": "string" } } }, "400": { "description": "Bad request", "schema": { "$ref": "#/definitions/ErrorResponse" } } } }, "delete": { "summary": "Remove object from NeoFS", "operationId": "deleteObject", "parameters": [ { "$ref": "#/parameters/signatureParam" }, { "$ref": "#/parameters/signatureKeyParam" }, { "$ref": "#/parameters/signatureScheme" } ], "responses": { "200": { "description": "Successful deletion.", "schema": { "$ref": "#/definitions/SuccessResponse" }, "headers": { "Access-Control-Allow-Origin": { "type": "string" } } }, "400": { "description": "Bad request.", "schema": { "$ref": "#/definitions/ErrorResponse" } } } }, "options": { "security": [], "operationId": "optionsObjectsGetDelete", "responses": { "200": { "description": "CORS", "headers": { "Access-Control-Allow-Headers": { "type": "string" }, "Access-Control-Allow-Methods": { "type": "string" }, "Access-Control-Allow-Origin": { "type": "string" } } } } }, "parameters": [ { "$ref": "#/parameters/containerId" }, { "$ref": "#/parameters/objectId" } ] } }, "definitions": { "Action": { "description": "Rule execution result action in NeoFS EACL. Either allows or denies access if the rule's filters match.", "type": "string", "enum": [ "ALLOW", "DENY" ] }, "Address": { "description": "Address of the object in NeoFS.", "type": "object", "required": [ "containerId", "objectId" ], "properties": { "containerId": { "type": "string" }, "objectId": { "type": "string" } }, "example": { "containerId": "5HZTn5qkRnmgSz9gSrw22CEdPPk6nQhkwf2Mgzyvkikv", "objectId": "8N3o7Dtr6T1xteCt6eRwhpmJ7JhME58Hyu1dvaswuTDd" } }, "Attribute": { "description": "Attribute is a pair of strings that can be attached to a container or an object.", "type": "object", "required": [ "key", "value" ], "properties": { "key": { "type": "string" }, "value": { "type": "string" } }, "example": { "key": "User-Defined-Tag", "value": "tag value" } }, "Balance": { "type": "object", "required": [ "address", "value", "precision" ], "properties": { "address": { "type": "string" }, "precision": { "type": "integer" }, "value": { "type": "string" } } }, "Bearer": { "description": "Bearer token that is expected to be formed.", "type": "object", "properties": { "container": { "$ref": "#/definitions/Rule" }, "name": { "type": "string" }, "object": { "type": "array", "items": { "$ref": "#/definitions/Record" } } }, "example": [ { "name": "my-bearer-token", "object": [ { "action": "ALLOW", "filters": null, "operation": "GET", "targets": [ { "keys": null, "role": "OTHERS" } ] } ] }, { "container": { "verb": "PUT" }, "name": "my token to create container" } ] }, "ContainerInfo": { "description": "Information about container.", "type": "object", "required": [ "containerId", "containerName", "version", "ownerId", "basicAcl", "placementPolicy", "attributes" ], "properties": { "attributes": { "type": "array", "items": { "$ref": "#/definitions/Attribute" } }, "basicAcl": { "type": "string" }, "cannedAcl": { "description": "The friendly name for the basicAcl field.", "type": "string" }, "containerId": { "type": "string" }, "containerName": { "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", "containerName": "container", "ownerId": "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM", "placementPolicy": "REP 2", "version": "2.11" } }, "ContainerList": { "description": "List of containers info", "type": "object", "required": [ "size", "containers" ], "properties": { "containers": { "type": "array", "items": { "$ref": "#/definitions/ContainerInfo" } }, "size": { "type": "integer" } }, "example": { "containers": [ { "attribute": [ { "key": "Timestamp", "value": "1648810072" }, { "key": "Name", "value": "container" } ], "basicAcl": "0x1fbf9fff", "containerId": "5HZTn5qkRnmgSz9gSrw22CEdPPk6nQhkwf2Mgzyvkikv", "containerName": "container", "ownerId": "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM", "placementPolicy": "REP 2", "version": "2.11" }, { "attribute": [ { "key": "Name", "value": "container2" } ], "basicAcl": "0x1fbf9fff", "containerId": "FsE7HLQBBYc2WFJzuTXMcpspDEmwUxsD5YmNb2r25uUu", "containerName": "container2", "ownerId": "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM", "placementPolicy": "REP 1", "version": "2.11" } ], "size": 2 } }, "ContainerPutInfo": { "description": "Request body to create container. To specify container name use appropriate property (name provided in attributes will be ignored).", "type": "object", "properties": { "attributes": { "type": "array", "items": { "$ref": "#/definitions/Attribute" } }, "basicAcl": { "type": "string" }, "containerName": { "type": "string" }, "placementPolicy": { "type": "string" } }, "example": { "attributes": [ { "key": "Custom-Attribute", "value": "value" } ], "basicAcl": "public-read-write", "containerName": "container", "placementPolicy": "REP 3" } }, "Eacl": { "description": "EACL NeoFS table.", "type": "object", "required": [ "records" ], "properties": { "containerId": { "type": "string", "readOnly": true }, "records": { "type": "array", "items": { "$ref": "#/definitions/Record" } } }, "example": { "containerId": "5HZTn5qkRnmgSz9gSrw22CEdPPk6nQhkwf2Mgzyvkikv", "records": [ { "action": "GET", "filters": [ { "headerType": "OBJECT", "key": "FileName", "matchType": "STRING_EQUAL", "value": "myfile" } ], "operation": "ALLOW", "targets": [ { "role": "OTHERS" } ] } ] } }, "ErrorResponse": { "description": "Error response.", "type": "object", "required": [ "type", "message" ], "properties": { "code": { "type": "integer" }, "message": { "type": "string" }, "type": { "$ref": "#/definitions/ErrorType" } }, "example": { "code": 1024, "message": "incomplete object PUT by placement", "type": "API" } }, "ErrorType": { "description": "Error type. Allow determine source of the error.", "type": "string", "enum": [ "GW", "API" ] }, "Filter": { "description": "Filter in NeoFS EACL to check particular properties of the request or the object.", "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": { "description": "Enumeration of possible sources of Headers to apply filters in NeoFS EACL.", "type": "string", "enum": [ "REQUEST", "OBJECT", "SERVICE" ] }, "MatchType": { "description": "Match type in NeoFS EACL filter.", "type": "string", "enum": [ "STRING_EQUAL", "STRING_NOT_EQUAL" ] }, "ObjectBaseInfo": { "description": "Basic object information.", "type": "object", "required": [ "address" ], "properties": { "address": { "$ref": "#/definitions/Address" }, "filePath": { "type": "string" }, "name": { "type": "string" } }, "example": { "address": { "containerId": "5HZTn5qkRnmgSz9gSrw22CEdPPk6nQhkwf2Mgzyvkikv", "objectId": "8N3o7Dtr6T1xteCt6eRwhpmJ7JhME58Hyu1dvaswuTDd" }, "filePath": "/my/object/name.txt", "name": "name.txt" } }, "ObjectInfo": { "description": "Object information.", "type": "object", "required": [ "containerId", "objectId", "ownerId", "attributes", "objectSize", "payloadSize" ], "properties": { "attributes": { "type": "array", "items": { "$ref": "#/definitions/Attribute" } }, "containerId": { "type": "string" }, "objectId": { "type": "string" }, "objectSize": { "description": "Object full payload size", "type": "integer" }, "ownerId": { "type": "string" }, "payload": { "description": "Base64 encoded object payload", "type": "string" }, "payloadSize": { "description": "Payload size in response", "type": "integer" } }, "example": { "attribute": [ { "key": "Timestamp", "value": "1648810072" }, { "key": "Name", "value": "object" } ], "containerId": "5HZTn5qkRnmgSz9gSrw22CEdPPk6nQhkwf2Mgzyvkikv", "objectId": "8N3o7Dtr6T1xteCt6eRwhpmJ7JhME58Hyu1dvaswuTDd", "ownerId": "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM" } }, "ObjectList": { "description": "List of objects.", "type": "object", "required": [ "size", "objects" ], "properties": { "objects": { "type": "array", "items": { "$ref": "#/definitions/ObjectBaseInfo" } }, "size": { "type": "integer" } }, "example": { "objects": [ { "address": { "containerId": "5HZTn5qkRnmgSz9gSrw22CEdPPk6nQhkwf2Mgzyvkikv", "objectId": "8N3o7Dtr6T1xteCt6eRwhpmJ7JhME58Hyu1dvaswuTDd" }, "name": "/my/object/name" }, { "address": { "containerId": "5HZTn5qkRnmgSz9gSrw22CEdPPk6nQhkwf2Mgzyvkikv", "objectId": "3GbmMWusaWgMHokWui2zDunxMTzButuQMVLbtL3cDn8s" }, "name": "/my/object/some/other/name" } ], "size": 2 } }, "ObjectUpload": { "description": "Request body to create object.", "type": "object", "required": [ "containerId", "fileName" ], "properties": { "attributes": { "type": "array", "items": { "$ref": "#/definitions/Attribute" } }, "containerId": { "type": "string" }, "fileName": { "type": "string" }, "payload": { "type": "string" } }, "example": { "attributes": [ { "key": "User-Attribute", "value": "some-value" } ], "containerId": "5HZTn5qkRnmgSz9gSrw22CEdPPk6nQhkwf2Mgzyvkikv", "fileName": "myFile.txt", "payload": "Y29udGVudCBvZiBmaWxl" } }, "Operation": { "description": "Request's operation type to match in NeoFS EACL if the rule is applicable to a particular request.", "type": "string", "enum": [ "GET", "HEAD", "PUT", "DELETE", "SEARCH", "RANGE", "RANGEHASH" ] }, "Principal": { "type": "string" }, "Record": { "description": "A single NeoFS EACL rule.", "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": { "description": "Role for target in EACL.", "type": "string", "enum": [ "USER", "SYSTEM", "OTHERS" ] }, "Rule": { "description": "Container session token rule.", "type": "object", "required": [ "verb" ], "properties": { "containerId": { "type": "string" }, "verb": { "$ref": "#/definitions/Verb" } }, "example": { "containerId": "6jvKJCQr6e47Yx8SsbSN3fNgzroUJVkY66Q9wqxYcAjc", "verb": "DELETE" } }, "SearchFilter": { "description": "Search filter to find objects.", "type": "object", "required": [ "key", "value", "match" ], "properties": { "key": { "type": "string" }, "match": { "$ref": "#/definitions/SearchMatch" }, "value": { "type": "string" } }, "example": { "key": "FileName", "match": "MatchStringEqual", "value": "object-name" } }, "SearchFilters": { "description": "List of SearchFilter elements.", "type": "object", "required": [ "filters" ], "properties": { "filters": { "type": "array", "items": { "$ref": "#/definitions/SearchFilter" } } }, "example": { "filters": [ { "key": "FileName", "match": "MatchCommonPrefix", "value": "some/prefix" }, { "key": "CustomAttribute", "match": "MatchStringEqual", "value": "tag-value" } ] } }, "SearchMatch": { "description": "Search match type.", "type": "string", "enum": [ "MatchStringEqual", "MatchStringNotEqual", "MatchNotPresent", "MatchCommonPrefix" ] }, "SuccessResponse": { "description": "Success response.", "type": "object", "required": [ "success" ], "properties": { "success": { "type": "boolean" } }, "example": { "success": true } }, "Target": { "description": "Target to apply the ACL rule. Can be a subject's role class or a list of public keys to match.", "type": "object", "required": [ "role", "keys" ], "properties": { "keys": { "type": "array", "items": { "type": "string" } }, "role": { "$ref": "#/definitions/Role" } }, "example": { "keys": [ "021dc56fc6d81d581ae7605a8e00e0e0bab6cbad566a924a527339475a97a8e38e" ], "role": "USER" } }, "TokenResponse": { "description": "Base64 encoded marshaled token (for container or for object operations).", "type": "object", "required": [ "type", "token" ], "properties": { "name": { "type": "string" }, "token": { "type": "string" }, "type": { "$ref": "#/definitions/TokenType" } }, "example": [ { "token": "ClYKBAgCEA0aCAgDEAEiAggDGggIARACIgIIAxoICAIQAiICCAMaCAgDEAIiAggDGggIBBACIgIIAxoICAUQAiICCAMaCAgGEAIiAggDGggIBxACIgIIAxIbChk182WEDFuAqq3nssrGOaH0NK0ZhzF8bu+YGgQIaBgE", "type": "object" }, { "token": "ChCpanIBJCpJuJz42KOmGMSnEhsKGTWquaX2Lq6GhhO4faOYkLD0f9WkXuYJlq4aBAhnGAMiIQJgFcIEghQB5lq3AJZOVswInwc1IGhlQ7NCUh4DFO3UATIECAEQAQ==", "type": "container" } ] }, "TokenType": { "description": "Type of token.", "type": "string", "enum": [ "object", "container" ] }, "Verb": { "description": "Verb that describes the allowed container operation for token.", "type": "string", "enum": [ "PUT", "DELETE", "SETEACL" ] } }, "parameters": { "containerId": { "type": "string", "description": "Base58 encoded container id.", "name": "containerId", "in": "path", "required": true }, "objectId": { "type": "string", "description": "Base58 encoded object id.", "name": "objectId", "in": "path", "required": true }, "signatureKeyParam": { "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 }, "signatureParam": { "type": "string", "description": "Base64 encoded signature for bearer token.", "name": "X-Bearer-Signature", "in": "header", "required": true }, "signatureScheme": { "type": "boolean", "default": false, "description": "Use wallet connect signature scheme or native NeoFS signature.", "name": "walletConnect", "in": "query" } }, "securityDefinitions": { "BearerAuth": { "description": "Bearer token body to provide with NeoFS request. Must have 'Bearer ' prefix.", "type": "apiKey", "name": "Authorization", "in": "header" } }, "security": [ { "BearerAuth": [] } ] }`)) FlatSwaggerJSON = json.RawMessage([]byte(`{ "schemes": [ "http" ], "swagger": "2.0", "info": { "description": "REST API for native integration with NeoFS.", "title": "REST API NeoFS", "version": "v1" }, "host": "localhost:8090", "basePath": "/v1", "paths": { "/accounting/balance/{address}": { "get": { "security": [], "description": "Getting balance of provided wallet address in NeoFS.", "produces": [ "application/json" ], "summary": "Get balance in NeoFS", "operationId": "getBalance", "parameters": [ { "type": "string", "description": "Base58 encoded wallet address.", "name": "address", "in": "path", "required": true } ], "responses": { "200": { "description": "Balance of address in NeoFS", "schema": { "$ref": "#/definitions/Balance" }, "headers": { "Access-Control-Allow-Origin": { "type": "string" } } }, "400": { "description": "Bad request", "schema": { "$ref": "#/definitions/ErrorResponse" } } } } }, "/auth": { "post": { "security": [], "consumes": [ "application/json" ], "produces": [ "application/json" ], "summary": "Form bearer token to further requests", "operationId": "auth", "parameters": [ { "type": "string", "description": "Owner Id (wallet address) that will sign the token.", "name": "X-Bearer-Owner-Id", "in": "header", "required": true }, { "type": "integer", "default": 100, "description": "Token lifetime in epoch.", "name": "X-Bearer-Lifetime", "in": "header" }, { "description": "Bearer tokens to form.", "name": "tokens", "in": "body", "required": true, "schema": { "type": "array", "items": { "$ref": "#/definitions/Bearer" } } } ], "responses": { "200": { "description": "Base64 encoded stable binary marshaled bearer token.", "schema": { "type": "array", "items": { "$ref": "#/definitions/TokenResponse" } }, "headers": { "Access-Control-Allow-Origin": { "type": "string" } } }, "400": { "description": "Bad request", "schema": { "$ref": "#/definitions/ErrorResponse" } } } }, "options": { "security": [], "operationId": "optionsAuth", "responses": { "200": { "description": "CORS", "headers": { "Access-Control-Allow-Headers": { "type": "string" }, "Access-Control-Allow-Origin": { "type": "string" } } } } } }, "/containers": { "get": { "security": [], "summary": "Get list of containers", "operationId": "listContainers", "parameters": [ { "type": "string", "description": "Base58 encoded owner id.", "name": "ownerId", "in": "query", "required": true }, { "minimum": 0, "type": "integer", "default": 0, "description": "The number of containers to skip before starting to collect the result set.", "name": "offset", "in": "query" }, { "maximum": 10000, "minimum": 1, "type": "integer", "default": 100, "description": "The numbers of containers to return.", "name": "limit", "in": "query" } ], "responses": { "200": { "description": "Containers info.", "schema": { "$ref": "#/definitions/ContainerList" }, "headers": { "Access-Control-Allow-Origin": { "type": "string" } } }, "400": { "description": "Bad request.", "schema": { "$ref": "#/definitions/ErrorResponse" } } } }, "put": { "summary": "Create new container in NeoFS", "operationId": "putContainer", "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" }, { "type": "boolean", "default": false, "description": "Provide this parameter to register container name in NNS service.", "name": "name-scope-global", "in": "query" }, { "description": "Container info", "name": "container", "in": "body", "required": true, "schema": { "$ref": "#/definitions/ContainerPutInfo" } } ], "responses": { "200": { "description": "Identifier of the created container.", "schema": { "type": "object", "required": [ "containerId" ], "properties": { "containerId": { "type": "string" } }, "example": { "containerId": "5HZTn5qkRnmgSz9gSrw22CEdPPk6nQhkwf2Mgzyvkikv" } }, "headers": { "Access-Control-Allow-Origin": { "type": "string" } } }, "400": { "description": "Bad request.", "schema": { "$ref": "#/definitions/ErrorResponse" } } } }, "options": { "security": [], "operationId": "optionsContainersPutList", "responses": { "200": { "description": "CORS", "headers": { "Access-Control-Allow-Headers": { "type": "string" }, "Access-Control-Allow-Methods": { "type": "string" }, "Access-Control-Allow-Origin": { "type": "string" } } } } } }, "/containers/{containerId}": { "get": { "security": [], "summary": "Get container by id", "operationId": "getContainer", "responses": { "200": { "description": "Container info.", "schema": { "$ref": "#/definitions/ContainerInfo" }, "headers": { "Access-Control-Allow-Origin": { "type": "string" } } }, "400": { "description": "Bad request.", "schema": { "$ref": "#/definitions/ErrorResponse" } } } }, "delete": { "summary": "Delete container by id", "operationId": "deleteContainer", "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": "Successful deletion.", "schema": { "$ref": "#/definitions/SuccessResponse" }, "headers": { "Access-Control-Allow-Origin": { "type": "string" } } }, "400": { "description": "Bad request.", "schema": { "$ref": "#/definitions/ErrorResponse" } } } }, "options": { "security": [], "operationId": "optionsContainersGetDelete", "responses": { "200": { "description": "CORS", "headers": { "Access-Control-Allow-Headers": { "type": "string" }, "Access-Control-Allow-Methods": { "type": "string" }, "Access-Control-Allow-Origin": { "type": "string" } } } } }, "parameters": [ { "type": "string", "description": "Base58 encoded container id.", "name": "containerId", "in": "path", "required": true } ] }, "/containers/{containerId}/eacl": { "get": { "security": [], "summary": "Get container EACL by id", "operationId": "getContainerEACL", "responses": { "200": { "description": "Container EACL information.", "schema": { "$ref": "#/definitions/Eacl" }, "headers": { "Access-Control-Allow-Origin": { "type": "string" } } }, "400": { "description": "Bad request.", "schema": { "$ref": "#/definitions/ErrorResponse" } } } }, "put": { "summary": "Set container EACL by id", "operationId": "putContainerEACL", "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" }, { "description": "EACL for container.", "name": "eacl", "in": "body", "required": true, "schema": { "$ref": "#/definitions/Eacl" } } ], "responses": { "200": { "description": "Successful EACL updating.", "schema": { "$ref": "#/definitions/SuccessResponse" }, "headers": { "Access-Control-Allow-Origin": { "type": "string" } } }, "400": { "description": "Bad request.", "schema": { "$ref": "#/definitions/ErrorResponse" } } } }, "options": { "security": [], "operationId": "optionsContainersEACL", "responses": { "200": { "description": "CORS", "headers": { "Access-Control-Allow-Headers": { "type": "string" }, "Access-Control-Allow-Methods": { "type": "string" }, "Access-Control-Allow-Origin": { "type": "string" } } } } }, "parameters": [ { "type": "string", "description": "Base58 encoded container id.", "name": "containerId", "in": "path", "required": true } ] }, "/objects": { "put": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "summary": "Upload object to NeoFS", "operationId": "putObject", "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" }, { "description": "Object info to upload", "name": "object", "in": "body", "required": true, "schema": { "$ref": "#/definitions/ObjectUpload" } } ], "responses": { "200": { "description": "Address of uploaded objects", "schema": { "$ref": "#/definitions/Address" }, "headers": { "Access-Control-Allow-Origin": { "type": "string" } } }, "400": { "description": "Bad request", "schema": { "$ref": "#/definitions/ErrorResponse" } } } }, "options": { "security": [], "operationId": "optionsObjectsPut", "responses": { "200": { "description": "CORS", "headers": { "Access-Control-Allow-Headers": { "type": "string" }, "Access-Control-Allow-Methods": { "type": "string" }, "Access-Control-Allow-Origin": { "type": "string" } } } } } }, "/objects/{containerId}/search": { "post": { "summary": "Search objects by filters", "operationId": "searchObjects", "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" }, { "minimum": 0, "type": "integer", "default": 0, "description": "The number of containers to skip before starting to collect the result set.", "name": "offset", "in": "query" }, { "maximum": 10000, "minimum": 1, "type": "integer", "default": 100, "description": "The numbers of containers to return.", "name": "limit", "in": "query" }, { "description": "Filters to search objects.", "name": "searchFilters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/SearchFilters" } } ], "responses": { "200": { "description": "List of objects", "schema": { "$ref": "#/definitions/ObjectList" }, "headers": { "Access-Control-Allow-Origin": { "type": "string" } } }, "400": { "description": "Bad request", "schema": { "$ref": "#/definitions/ErrorResponse" } } } }, "options": { "security": [], "operationId": "optionsObjectsSearch", "responses": { "200": { "description": "Base64 encoded stable binary marshaled bearer token.", "headers": { "Access-Control-Allow-Headers": { "type": "string" }, "Access-Control-Allow-Origin": { "type": "string" } } } } }, "parameters": [ { "type": "string", "description": "Base58 encoded container id.", "name": "containerId", "in": "path", "required": true } ] }, "/objects/{containerId}/{objectId}": { "get": { "summary": "Get object info by address", "operationId": "getObjectInfo", "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" }, { "minimum": 0, "type": "integer", "description": "Range offset to start reading data.", "name": "range-offset", "in": "query" }, { "minimum": 1, "type": "integer", "description": "Length of data range.", "name": "range-length", "in": "query" }, { "maximum": 524288000, "minimum": 0, "type": "integer", "default": 4194304, "description": "Max payload size (in bytes) that can be included in the response.\nIf the actual size is greater than this params the payload won't be included in the response.\n", "name": "max-payload-size", "in": "query" } ], "responses": { "200": { "description": "Object info", "schema": { "$ref": "#/definitions/ObjectInfo" }, "headers": { "Access-Control-Allow-Origin": { "type": "string" } } }, "400": { "description": "Bad request", "schema": { "$ref": "#/definitions/ErrorResponse" } } } }, "delete": { "summary": "Remove object from NeoFS", "operationId": "deleteObject", "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": "Successful deletion.", "schema": { "$ref": "#/definitions/SuccessResponse" }, "headers": { "Access-Control-Allow-Origin": { "type": "string" } } }, "400": { "description": "Bad request.", "schema": { "$ref": "#/definitions/ErrorResponse" } } } }, "options": { "security": [], "operationId": "optionsObjectsGetDelete", "responses": { "200": { "description": "CORS", "headers": { "Access-Control-Allow-Headers": { "type": "string" }, "Access-Control-Allow-Methods": { "type": "string" }, "Access-Control-Allow-Origin": { "type": "string" } } } } }, "parameters": [ { "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 } ] } }, "definitions": { "Action": { "description": "Rule execution result action in NeoFS EACL. Either allows or denies access if the rule's filters match.", "type": "string", "enum": [ "ALLOW", "DENY" ] }, "Address": { "description": "Address of the object in NeoFS.", "type": "object", "required": [ "containerId", "objectId" ], "properties": { "containerId": { "type": "string" }, "objectId": { "type": "string" } }, "example": { "containerId": "5HZTn5qkRnmgSz9gSrw22CEdPPk6nQhkwf2Mgzyvkikv", "objectId": "8N3o7Dtr6T1xteCt6eRwhpmJ7JhME58Hyu1dvaswuTDd" } }, "Attribute": { "description": "Attribute is a pair of strings that can be attached to a container or an object.", "type": "object", "required": [ "key", "value" ], "properties": { "key": { "type": "string" }, "value": { "type": "string" } }, "example": { "key": "User-Defined-Tag", "value": "tag value" } }, "Balance": { "type": "object", "required": [ "address", "value", "precision" ], "properties": { "address": { "type": "string" }, "precision": { "type": "integer" }, "value": { "type": "string" } } }, "Bearer": { "description": "Bearer token that is expected to be formed.", "type": "object", "properties": { "container": { "$ref": "#/definitions/Rule" }, "name": { "type": "string" }, "object": { "type": "array", "items": { "$ref": "#/definitions/Record" } } }, "example": [ { "name": "my-bearer-token", "object": [ { "action": "ALLOW", "filters": [], "operation": "GET", "targets": [ { "keys": [], "role": "OTHERS" } ] } ] }, { "container": { "verb": "PUT" }, "name": "my token to create container" } ] }, "ContainerInfo": { "description": "Information about container.", "type": "object", "required": [ "containerId", "containerName", "version", "ownerId", "basicAcl", "placementPolicy", "attributes" ], "properties": { "attributes": { "type": "array", "items": { "$ref": "#/definitions/Attribute" } }, "basicAcl": { "type": "string" }, "cannedAcl": { "description": "The friendly name for the basicAcl field.", "type": "string" }, "containerId": { "type": "string" }, "containerName": { "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", "containerName": "container", "ownerId": "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM", "placementPolicy": "REP 2", "version": "2.11" } }, "ContainerList": { "description": "List of containers info", "type": "object", "required": [ "size", "containers" ], "properties": { "containers": { "type": "array", "items": { "$ref": "#/definitions/ContainerInfo" } }, "size": { "type": "integer" } }, "example": { "containers": [ { "attribute": [ { "key": "Timestamp", "value": "1648810072" }, { "key": "Name", "value": "container" } ], "basicAcl": "0x1fbf9fff", "containerId": "5HZTn5qkRnmgSz9gSrw22CEdPPk6nQhkwf2Mgzyvkikv", "containerName": "container", "ownerId": "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM", "placementPolicy": "REP 2", "version": "2.11" }, { "attribute": [ { "key": "Name", "value": "container2" } ], "basicAcl": "0x1fbf9fff", "containerId": "FsE7HLQBBYc2WFJzuTXMcpspDEmwUxsD5YmNb2r25uUu", "containerName": "container2", "ownerId": "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM", "placementPolicy": "REP 1", "version": "2.11" } ], "size": 2 } }, "ContainerPutInfo": { "description": "Request body to create container. To specify container name use appropriate property (name provided in attributes will be ignored).", "type": "object", "properties": { "attributes": { "type": "array", "items": { "$ref": "#/definitions/Attribute" } }, "basicAcl": { "type": "string" }, "containerName": { "type": "string" }, "placementPolicy": { "type": "string" } }, "example": { "attributes": [ { "key": "Custom-Attribute", "value": "value" } ], "basicAcl": "public-read-write", "containerName": "container", "placementPolicy": "REP 3" } }, "Eacl": { "description": "EACL NeoFS table.", "type": "object", "required": [ "records" ], "properties": { "containerId": { "type": "string", "readOnly": true }, "records": { "type": "array", "items": { "$ref": "#/definitions/Record" } } }, "example": { "containerId": "5HZTn5qkRnmgSz9gSrw22CEdPPk6nQhkwf2Mgzyvkikv", "records": [ { "action": "GET", "filters": [ { "headerType": "OBJECT", "key": "FileName", "matchType": "STRING_EQUAL", "value": "myfile" } ], "operation": "ALLOW", "targets": [ { "role": "OTHERS" } ] } ] } }, "ErrorResponse": { "description": "Error response.", "type": "object", "required": [ "type", "message" ], "properties": { "code": { "type": "integer" }, "message": { "type": "string" }, "type": { "$ref": "#/definitions/ErrorType" } }, "example": { "code": 1024, "message": "incomplete object PUT by placement", "type": "API" } }, "ErrorType": { "description": "Error type. Allow determine source of the error.", "type": "string", "enum": [ "GW", "API" ] }, "Filter": { "description": "Filter in NeoFS EACL to check particular properties of the request or the object.", "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": { "description": "Enumeration of possible sources of Headers to apply filters in NeoFS EACL.", "type": "string", "enum": [ "REQUEST", "OBJECT", "SERVICE" ] }, "MatchType": { "description": "Match type in NeoFS EACL filter.", "type": "string", "enum": [ "STRING_EQUAL", "STRING_NOT_EQUAL" ] }, "ObjectBaseInfo": { "description": "Basic object information.", "type": "object", "required": [ "address" ], "properties": { "address": { "$ref": "#/definitions/Address" }, "filePath": { "type": "string" }, "name": { "type": "string" } }, "example": { "address": { "containerId": "5HZTn5qkRnmgSz9gSrw22CEdPPk6nQhkwf2Mgzyvkikv", "objectId": "8N3o7Dtr6T1xteCt6eRwhpmJ7JhME58Hyu1dvaswuTDd" }, "filePath": "/my/object/name.txt", "name": "name.txt" } }, "ObjectInfo": { "description": "Object information.", "type": "object", "required": [ "containerId", "objectId", "ownerId", "attributes", "objectSize", "payloadSize" ], "properties": { "attributes": { "type": "array", "items": { "$ref": "#/definitions/Attribute" } }, "containerId": { "type": "string" }, "objectId": { "type": "string" }, "objectSize": { "description": "Object full payload size", "type": "integer" }, "ownerId": { "type": "string" }, "payload": { "description": "Base64 encoded object payload", "type": "string" }, "payloadSize": { "description": "Payload size in response", "type": "integer" } }, "example": { "attribute": [ { "key": "Timestamp", "value": "1648810072" }, { "key": "Name", "value": "object" } ], "containerId": "5HZTn5qkRnmgSz9gSrw22CEdPPk6nQhkwf2Mgzyvkikv", "objectId": "8N3o7Dtr6T1xteCt6eRwhpmJ7JhME58Hyu1dvaswuTDd", "ownerId": "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM" } }, "ObjectList": { "description": "List of objects.", "type": "object", "required": [ "size", "objects" ], "properties": { "objects": { "type": "array", "items": { "$ref": "#/definitions/ObjectBaseInfo" } }, "size": { "type": "integer" } }, "example": { "objects": [ { "address": { "containerId": "5HZTn5qkRnmgSz9gSrw22CEdPPk6nQhkwf2Mgzyvkikv", "objectId": "8N3o7Dtr6T1xteCt6eRwhpmJ7JhME58Hyu1dvaswuTDd" }, "name": "/my/object/name" }, { "address": { "containerId": "5HZTn5qkRnmgSz9gSrw22CEdPPk6nQhkwf2Mgzyvkikv", "objectId": "3GbmMWusaWgMHokWui2zDunxMTzButuQMVLbtL3cDn8s" }, "name": "/my/object/some/other/name" } ], "size": 2 } }, "ObjectUpload": { "description": "Request body to create object.", "type": "object", "required": [ "containerId", "fileName" ], "properties": { "attributes": { "type": "array", "items": { "$ref": "#/definitions/Attribute" } }, "containerId": { "type": "string" }, "fileName": { "type": "string" }, "payload": { "type": "string" } }, "example": { "attributes": [ { "key": "User-Attribute", "value": "some-value" } ], "containerId": "5HZTn5qkRnmgSz9gSrw22CEdPPk6nQhkwf2Mgzyvkikv", "fileName": "myFile.txt", "payload": "Y29udGVudCBvZiBmaWxl" } }, "Operation": { "description": "Request's operation type to match in NeoFS EACL if the rule is applicable to a particular request.", "type": "string", "enum": [ "GET", "HEAD", "PUT", "DELETE", "SEARCH", "RANGE", "RANGEHASH" ] }, "Principal": { "type": "string" }, "Record": { "description": "A single NeoFS EACL rule.", "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": { "description": "Role for target in EACL.", "type": "string", "enum": [ "USER", "SYSTEM", "OTHERS" ] }, "Rule": { "description": "Container session token rule.", "type": "object", "required": [ "verb" ], "properties": { "containerId": { "type": "string" }, "verb": { "$ref": "#/definitions/Verb" } }, "example": { "containerId": "6jvKJCQr6e47Yx8SsbSN3fNgzroUJVkY66Q9wqxYcAjc", "verb": "DELETE" } }, "SearchFilter": { "description": "Search filter to find objects.", "type": "object", "required": [ "key", "value", "match" ], "properties": { "key": { "type": "string" }, "match": { "$ref": "#/definitions/SearchMatch" }, "value": { "type": "string" } }, "example": { "key": "FileName", "match": "MatchStringEqual", "value": "object-name" } }, "SearchFilters": { "description": "List of SearchFilter elements.", "type": "object", "required": [ "filters" ], "properties": { "filters": { "type": "array", "items": { "$ref": "#/definitions/SearchFilter" } } }, "example": { "filters": [ { "key": "FileName", "match": "MatchCommonPrefix", "value": "some/prefix" }, { "key": "CustomAttribute", "match": "MatchStringEqual", "value": "tag-value" } ] } }, "SearchMatch": { "description": "Search match type.", "type": "string", "enum": [ "MatchStringEqual", "MatchStringNotEqual", "MatchNotPresent", "MatchCommonPrefix" ] }, "SuccessResponse": { "description": "Success response.", "type": "object", "required": [ "success" ], "properties": { "success": { "type": "boolean" } }, "example": { "success": true } }, "Target": { "description": "Target to apply the ACL rule. Can be a subject's role class or a list of public keys to match.", "type": "object", "required": [ "role", "keys" ], "properties": { "keys": { "type": "array", "items": { "type": "string" } }, "role": { "$ref": "#/definitions/Role" } }, "example": { "keys": [ "021dc56fc6d81d581ae7605a8e00e0e0bab6cbad566a924a527339475a97a8e38e" ], "role": "USER" } }, "TokenResponse": { "description": "Base64 encoded marshaled token (for container or for object operations).", "type": "object", "required": [ "type", "token" ], "properties": { "name": { "type": "string" }, "token": { "type": "string" }, "type": { "$ref": "#/definitions/TokenType" } }, "example": [ { "token": "ClYKBAgCEA0aCAgDEAEiAggDGggIARACIgIIAxoICAIQAiICCAMaCAgDEAIiAggDGggIBBACIgIIAxoICAUQAiICCAMaCAgGEAIiAggDGggIBxACIgIIAxIbChk182WEDFuAqq3nssrGOaH0NK0ZhzF8bu+YGgQIaBgE", "type": "object" }, { "token": "ChCpanIBJCpJuJz42KOmGMSnEhsKGTWquaX2Lq6GhhO4faOYkLD0f9WkXuYJlq4aBAhnGAMiIQJgFcIEghQB5lq3AJZOVswInwc1IGhlQ7NCUh4DFO3UATIECAEQAQ==", "type": "container" } ] }, "TokenType": { "description": "Type of token.", "type": "string", "enum": [ "object", "container" ] }, "Verb": { "description": "Verb that describes the allowed container operation for token.", "type": "string", "enum": [ "PUT", "DELETE", "SETEACL" ] } }, "parameters": { "containerId": { "type": "string", "description": "Base58 encoded container id.", "name": "containerId", "in": "path", "required": true }, "objectId": { "type": "string", "description": "Base58 encoded object id.", "name": "objectId", "in": "path", "required": true }, "signatureKeyParam": { "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 }, "signatureParam": { "type": "string", "description": "Base64 encoded signature for bearer token.", "name": "X-Bearer-Signature", "in": "header", "required": true }, "signatureScheme": { "type": "boolean", "default": false, "description": "Use wallet connect signature scheme or native NeoFS signature.", "name": "walletConnect", "in": "query" } }, "securityDefinitions": { "BearerAuth": { "description": "Bearer token body to provide with NeoFS request. Must have 'Bearer ' prefix.", "type": "apiKey", "name": "Authorization", "in": "header" } }, "security": [ { "BearerAuth": [] } ] }`)) }