Skip to content

Commit

Permalink
Gateway+metadata (#289)
Browse files Browse the repository at this point in the history
* Add metadata support
* Add gateway as required element of the deployment
* New code layout enforcing Go best practices for encapsulation
* Support for multiple authentication backends
* New user provider grpc service
  • Loading branch information
labkode committed Oct 16, 2019
1 parent 3a03735 commit 9db3db0
Show file tree
Hide file tree
Showing 212 changed files with 4,043 additions and 2,816 deletions.
2 changes: 1 addition & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
issues:
exclude-rules:
- path: cmd/revad/svcs/httpsvcs/handlers/log/log.go
- path: internal/http/interceptors/log/log.go
text: "SA1019:"
linters:
- staticcheck
Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
- Felix Hillingshaeuser <felix@mxcore.de>
- Giuseppe <giuseppe.lopresti@cern.ch>
- Giuseppe Lo Presti <giuseppe.lopresti@cern.ch>
- Hannah von Reth <vonreth@kde.org>
- Hugo Gonzalez Labrador <github@hugo.labkode.com>
- Hugo Gonzalez Labrador <gonzalhu@iota.cern.ch>
- Ilja Neumann <ineumann@owncloud.com>
- Jörn Friedrich Dreyer <jfd@butonic.de>
- Mohitty <mohitt@iitk.ac.in>
90 changes: 0 additions & 90 deletions cmd/reva/app-provider-get-iframe.go

This file was deleted.

88 changes: 0 additions & 88 deletions cmd/reva/app-registry-find.go

This file was deleted.

56 changes: 0 additions & 56 deletions cmd/reva/broker-discover.go

This file was deleted.

62 changes: 0 additions & 62 deletions cmd/reva/broker-find.go

This file was deleted.

9 changes: 5 additions & 4 deletions cmd/reva/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"github.com/cheggaaa/pb"
rpcpb "github.com/cs3org/go-cs3apis/cs3/rpc"
storageproviderv0alphapb "github.com/cs3org/go-cs3apis/cs3/storageprovider/v0alpha"
"github.com/cs3org/reva/cmd/revad/svcs/httpsvcs/utils"
"github.com/cs3org/reva/pkg/rhttp"
)

func downloadCommand() *command {
Expand All @@ -43,7 +43,7 @@ func downloadCommand() *command {
remote := cmd.Args()[0]
local := cmd.Args()[1]

client, err := getStorageProviderClient()
client, err := getClient()
if err != nil {
return err
}
Expand Down Expand Up @@ -84,12 +84,13 @@ func downloadCommand() *command {

dataServerURL := res.DownloadEndpoint
// TODO(labkode): do a protocol switch
httpReq, err := utils.NewRequest(ctx, "GET", dataServerURL, nil)
httpReq, err := rhttp.NewRequest(ctx, "GET", dataServerURL, nil)
if err != nil {
return err
}

httpClient := utils.GetHTTPClient(ctx)
httpReq.Header.Set("X-Reva-Transfer", res.Token)
httpClient := rhttp.GetHTTPClient(ctx)

httpRes, err := httpClient.Do(httpReq)
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions cmd/reva/gen/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"os"
"text/template"

authv0alphapb "github.com/cs3org/go-cs3apis/cs3/auth/v0alpha"
userproviderv0alphapb "github.com/cs3org/go-cs3apis/cs3/userprovider/v0alpha"
)

var baseTemplate = `# This config file will start a reva instance that:
Expand Down Expand Up @@ -130,7 +130,7 @@ header = "x-access-token"
token_strategy = "header"
token_manager = "jwt"
# GenerateAccessToken contains the credentials in the payload. Skip auth, otherwise services cannot obtain a token.
skip_methods = ["/cs3.authv0alpha.AuthService/GenerateAccessToken"]
skip_methods = ["/cs3.authproviderv0alpha.AuthService/GenerateAccessToken"]
[grpc.interceptors.auth.token_strategies.header]
header = "X-Access-Token"
Expand Down Expand Up @@ -401,7 +401,7 @@ type UserVars struct {
}

// WriteUsers writes a basic auth protected reva.toml file to the given path
func WriteUsers(p string, users []*authv0alphapb.User) {
func WriteUsers(p string, users []*userproviderv0alphapb.User) {

var uservars []*UserVars

Expand Down

0 comments on commit 9db3db0

Please sign in to comment.