cmd/pomerium: add service mode to log

This commit is contained in:
Bobby DeSimone 2019-02-19 11:23:10 -08:00
parent e3f4bcae19
commit afd5abdc09
No known key found for this signature in database
GPG key ID: AEE4CF12FE86D07E
4 changed files with 5 additions and 4 deletions

View file

@ -155,7 +155,6 @@ 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 {

View file

@ -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)}

View file

@ -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"`

View 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},
} }