Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create home directory on login on configured home storage providers and other stuff #469

Merged
merged 27 commits into from
Jan 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
b0cc536
auto create home folder if it is missing in eos
Dec 13, 2019
902d2de
Merge remote-tracking branch 'upstream/master' into eos-make-home
madsi1m Dec 31, 2019
c19921c
now works with multiuser mode
madsi1m Dec 31, 2019
ee54188
also fixed in ocdav
madsi1m Dec 31, 2019
8657607
added CreateUserHome function
madsi1m Jan 2, 2020
c87e0b5
add chmod to CreateUserHome
madsi1m Jan 6, 2020
dab36d5
add create home
labkode Jan 13, 2020
24ce19b
Merge remote-tracking branch 'madsi1m/eos-make-home' into create-home
labkode Jan 13, 2020
8dbb688
add home logic to eos
labkode Jan 13, 2020
c7432a0
fix Michael D'Silva mail
labkode Jan 13, 2020
879ec55
add CreateHome logic on login
labkode Jan 13, 2020
280fc0d
storageprovider: add config option to enable or disable home creation
labkode Jan 13, 2020
5267460
typeO
Jan 13, 2020
025923c
Merge pull request #1 from madsi1m/patch-7
labkode Jan 14, 2020
ff09fe4
add GetHome from storage provider
labkode Jan 14, 2020
3132c9d
refactor x-access-header
labkode Jan 14, 2020
bc86ca4
fix lint
labkode Jan 14, 2020
6e99165
add CreateHome on owncloud fs and other fixes
labkode Jan 14, 2020
042ce53
remove spurious log line
labkode Jan 14, 2020
9efe4c7
simplify config
labkode Jan 14, 2020
9be13bb
fix lint
labkode Jan 14, 2020
7ed3b1e
sorry it's my OCD
Jan 14, 2020
60c196c
comes from shared?
Jan 14, 2020
d777e79
Merge pull request #2 from madsi1m/patch-8
labkode Jan 14, 2020
e051a42
Merge pull request #3 from madsi1m/patch-9
labkode Jan 14, 2020
e4a167e
more eos, more config cleaning, more refactoring
labkode Jan 15, 2020
8a9602d
udpate go-cs3apis to latest
labkode Jan 15, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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