Skip to content
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

Merged
merged 3 commits into from
Jul 15, 2019
Merged

Make configuration consistent #186

merged 3 commits into from
Jul 15, 2019

Conversation

JoelSpeed
Copy link
Member

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:

  • My change requires a change to the documentation or CHANGELOG.
  • I have updated the documentation/CHANGELOG accordingly.
  • I have created a feature (non-master) branch for my PR.

@JoelSpeed JoelSpeed requested review from loshz and a team June 15, 2019 09:15
loshz
loshz previously approved these changes Jun 17, 2019
@@ -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"`
Copy link
Member

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)

Copy link
Member Author

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? 🤔

Copy link
Member

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.

@JoelSpeed
Copy link
Member Author

@syscll @steakunderscore @kskewes I've fixed up all the comments on this PR now, are you all happy for me to merge?

Copy link
Member

@loshz loshz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@JoelSpeed JoelSpeed merged commit d7e88a4 into master Jul 15, 2019
@JoelSpeed JoelSpeed deleted the consistent-config branch July 15, 2019 14:35
@JoelSpeed JoelSpeed mentioned this pull request Jul 16, 2019
3 tasks
JoelSpeed added a commit that referenced this pull request Jul 17, 2019
ploxiln added a commit to ploxiln/oauth2_proxy that referenced this pull request May 26, 2020
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]>
ploxiln added a commit to ploxiln/oauth2_proxy that referenced this pull request May 27, 2020
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]>
ploxiln added a commit to ploxiln/oauth2_proxy that referenced this pull request May 27, 2020
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]>
ploxiln added a commit to ploxiln/oauth2_proxy that referenced this pull request May 27, 2020
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]>
ploxiln added a commit to ploxiln/oauth2_proxy that referenced this pull request May 27, 2020
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inconsistent config file structure
4 participants