You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* adding environment variable config lookup
* added MARGIN env var that was missing
* Added not env lookups for new params have been added since this was last touched.
Signed-off-by: Jim Weber <[email protected]>
* Change env lookup function to non-exported functions per PR review.
Signed-off-by: Jim Weber <[email protected]>
---------
Signed-off-by: Jim Weber <[email protected]>
Co-authored-by: tommy kelly <[email protected]>
Co-authored-by: Jim Weber <[email protected]>
flag.StringVar(&cfg.logFormat, "log.format", "logfmt", "The log format to use. Options: 'logfmt', 'json'.")
78
-
flag.StringVar(&cfg.server.listenInternal, "web.internal.listen", ":8081", "The address on which the internal server listens.")
79
-
flag.StringVar(&cfg.server.listen, "web.listen", ":8080", "The address on which the proxy server listens.")
80
-
flag.StringVar(&cfg.oidc.issuerURL, "oidc.issuer-url", "", "The OIDC issuer URL, see https://openid.net/specs/openid-connect-discovery-1_0.html#IssuerDiscovery.")
81
-
flag.StringVar(&cfg.oidc.clientSecret, "oidc.client-secret", "", "The OIDC client secret, see https://tools.ietf.org/html/rfc6749#section-2.3.")
82
-
flag.StringVar(&cfg.oidc.clientID, "oidc.client-id", "", "The OIDC client ID, see https://tools.ietf.org/html/rfc6749#section-2.3.")
83
-
flag.StringVar(&cfg.oidc.audience, "oidc.audience", "", "The audience for whom the access token is intended, see https://openid.net/specs/openid-connect-core-1_0.html#IDToken.")
84
-
flag.StringVar(&cfg.oidc.username, "oidc.username", "", "The username to use for OIDC authentication. If both username and password are set then grant_type is set to password.")
85
-
flag.StringVar(&cfg.oidc.password, "oidc.password", "", "The password to use for OIDC authentication. If both username and password are set then grant_type is set to password.")
flag.StringVar(&cfg.logFormat, "log.format", lookupEnvOrString("LOG_FORMAT", "logfmt"), "The log format to use. Options: 'logfmt', 'json'.")
97
+
flag.StringVar(&cfg.server.listenInternal, "web.internal.listen", lookupEnvOrString("WEB_INTERNAL_LISTEN", ":8081"), "The address on which the internal server listens.")
98
+
flag.StringVar(&cfg.server.listen, "web.listen", lookupEnvOrString("WEB_LISTEN", ":8080"), "The address on which the proxy server listens.")
99
+
flag.StringVar(&cfg.oidc.issuerURL, "oidc.issuer-url", lookupEnvOrString("OIDC_ISSUER_URL", ""), "The OIDC issuer URL, see https://openid.net/specs/openid-connect-discovery-1_0.html#IssuerDiscovery.")
100
+
flag.StringVar(&cfg.oidc.clientSecret, "oidc.client-secret", lookupEnvOrString("OIDC_CLIENT_SECRET", ""), "The OIDC client secret, see https://tools.ietf.org/html/rfc6749#section-2.3.")
101
+
flag.StringVar(&cfg.oidc.clientID, "oidc.client-id", lookupEnvOrString("OIDC_CLIENT_ID", ""), "The OIDC client ID, see https://tools.ietf.org/html/rfc6749#section-2.3.")
102
+
flag.StringVar(&cfg.oidc.audience, "oidc.audience", lookupEnvOrString("OIDC_AUDIENCE", ""), "The audience for whom the access token is intended, see https://openid.net/specs/openid-connect-core-1_0.html#IDToken.")
103
+
flag.StringVar(&cfg.oidc.username, "oidc.username", lookupEnvOrString("OIDC_USERNAME", ""), "The username to use for OIDC authentication. If both username and password are set then grant_type is set to password.")
104
+
flag.StringVar(&cfg.oidc.password, "oidc.password", lookupEnvOrString("OIDC_PASSWORD", ""), "The password to use for OIDC authentication. If both username and password are set then grant_type is set to password.")
86
105
flag.StringSliceVar(&cfg.scope, "scope", []string{}, "The scope to be included in the payload data of the token. Scopes can either be comma-separated or space-separated.")
87
-
flag.StringVar(&cfg.file, "file", "", "The path to the file in which to write the retrieved token.")
88
-
flag.StringVar(&cfg.tempFile, "temp-file", "", "The path to a temporary file to use for atomically update the token file. If left empty, \".tmp\" will be suffixed to the token file.")
89
-
rawURL:=flag.String("url", "", "The target URL to which to proxy requests. All requests will have the acces token in the Authorization HTTP header.(DEPRECATED: Use -upstream.url instead)")
90
-
rawUpstreamURL:=flag.String("upstream.url", "", "The target URL to which to proxy requests. All requests will have the acces token in the Authorization HTTP header.")
91
-
flag.StringVar(&cfg.upstream.caFile, "upstream.ca-file", "", "The path to the CA file to verify upstream server TLS certificates.")
92
-
flag.DurationVar(&cfg.upstream.readTimeout, "upstream.read-timeout", 0, "The time from when the connection is accepted to when the request body is fully read.")
93
-
flag.DurationVar(&cfg.upstream.writeTimeout, "upstream.write-timeout", 0, "The time from the end of the request header read to the end of the response write .")
94
-
flag.DurationVar(&cfg.margin, "margin", 5*time.Minute, "The margin of time before a token expires to try to refresh it.")
106
+
flag.StringVar(&cfg.file, "file", lookupEnvOrString("FILE", ""), "The path to the file in which to write the retrieved token.")
107
+
flag.StringVar(&cfg.tempFile, "temp-file", lookupEnvOrString("TEMP_FILE", ""), "The path to a temporary file to use for atomically update the token file. If left empty, \".tmp\" will be suffixed to the token file.")
108
+
rawURL:=flag.String("url", lookupEnvOrString("URL", ""), "The target URL to which to proxy requests. All requests will have the acces token in the Authorization HTTP header.(DEPRECATED: Use -upstream.url instead)")
109
+
rawUpstreamURL:=flag.String("upstream.url", lookupEnvOrString("UPSTREAM_URL", ""), "The target URL to which to proxy requests. All requests will have the acces token in the Authorization HTTP header.")
110
+
flag.StringVar(&cfg.upstream.caFile, "upstream.ca-file", lookupEnvOrString("UPSTREAM_CA_FILE", ""), "The path to the CA file to verify upstream server TLS certificates.")
111
+
flag.DurationVar(&cfg.upstream.readTimeout, "upstream.read-timeout", lookupEnvOrDuration("UPSTREAM_READ_TIMEOUT", 0), "The time from when the connection is accepted to when the request body is fully read.")
112
+
flag.DurationVar(&cfg.upstream.writeTimeout, "upstream.write-timeout", lookupEnvOrDuration("UPSTREAM_WRITE_TIMEOUT", 0), "The time from the end of the request header read to the end of the response write .")
113
+
flag.DurationVar(&cfg.margin, "margin", lookupEnvOrDuration("MARGIN", 5*time.Minute), "The margin of time before a token expires to try to refresh it.")
0 commit comments