Integreate konnectd library #8

This commit is contained in:
Ilja Neumann
2020-01-28 16:19:32 +01:00
parent 046fec2033
commit 89af83ea46
55 changed files with 798 additions and 45 deletions
+17 -3
View File
@@ -26,14 +26,28 @@ import (
// Server is the entrypoint for the server command.
func Server(cfg *config.Config) cli.Command {
return cli.Command{
Name: "server",
Usage: "Start integrated server",
Flags: flagset.ServerWithConfig(cfg),
Name: "server",
Usage: "Start integrated server",
Flags: flagset.ServerWithConfig(cfg),
ArgsUsage: "identity-manger name (one of ldap, kc, dummy, cookie",
Before: func(c *cli.Context) error {
if cfg.HTTP.Root != "/" {
cfg.HTTP.Root = strings.TrimSuffix(cfg.HTTP.Root, "/")
}
// StringSliceFlag doesn't support Destination
if len(c.StringSlice("trusted-proxy")) > 0 {
cfg.Konnectd.TrustedProxy = c.StringSlice("trusted-proxy")
}
if len(c.StringSlice("allow-scope")) > 0 {
cfg.Konnectd.AllowScope = c.StringSlice("allow-scope")
}
if len(c.StringSlice("signing-private-key")) > 0 {
cfg.Konnectd.SigningPrivateKeyFiles = c.StringSlice("signing-private-key")
}
return nil
},
Action: func(c *cli.Context) error {