-
Notifications
You must be signed in to change notification settings - Fork 5.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
Http plugin add cookie auth #9395
Http plugin add cookie auth #9395
Conversation
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.
Hey @jh125486, thanks for tackling this issue!
The code, with one exeception, looks good with only minor issues (see my comments in the code). However, I have a big concern reusing the http client for the cookie authentication as you are also reusing e.g. username and password with a URL potentially different to the settings in urls
. This might leak sensible data.
Furthermore, I ask myself if this new feature wouldn't be a good candidate to add to plugins/common/http
so it can be reused by other plugins as well. Do you think this makes sense?
I can move it to Regarding the |
updated both plugins/inputs/http and plugins/outputs/http sample config/READMEs
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.
Wow that's really nice. I have some more comments and questions, but I think we are very close. Thanks for working on this!
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.
Almost. I had one idea about passing the auth()
errors to the caller using a non-blocking channel. Maybe you can check if this is doable.
Furthermore, I see the timing issues in your tests. While I do not have a good idea on how to do it correctly in your case, I fear flakey tests in later (unrelated) PRs (we have been there...).
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.
One more suggestion for allowing to omit the logging. There might be some plugins that do not have a logger.
Otherwise this looks good.
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.
Looks good to me. Thanks @jh125486 for working hard to get this PR to the current state!
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.
Thanks for the PR, looks good. I think it would be useful if you could provide more information in the readme as to the use-case of this. So new users can understand why they might want to use verses when they don't need to use this setting.
The |
@jh125486 I guess @helenosheaa wants a small section of text in
|
Correct, so what should the name of that section be? |
@jh125486 perhaps - Optional Cookie Authentication Settings: with the explanation and an example config. |
Looks like new artifacts were built from this PR. Get them here!Artifact URLs |
This is looking great so far! Can you please add a sample config? Also, is there any way to make your optional cookie authentication section a little shorter? It seems a touch wordy. |
|
@MyaLongmire there is the usual sample-config part in the |
Required for all PRs:
resolves #5932
inputs.http
cookie auth:auth url
body
method
refresh interval
Init()
, a initial auth is attempted and is successful, a Go routine is fired off for cookie auth renewal