Skip to content

Commit

Permalink
Rename to oauthz (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
masterSplinter01 authored Mar 22, 2023
2 parents e8f759c + 57f0a08 commit 745b8f2
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 16 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ FROM alpine
WORKDIR /

COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /src/bin/neofs-send-authz /bin/neofs-send-authz
COPY --from=builder /src/bin/neofs-oauthz /bin/neofs-oauthz

ENTRYPOINT ["/bin/neofs-send-authz"]
ENTRYPOINT ["/bin/neofs-oauthz"]
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
REPO ?= $(shell go list -m)
VERSION ?= $(shell git describe --tags --match "v*" --dirty --always)

HUB_IMAGE ?= nspccdev/neofs-send-authz
HUB_IMAGE ?= nspccdev/neofs-oauthz
HUB_TAG ?= "$(shell echo ${VERSION} | sed 's/^v//')"

# List of binaries to build. For now just one.
Expand Down Expand Up @@ -40,7 +40,7 @@ dep:
go mod tidy -v && echo OK

image:
@echo "⇒ Build NeoFS Send Auth docker image "
@echo "⇒ Build NeoFS OAuthz docker image "
@docker build \
--build-arg REPO=$(REPO) \
--build-arg VERSION=$(VERSION) \
Expand Down
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# neofs-send-authz
neofs-send-authz is backend which allows to login to NeoFS network via Google or Github OAuth 2.0.
# neofs-oauthz
neofs-oauthz is an authentication backend allowing to login to NeoFS network
via Google or Github OAuth 2.0. It checks the user and then generates a bearer
token to allow uploading files with user's e-mail specified in
attributes. There is no fancy key management there, but at the same time it
allows to identify each object's uploader which is the main purpose for it
now. This backend is currently used by https://send.fs.neo.org/ demo.

## Installation
1. To build the binary run the following command:
Expand All @@ -12,13 +17,13 @@ make image
```

## Execution
neofs-send-authz must be run with `.yaml` config file:
neofs-oauthz must be run with `.yaml` config file:
```
$ ./neofs-send-authz -c config.yaml
$ ./neofs-oauthz -c config.yaml
```
or environment variables
```
SEND_AUTHZ_CONFIG=config.yaml ./neofs-send-authz
NEOFS_OAUTHZ_CONFIG=config.yaml ./neofs-oauthz
```

## Configuration
Expand Down
2 changes: 1 addition & 1 deletion auth/authenticator.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"fmt"
"net/http"

"github.com/nspcc-dev/neofs-oauthz/bearer"
"github.com/nspcc-dev/neofs-sdk-go/pool"
"github.com/nspcc-dev/neofs-send-authz/bearer"
"go.uber.org/zap"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/neofs-send-authz/app.go → cmd/neofs-oauthz/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import (
"github.com/nspcc-dev/neo-go/pkg/crypto/keys"
"github.com/nspcc-dev/neo-go/pkg/util"
"github.com/nspcc-dev/neo-go/pkg/wallet"
"github.com/nspcc-dev/neofs-oauthz/auth"
"github.com/nspcc-dev/neofs-oauthz/bearer"
cid "github.com/nspcc-dev/neofs-sdk-go/container/id"
"github.com/nspcc-dev/neofs-sdk-go/pool"
"github.com/nspcc-dev/neofs-sdk-go/user"
"github.com/nspcc-dev/neofs-send-authz/auth"
"github.com/nspcc-dev/neofs-send-authz/bearer"
"github.com/spf13/viper"
"go.uber.org/zap"
"golang.org/x/oauth2"
Expand Down
4 changes: 2 additions & 2 deletions cmd/neofs-send-authz/config.go → cmd/neofs-oauthz/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func newConfig() *viper.Viper {

switch {
case help != nil && *help:
fmt.Printf("NeoFS Send Authz %s\n", Version)
fmt.Printf("NeoFS OAuthz %s\n", Version)
flags.PrintDefaults()

fmt.Println()
Expand All @@ -109,7 +109,7 @@ func newConfig() *viper.Viper {

os.Exit(0)
case version != nil && *version:
fmt.Printf("NeoFS Send Authz %s\n", Version)
fmt.Printf("NeoFS OAuthz %s\n", Version)
os.Exit(0)
}

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion cmd/neofs-send-authz/misc.go → cmd/neofs-oauthz/misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

// Prefix is a prefix used for environment variables containing authz
// configuration.
const Prefix = "SEND_AUTHZ"
const Prefix = "NEOFS_OAUTHZ"

var (
// Version is gateway version.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/nspcc-dev/neofs-send-authz
module github.com/nspcc-dev/neofs-oauthz

go 1.18

Expand Down

0 comments on commit 745b8f2

Please sign in to comment.