mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-08-07 05:14:57 -04:00
Start up a new machine auth provider in the storage service
This commit is contained in:
1 parent
518e8747b2
commit
35905f4a09
7 files changed
+237
-30
No files matched your search
@@ -19,15 +19,6 @@ func AuthBearerWithConfig(cfg *config.Config) []cli.Flag {
|
||||
Destination: &cfg.Reva.AuthBearer.DebugAddr,
|
||||
},
|
||||
|
||||
// Driver
|
||||
&cli.StringFlag{
|
||||
Name: "auth-driver",
|
||||
Value: flags.OverrideDefaultString(cfg.Reva.AuthBearerConfig.Driver, "oidc"),
|
||||
Usage: "bearer auth driver: 'oidc' or 'machine'",
|
||||
EnvVars: []string{"STORAGE_AUTH_BEARER_DRIVER"},
|
||||
Destination: &cfg.Reva.AuthBearerConfig.Driver,
|
||||
},
|
||||
|
||||
// OIDC
|
||||
|
||||
&cli.StringFlag{
|
||||
@@ -72,16 +63,6 @@ func AuthBearerWithConfig(cfg *config.Config) []cli.Flag {
|
||||
Destination: &cfg.Reva.OIDC.GIDClaim,
|
||||
},
|
||||
|
||||
// Machine Auth
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "machine-auth-api-key",
|
||||
Value: flags.OverrideDefaultString(cfg.Reva.AuthBearerConfig.MachineAuthAPIKey, "change-me-please"),
|
||||
Usage: "the API key to be used for the machine auth driver in reva",
|
||||
EnvVars: []string{"STORAGE_AUTH_BEARER_MACHINE_AUTH_API_KEY", "OCIS_MACHINE_AUTH_API_KEY"},
|
||||
Destination: &cfg.Reva.AuthBearerConfig.MachineAuthAPIKey,
|
||||
},
|
||||
|
||||
// Services
|
||||
|
||||
// AuthBearer
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
package flagset
|
||||
|
||||
import (
|
||||
"github.com/owncloud/ocis/ocis-pkg/flags"
|
||||
"github.com/owncloud/ocis/storage/pkg/config"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
// AuthMachineWithConfig applies cfg to the root flagset
|
||||
func AuthMachineWithConfig(cfg *config.Config) []cli.Flag {
|
||||
flags := []cli.Flag{
|
||||
|
||||
// debug ports are the odd ports
|
||||
&cli.StringFlag{
|
||||
Name: "debug-addr",
|
||||
Value: flags.OverrideDefaultString(cfg.Reva.AuthMachine.DebugAddr, "127.0.0.1:9167"),
|
||||
Usage: "Address to bind debug server",
|
||||
EnvVars: []string{"STORAGE_AUTH_MACHINE_DEBUG_ADDR"},
|
||||
Destination: &cfg.Reva.AuthMachine.DebugAddr,
|
||||
},
|
||||
|
||||
// Machine Auth
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "machine-auth-api-key",
|
||||
Value: flags.OverrideDefaultString(cfg.Reva.AuthMachineConfig.MachineAuthAPIKey, "change-me-please"),
|
||||
Usage: "the API key to be used for the machine auth driver in reva",
|
||||
EnvVars: []string{"STORAGE_AUTH_MACHINE_AUTH_API_KEY", "OCIS_MACHINE_AUTH_API_KEY"},
|
||||
Destination: &cfg.Reva.AuthMachineConfig.MachineAuthAPIKey,
|
||||
},
|
||||
|
||||
// Services
|
||||
|
||||
// AuthMachine
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "network",
|
||||
Value: flags.OverrideDefaultString(cfg.Reva.AuthMachine.GRPCNetwork, "tcp"),
|
||||
Usage: "Network to use for the storage service, can be 'tcp', 'udp' or 'unix'",
|
||||
EnvVars: []string{"STORAGE_AUTH_MACHINE_GRPC_NETWORK"},
|
||||
Destination: &cfg.Reva.AuthMachine.GRPCNetwork,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "addr",
|
||||
Value: flags.OverrideDefaultString(cfg.Reva.AuthMachine.GRPCAddr, "127.0.0.1:9166"),
|
||||
Usage: "Address to bind storage service",
|
||||
EnvVars: []string{"STORAGE_AUTH_MACHINE_GRPC_ADDR"},
|
||||
Destination: &cfg.Reva.AuthMachine.GRPCAddr,
|
||||
},
|
||||
&cli.StringSliceFlag{
|
||||
Name: "service",
|
||||
Value: cli.NewStringSlice("authprovider"), // TODO preferences
|
||||
Usage: "--service authprovider [--service otherservice]",
|
||||
EnvVars: []string{"STORAGE_AUTH_MACHINE_SERVICES"},
|
||||
},
|
||||
|
||||
// Gateway
|
||||
|
||||
&cli.StringFlag{
|
||||
Name: "reva-gateway-addr",
|
||||
Value: flags.OverrideDefaultString(cfg.Reva.Gateway.Endpoint, "127.0.0.1:9142"),
|
||||
Usage: "Address of REVA gateway endpoint",
|
||||
EnvVars: []string{"REVA_GATEWAY"},
|
||||
Destination: &cfg.Reva.Gateway.Endpoint,
|
||||
},
|
||||
}
|
||||
|
||||
flags = append(flags, TracingWithConfig(cfg)...)
|
||||
flags = append(flags, DebugWithConfig(cfg)...)
|
||||
flags = append(flags, SecretWithConfig(cfg)...)
|
||||
|
||||
return flags
|
||||
}
|
||||
Reference in new issue
Block a user