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

Rename config settings with fallback aliases #1679

Merged
merged 1 commit into from
Dec 6, 2020

Conversation

wolfgangwalther
Copy link
Member

@wolfgangwalther wolfgangwalther commented Dec 5, 2020

As discussed in #1668 (comment) this changes names for some of the config options:

  • secret-is-base64 -> jwt-secret-is-base64
  • role-claim-key -> jwt-role-claim-key
  • max-rows -> db-max-rows
  • pre-request -> db-pre-request
  • root-spec -> db-root-spec

I also changed db-schema to db-schemas, because that's how it was used internally. I guess this was changed once multi schema support was included.

All of the old names are added as aliases, so there is no breaking changes - existing configs continue to work.

The first commit ("changed: ...") is the renaming of config options (trivial) + a lot of sorting, so that config options with the same prefix are now nicely grouped everywhere. Everywhere except the --help output that is, because this follows a slightly different logic, so I did not touch that again. This 3rd commit creates a big diff because of all the sorting, but just compiling and running all the tests should give enough confidence. This will not need a deep review.

The second commit ("added: ...") is the code for the aliases. This is new code and should be reviewed properly.

@wolfgangwalther wolfgangwalther force-pushed the config-aliases branch 2 times, most recently from e544b1b to 7730c4d Compare December 5, 2020 16:22
@wolfgangwalther wolfgangwalther changed the title Config aliases Rename config settings with fallback aliases Dec 5, 2020
@steve-chavez
Copy link
Member

LGTM!

Just tried omitting db-schemas. And it shows:

Error parsing config file:
        missing key: either db-schemas or db-schema must be set

Which is great! I also like the new reqWithAlias and optWithAlias functions.

* secret-is-base64 -> jwt-secret-is-base64
* role-claim-key -> jwt-role-claim-key
* max-rows -> db-max-rows
* pre-request -> db-pre-request
* root-spec -> db-root-spec
* db-schema -> db-schemas

This is not a breaking change, because aliases are added as well.

refactor: sorted all config keys alphabetically where applicable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants