From a9922343efb26f1c61d1e331751ca060869b1f39 Mon Sep 17 00:00:00 2001 From: "A.Unger" Date: Thu, 3 Dec 2020 10:57:32 +0100 Subject: [PATCH] explain flags --- proxy/pkg/flagset/flagset.go | 7 +++---- storage/pkg/command/frontend.go | 1 + storage/pkg/flagset/frontend.go | 5 ++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/proxy/pkg/flagset/flagset.go b/proxy/pkg/flagset/flagset.go index 35a60852b..b8ea4d252 100644 --- a/proxy/pkg/flagset/flagset.go +++ b/proxy/pkg/flagset/flagset.go @@ -225,7 +225,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { Destination: &cfg.AutoprovisionAccounts, }, - // Presigned URLs + // Pre Signed URLs &cli.StringSliceFlag{ Name: "presignedurl-allow-method", Value: cli.NewStringSlice("GET"), @@ -251,9 +251,8 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { // Reva Middlewares Config &cli.StringSliceFlag{ - Name: "proxy-user-agent-whitelist", // TODO naming? - Value: cli.NewStringSlice(""), - Usage: "TODO", + Name: "proxy-user-agent-whitelist", + Usage: "--user-agent-whitelist=mirall:basic,foo:bearer Given a tuple of [UserAgent:challenge] it locks a given user agent to the authentication challenge. Particularly useful for old clients whose USer-Agent is known and only support one authentication challenge. When this flag is set in the proxy it configures the authentication middlewares.", EnvVars: []string{"PROXY_MIDDLEWARE_AUTH_CREDENTIALS_BY_USER_AGENT"}, }, } diff --git a/storage/pkg/command/frontend.go b/storage/pkg/command/frontend.go index 7b6dac0f1..f37765877 100644 --- a/storage/pkg/command/frontend.go +++ b/storage/pkg/command/frontend.go @@ -29,6 +29,7 @@ func Frontend(cfg *config.Config) *cli.Command { cfg.Reva.Frontend.Middleware.Auth.CredentialsByUserAgent = make(map[string]string, 0) uaw := c.StringSlice("user-agent-whitelist") + fmt.Printf("\n\n%v\n\n", uaw) for _, v := range uaw { parts := strings.Split(v, ":") if len(parts) != 2 { diff --git a/storage/pkg/flagset/frontend.go b/storage/pkg/flagset/frontend.go index 74c60ebdc..0a5bdb565 100644 --- a/storage/pkg/flagset/frontend.go +++ b/storage/pkg/flagset/frontend.go @@ -136,9 +136,8 @@ func FrontendWithConfig(cfg *config.Config) []cli.Flag { // Reva Middlewares Config &cli.StringSliceFlag{ - Name: "user-agent-whitelist", // TODO naming? - Value: cli.NewStringSlice("test"), - Usage: "TODO", + Name: "user-agent-whitelist", + Usage: "--user-agent-whitelist=mirall:basic,foo:bearer Given a tuple of comma separated [UserAgent:challenge] values, it locks a given user agent to the authentication challenge. Particularly useful for old clients whose USer-Agent is known and only support one authentication challenge. When this flag is set in the storage-frontend it configures Reva.", EnvVars: []string{"STORAGE_FRONTEND_MIDDLEWARE_AUTH_CREDENTIALS_BY_USER_AGENT"}, }, }