mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-18 19:47:22 +02:00
cmd/pomerium: add service mode to log
This commit is contained in:
parent
e3f4bcae19
commit
afd5abdc09
4 changed files with 5 additions and 4 deletions
|
@ -155,8 +155,7 @@ func New(opts *Options, optionFuncs ...func(*Authenticate) error) (*Authenticate
|
||||||
ProviderURL: opts.ProviderURL,
|
ProviderURL: opts.ProviderURL,
|
||||||
ClientID: opts.ClientID,
|
ClientID: opts.ClientID,
|
||||||
ClientSecret: opts.ClientSecret,
|
ClientSecret: opts.ClientSecret,
|
||||||
// SessionLifetimeTTL: opts.CookieLifetimeTTL,
|
Scopes: opts.Scopes,
|
||||||
Scopes: opts.Scopes,
|
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
@ -36,7 +36,7 @@ func main() {
|
||||||
fmt.Printf("%s", version.FullVersion())
|
fmt.Printf("%s", version.FullVersion())
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
log.Info().Str("version", version.FullVersion()).Msg("cmd/pomerium")
|
log.Info().Str("version", version.FullVersion()).Str("service-mode", mainOpts.Services).Msg("cmd/pomerium")
|
||||||
|
|
||||||
grpcAuth := middleware.NewSharedSecretCred(mainOpts.SharedKey)
|
grpcAuth := middleware.NewSharedSecretCred(mainOpts.SharedKey)
|
||||||
grpcOpts := []grpc.ServerOption{grpc.UnaryInterceptor(grpcAuth.ValidateRequest)}
|
grpcOpts := []grpc.ServerOption{grpc.UnaryInterceptor(grpcAuth.ValidateRequest)}
|
||||||
|
|
|
@ -23,12 +23,15 @@ type Options struct {
|
||||||
// Services is a list enabled service mode. If none are selected, "all" is used.
|
// Services is a list enabled service mode. If none are selected, "all" is used.
|
||||||
// Available options are : "all", "authenticate", "proxy".
|
// Available options are : "all", "authenticate", "proxy".
|
||||||
Services string `envconfig:"SERVICES"`
|
Services string `envconfig:"SERVICES"`
|
||||||
|
|
||||||
// Addr specifies the host and port on which the server should serve
|
// Addr specifies the host and port on which the server should serve
|
||||||
// HTTPS requests. If empty, ":https" is used.
|
// HTTPS requests. If empty, ":https" is used.
|
||||||
Addr string `envconfig:"ADDRESS"`
|
Addr string `envconfig:"ADDRESS"`
|
||||||
|
|
||||||
// Cert and Key specifies the base64 encoded TLS certificates to use.
|
// Cert and Key specifies the base64 encoded TLS certificates to use.
|
||||||
Cert string `envconfig:"CERTIFICATE"`
|
Cert string `envconfig:"CERTIFICATE"`
|
||||||
Key string `envconfig:"CERTIFICATE_KEY"`
|
Key string `envconfig:"CERTIFICATE_KEY"`
|
||||||
|
|
||||||
// CertFile and KeyFile specifies the TLS certificates to use.
|
// CertFile and KeyFile specifies the TLS certificates to use.
|
||||||
CertFile string `envconfig:"CERTIFICATE_FILE"`
|
CertFile string `envconfig:"CERTIFICATE_FILE"`
|
||||||
KeyFile string `envconfig:"CERTIFICATE_KEY_FILE"`
|
KeyFile string `envconfig:"CERTIFICATE_KEY_FILE"`
|
||||||
|
|
|
@ -19,7 +19,6 @@ func Test_optionsFromEnvConfig(t *testing.T) {
|
||||||
{"good default with no env settings", good, "", "", false},
|
{"good default with no env settings", good, "", "", false},
|
||||||
{"invalid service type", nil, "SERVICES", "invalid", true},
|
{"invalid service type", nil, "SERVICES", "invalid", true},
|
||||||
{"good service", good, "SERVICES", "all", false},
|
{"good service", good, "SERVICES", "all", false},
|
||||||
|
|
||||||
{"bad debug boolean", nil, "POMERIUM_DEBUG", "yes", true},
|
{"bad debug boolean", nil, "POMERIUM_DEBUG", "yes", true},
|
||||||
{"missing shared secret", nil, "SHARED_SECRET", "", true},
|
{"missing shared secret", nil, "SHARED_SECRET", "", true},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue