-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Separate logging options out of main options structure #548
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
Conversation
a0bf89b
to
68ea6b3
Compare
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.
Should we be adding tests for this code?
CHANGELOG.md
Outdated
|
||
## Changes since v5.1.1 | ||
|
||
- [#548](https://github.com/oauth2-proxy/oauth2-proxy/pull/548) Move logging options out of main package (@JoelSpeed) |
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.
This isn't quite correct. Shouldn't it be "Splitting logging options from global options structure"
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.
Rebase problems 😅 Will fix
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.
Technically it's all covered by the existing tests, but I will make sure to add some tests specifically for the logging validation. Will need to see how easy it is to actually test this though as a lot of the options set private members 🤔
CHANGELOG.md
Outdated
|
||
## Changes since v5.1.1 | ||
|
||
- [#548](https://github.com/oauth2-proxy/oauth2-proxy/pull/548) Move logging options out of main package (@JoelSpeed) |
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.
Rebase problems 😅 Will fix
68ea6b3
to
df47cab
Compare
@steakunderscore I've had a look at doing testing for this, ideally I would like to have the It's made me realise that the Note, I also added an extra commit onto the end of this because I noticed the exclude paths option was inconsistent with our other options |
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.
I'm happy for tests to come later. Thanks.
6755c19
to
94e31f8
Compare
Rebased to fixup changelog conflict, no other changes, so going to treat this as already approved |
Description
Creates a
LoggingOptions
struct and moves all details required for configuring Logging to this struct, plus a LoggingFlagSet, plus a Default function.Motivation and Context
This is a step towards having a structured configuration. We can move options internally without breaking the external config while we try and create a structure that we are happy with.
I've added a test that checks the defaulting when no options are given, but this will eventually be covered by the tests in #489 once that is merged
How Has This Been Tested?
It's a refactor of internal code, tests pass so all should be fine.
Checklist: