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

Add flag for identity server base URL #2033

Merged
merged 1 commit into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions cmd/server/app/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ func init() {
if err := auth.RegisterOAuthFlags(viper.GetViper(), RootCmd.PersistentFlags()); err != nil {
log.Fatal().Err(err).Msg("Error registering oauth flags")
}
if err := config.RegisterIdentityFlags(viper.GetViper(), RootCmd.PersistentFlags()); err != nil {
log.Fatal().Err(err).Msg("Error registering identity flags")
}
}

func initConfig() {
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ services:
"--http-host=0.0.0.0",
"--metric-host=0.0.0.0",
"--db-host=postgres",
"--issuer-url=http://keycloak:8080",
"--config=/app/server-config.yaml",
# If you don't want to store your GitHub client ID and secret in the main
# config file, point to them here:
Expand Down
9 changes: 9 additions & 0 deletions internal/config/identity.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ import (
"fmt"
"os"
"path/filepath"

"github.com/spf13/pflag"
"github.com/spf13/viper"
)

// IdentityConfig is the configuration for the identity provider
Expand Down Expand Up @@ -49,3 +52,9 @@ func (sic *ServerIdentityConfig) GetClientSecret() (string, error) {
}
return sic.ClientSecret, nil
}

// RegisterIdentityFlags registers the flags for the identity server
func RegisterIdentityFlags(v *viper.Viper, flags *pflag.FlagSet) error {
return BindConfigFlag(v, flags, "identity.server.issuer_url", "issuer-url", "",
"The base URL where the identity server is running", flags.String)
}
Loading