No description
Find a file
2026-02-27 18:52:32 +03:00
.github *: Set min required Go to 1.25 2026-02-20 14:55:41 +04:00
cmd/neofs-rest-gw handlers: Remove waiter for the container operations 2026-02-20 14:35:17 +04:00
config handlers: Remove waiter for the container operations 2026-02-20 14:35:17 +04:00
docs handlers: Remove waiter for the container operations 2026-02-20 14:35:17 +04:00
handlers api: Upgrade swagger generator 2026-02-20 14:55:44 +04:00
internal *: Remove KEYS role 2026-02-06 15:58:26 +04:00
metrics *: Add API to set and remove container attributes 2026-02-18 09:22:22 +04:00
spec *: Add API to set and remove container attributes 2026-02-18 09:22:22 +04:00
static/docs *: Make API entrypoint properly versioned 2025-04-11 13:24:44 +04:00
.gitignore workflows: switch to org-wide linter job 2024-09-13 10:54:22 +03:00
CHANGELOG.md *: Set min required Go to 1.25 2026-02-20 14:55:41 +04:00
CONTRIBUTING.md [#42] Add contribution guide 2022-08-11 15:53:29 +03:00
Dockerfile *: Set min required Go to 1.25 2026-02-20 14:55:41 +04:00
Dockerfile.dirty [#1] Add basic structure and operations 2022-04-29 10:20:37 +03:00
go.mod go.mod: Upgraded github.com/getkin/kin-openapi v0.131.0 => v0.133.0 2026-02-20 14:55:44 +04:00
go.sum go.mod: Upgraded github.com/getkin/kin-openapi v0.131.0 => v0.133.0 2026-02-20 14:55:44 +04:00
LICENSE [#1] Add basic structure and operations 2022-04-29 10:20:37 +03:00
Makefile Makefile: add modernize check 2026-02-27 18:49:12 +03:00
oapi-generator.cfg.yaml *: Generate API with new tools 2024-03-18 08:54:15 +04:00
README.md docs: add auth migration/usage guide 2026-02-11 11:43:59 +03:00
VERSION CHANGELOG: release 0.16.0 2026-02-11 11:43:59 +03:00

NeoFS

REST server to interact with NeoFS.


Report GitHub release (latest SemVer) License

neofs-rest-gw

NeoFS REST Gateway bridges NeoFS internal protocol and REST API server.

Installation

Building

Before building make sure you have the following tools:

  • go
  • make
  • git
  • curl
  • docker

First clone this repository:

$ git clone https://github.com/nspcc-dev/neofs-rest-gw

Then run make to build bin/neofs-rest-gw binary:

$ make

Or you can build it using docker:

$ make docker/all

Generate openapi boilerplate code

If you change the spec file you have to re-generate server code.

You have several approaches:

  1. Run make. It automatically downloads oapi-codegen and generates boilerplate.
$ make
  1. Generate code separately:
$ make generate-server

Other targets

Notable make targets:

dep             Check and ensure dependencies
image           Build clean docker image
image-dirty     Build dirty docker image with host-built binaries
formats         Run all code formatters
lint            Run linters
version         Show current version
generate-server Generate boilerplate by spec

Docker

Or you can also use a Docker image provided for released (and occasionally unreleased) versions of gateway (:latest points to the latest stable release).

Execution

REST gateway itself is not a NeoFS node, so to access NeoFS it uses node's gRPC interface and you need to provide some node that it will connect to. This can be done either via -p parameter or via REST_GW_POOL_PEERS_<N>_ADDRESS and REST_GW_POOL_PEERS_<N>_WEIGHT environment variables (the gate supports multiple NeoFS nodes with weighted load balancing).

If you're launching REST gateway in bundle with neofs-dev-env, you can get an IP address of the node in output of make hosts command (with s0*.neofs.devenv name).

These two commands are functionally equivalent, they run the gate with one backend node (and otherwise default settings):

$ neofs-rest-gw -p 192.168.130.72:8080
$ REST_GW_POOL_PEERS_0_ADDRESS=192.168.130.72:8080 neofs-rest-gw

It's also possible to specify uri scheme (grpc or grpcs) when using -p:

$ neofs-rest-gw -p grpc://192.168.130.72:8080
$ REST_GW_POOL_PEERS_0_ADDRESS=grpcs://192.168.130.72:8080 neofs-rest-gw

Configuration

In general, everything available as CLI parameter can also be specified via environment variables, so they're not specifically mentioned in most cases (see --help also). If you prefer a config file you can use it in yaml format. See config and defaults for example.

$ neofs-rest-gw --config config.yaml

Docs

You can see swagger specification using the following url (suppose you ran rest-gw on localhost:8090):

Known issues

Using % in path parameters leads to error. For instance, getting object by attribute:

  • /v1/get_by_attribute/A9pnctophx5PFt4eUd8d2aa6otjgnQZNzyvt3HCeygFD/cat%25jpeg/cat%25jpeg

cat%25jpeg - already URL escaped string, original value is cat%jpeg.

Also, when you run rest-gw, you will see a line similar to:

...
2024/02/12 13:21:31 Serving neofs rest gw at http://192.168.130.72:8080

You will find an auto-redirect to the specification page via this link.

Migrating from HTTP gateway

See docs/migration-from-http.md.

Migrating Object search from V1 to V2

See docs/migration-to-search-v2.

Migrating to V2 authentication API

See docs/migration-to-auth-v2.md.

Contributing

Feel free to contribute to this project after reading the contributing guidelines.

Before starting to work on a certain topic, create a new issue first, describing the feature/topic you are going to implement.

License

This project is licensed under the GNU GPL v3 License - see the LICENSE file for details.