-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Make configuration consistent #186
Conversation
@@ -29,7 +29,7 @@ import ( | |||
// Options holds Configuration Options that can be set by Command Line Flag, | |||
// or Config File | |||
type Options struct { | |||
ProxyPrefix string `flag:"proxy-prefix" cfg:"proxy-prefix" env:"OAUTH2_PROXY_PROXY_PREFIX"` | |||
ProxyPrefix string `flag:"proxy-prefix" cfg:"proxy_prefix" env:"OAUTH2_PROXY_PROXY_PREFIX"` | |||
ProxyWebSockets bool `flag:"proxy-websockets" cfg:"proxy_websockets" env:"OAUTH2_PROXY_PROXY_WEBSOCKETS"` | |||
HTTPAddress string `flag:"http-address" cfg:"http_address" env:"OAUTH2_PROXY_HTTP_ADDRESS"` | |||
HTTPSAddress string `flag:"https-address" cfg:"https_address" env:"OAUTH2_PROXY_HTTPS_ADDRESS"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TLSCertFile
and TLSKeyFile
are missing the -file
part in their flags.
(sorry comment is on the wrong line because github doesn't let comments happen in the right place)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good spot, I had completely missed this, thanks! @syscll Do we change the flag
or the cfg
and env
? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My two cents are to shift to -tls-cert-file
and -tls-key-file
to be consistent with -htpasswd-file
and -jwt-key-file
. It just leaves the exception of -logging-filename
, but it's a little bit exceptional in that it defaults to stdout
. But I'm not strongly opinionated about which way to go.
6ceaa4c
to
874c147
Compare
@syscll @steakunderscore @kskewes I've fixed up all the comments on this PR now, are you all happy for me to merge? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Correct TLS Flags broken in #186
config: * proxy-prefix -> proxy_prefix * google_group -> google_groups flags: * tls-cert -> tls-cert-file * tls-key -> tls-key-file flags always use dashes, config options always use underscores flags are singular if they can be specified multiple times, config options are plural if they take a list inspired by oauth2-proxy/oauth2-proxy#186 Co-authored-by: Joel Speed <[email protected]>
config: * proxy-prefix -> proxy_prefix * google_group -> google_groups * github_team -> github_teams flags: * tls-cert -> tls-cert-file * tls-key -> tls-key-file flags always use dashes, config options always use underscores flags are singular if they can be specified multiple times, config options are plural if they take a list inspired by oauth2-proxy/oauth2-proxy#186 Co-authored-by: Joel Speed <[email protected]>
config: * proxy-prefix -> proxy_prefix * google_group -> google_groups * github_team -> github_teams flags: * tls-cert -> tls-cert-file * tls-key -> tls-key-file flags always use dashes, config options always use underscores flags are singular if they can be specified multiple times, config options are plural if they take a list inspired by oauth2-proxy/oauth2-proxy#186 Co-authored-by: Joel Speed <[email protected]>
config: * proxy-prefix -> proxy_prefix * google_group -> google_groups * github_team -> github_teams flags: * tls-cert -> tls-cert-file * tls-key -> tls-key-file flags always use dashes, config options always use underscores flags are singular if they can be specified multiple times, config options are plural if they take a list inspired by oauth2-proxy/oauth2-proxy#186 Co-authored-by: Joel Speed <[email protected]>
config: * proxy-prefix -> proxy_prefix * google_group -> google_groups * github_team -> github_teams flags: * tls-cert -> tls-cert-file * tls-key -> tls-key-file flags always use dashes, config options always use underscores flags are singular if they can be specified multiple times, config options are plural if they take a list inspired by oauth2-proxy/oauth2-proxy#186 Co-authored-by: Joel Speed <[email protected]>
Description
Some configuration options have been inconsistent in the past, this PR fixes that
Motivation and Context
Some options did not fit the pattern and I would like to make some future changes that automate some of this stuff, so having consistency will make this easier
Fixes #49
How Has This Been Tested?
It hasn't, but it's minor and shouldn't need testing
Checklist: