Skip to content

Commit

Permalink
Create home directory on login on configured home storage providers a…
Browse files Browse the repository at this point in the history
…nd other stuff (#469)
  • Loading branch information
labkode authored Jan 17, 2020
1 parent 4c75134 commit e6c8246
Show file tree
Hide file tree
Showing 81 changed files with 734 additions and 2,464 deletions.
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Aritz Brosa <[email protected]> zazola <[email protected]>
Giuseppe Lo Presti <[email protected]> Giuseppe <[email protected]>
Michael D'Silva <[email protected]>
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
- Ilja Neumann <[email protected]>
- Jörn Friedrich Dreyer <[email protected]>
- Michael D'Silva <[email protected]>
- Michael D'Silva <[email protected]>
- Mohitty <[email protected]>
- Thomas Boerger <[email protected]>
7 changes: 1 addition & 6 deletions cmd/reva/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,6 @@ func readConfig() (*config, error) {
}

func writeConfig(c *config) error {
if c.AuthHeader == "" {
c.AuthHeader = "x-access-token"
}

data, err := json.Marshal(c)
if err != nil {
return err
Expand All @@ -89,8 +85,7 @@ func writeConfig(c *config) error {
}

type config struct {
Host string `json:"host"`
AuthHeader string `json:"auth_header"`
Host string `json:"host"`
}

func read(r *bufio.Reader) (string, error) {
Expand Down
11 changes: 0 additions & 11 deletions cmd/reva/gen/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,6 @@ skip_methods = ["/status.php"]
[http.middlewares.auth.token_managers.jwt]
secret = "{{.TokenSecret}}"
[http.middlewares.auth.token_strategies.header]
header = "X-Access-Token"
[http.middlewares.auth.token_writers.header]
header = "X-Access-Token"
# GRPC interceptors
[grpc.interceptors.trace]
Expand All @@ -126,15 +119,11 @@ priority = 300
[grpc.interceptors.auth]
priority = 400
# keys for grpc metadata are always lowercase, so interceptors headers need to use lowercase.
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.authproviderv1beta1.AuthService/GenerateAccessToken"]
[grpc.interceptors.auth.token_strategies.header]
header = "X-Access-Token"
[grpc.interceptors.auth.token_managers.jwt]
secret = "{{.TokenSecret}}"
Expand Down
4 changes: 1 addition & 3 deletions cmd/reva/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ import (
"google.golang.org/grpc/metadata"
)

const defaultHeader = "x-access-token"

func getAuthContext() context.Context {
ctx := context.Background()
// read token from file
Expand All @@ -41,7 +39,7 @@ func getAuthContext() context.Context {
return ctx
}
ctx = token.ContextSetToken(ctx, t)
ctx = metadata.AppendToOutgoingContext(ctx, defaultHeader, t)
ctx = metadata.AppendToOutgoingContext(ctx, token.TokenHeader, t)
return ctx
}

Expand Down
9 changes: 9 additions & 0 deletions cmd/revad/runtime/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (
"github.com/cs3org/reva/pkg/logger"
"github.com/cs3org/reva/pkg/rgrpc"
"github.com/cs3org/reva/pkg/rhttp"
"github.com/cs3org/reva/pkg/sharedconf"
"github.com/mitchellh/mapstructure"
"github.com/pkg/errors"
"github.com/rs/zerolog"
Expand All @@ -44,6 +45,7 @@ import (

// Run runs a reva server with the given config file and pid file.
func Run(mainConf map[string]interface{}, pidFile string) {
parseSharedConfOrDie(mainConf["shared"])
coreConf := parseCoreConfOrDie(mainConf["core"])
logConf := parseLogConfOrDie(mainConf["log"])

Expand Down Expand Up @@ -333,6 +335,13 @@ func parseCoreConfOrDie(v interface{}) *coreConf {
return c
}

func parseSharedConfOrDie(v interface{}) {
if err := sharedconf.Decode(v); err != nil {
fmt.Fprintf(os.Stderr, "error decoding shared config: %s\n", err.Error())
os.Exit(1)
}
}

func parseLogConfOrDie(v interface{}) *logConf {
c := &logConf{}
if err := mapstructure.Decode(v, c); err != nil {
Expand Down
53 changes: 0 additions & 53 deletions docs/old/README.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/old/_config.yml

This file was deleted.

95 changes: 0 additions & 95 deletions docs/old/beginner-guide.md

This file was deleted.

11 changes: 0 additions & 11 deletions docs/old/building-reva.md

This file was deleted.

16 changes: 0 additions & 16 deletions docs/old/command-line.md

This file was deleted.

53 changes: 0 additions & 53 deletions docs/old/config/core.md

This file was deleted.

51 changes: 0 additions & 51 deletions docs/old/config/grpc.md

This file was deleted.

Loading

0 comments on commit e6c8246

Please sign in to comment.