mirror of
https://github.com/davidallendj/opaal.git
synced 2025-12-20 11:37:01 -07:00
Added environment variables support (WIP)
This commit is contained in:
parent
2413ab2766
commit
e791a01ea2
2 changed files with 100 additions and 2 deletions
|
|
@ -22,6 +22,9 @@ var serveCmd = &cobra.Command{
|
|||
s := opaal.NewServerWithConfig(&config)
|
||||
// FIXME: change how the server address is set with `NewServerWithConfig`
|
||||
s.Server.Addr = fmt.Sprintf("%s:%d", s.Issuer.Host, s.Issuer.Port)
|
||||
if config.Options.Verbose {
|
||||
fmt.Printf("Identity provider listening on %s\n", s.Server.Addr)
|
||||
}
|
||||
err := s.StartIdentityProvider()
|
||||
if errors.Is(err, http.ErrServerClosed) {
|
||||
fmt.Printf("Identity provider server closed.\n")
|
||||
|
|
@ -32,6 +35,8 @@ var serveCmd = &cobra.Command{
|
|||
}
|
||||
|
||||
func init() {
|
||||
serveCmd.Flags().StringVar(&config.Server.Issuer.Host, "host", "127.0.0.1", "set the identity provider host")
|
||||
serveCmd.Flags().IntVar(&config.Server.Issuer.Port, "port", 3332, "set the identity provider port")
|
||||
serveCmd.Flags().StringVar(&endpoints.Authorization, "endpoints.authorization", "", "set the authorization endpoint for the identity provider")
|
||||
serveCmd.Flags().StringVar(&endpoints.Token, "endpoints.token", "", "set the token endpoint for the identity provider")
|
||||
serveCmd.Flags().StringVar(&endpoints.JwksUri, "endpoints.jwks_uri", "", "set the JWKS endpoints for the identity provider")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue