Feat/generic webhook ntlm auth#4316
Feat/generic webhook ntlm auth#4316Skarlso merged 2 commits intoexternal-secrets:mainfrom yifongau:feat/generic-webhook-ntlm-auth
Conversation
|
Hello. Could you please squash those 50 commits and sign it? :) Thank you! |
|
I am not sure these changes will work with |
|
|
Hi there! I squashed and rebuild my commits.
I am not sure what you mean, could yo clarify? I did not touch the generator code. |
|
The changes you made to common/webhook were there to support both generators webhook and SecretStore webhook. Because you also changed structures there, I’m not sure this would really work for that. I think it will actually |
Thanks for your response. We do not use the Generator feature, so I actually was not aware that code was shared between them. I will investigate. |
|
👍 Excellent work @yifongau 🥇 -- I've built this and tested -- it enables me to use NTLM-protected services (provided by Microsoft IIS) just fine. It seems recent commits landed in I've not noticed any panics as mentioned by reviewers here. |
|
Please fix the sonarcloud issue as well that now popped up because of the additional complexity. :) |
|
@gusfcarvalho I looked at the generator webhook and the tests are fine. Plus, because of the nil checks on the |
I'll review the sonarcloud and make appropriate changes! thx! |
I refactored the method that was flagged by SonarCloud. |
|
make reviewable throws some error at the helm templating step: Error: YAML parse error on external-secrets/templates-crds/clustersecretstore.yaml: error converting YAML to JSON: yaml: line 23: mapping values are not allowed in this context. Not sure what caused this, as this seems to be a generated file. Looking at line 23 it is not tripped by anything I modified. |
|
/ok-to-test sha=cd33836c0692ab9c91d9a56b3424641108043206 |
|
Heey! I see the dependency license check is failing (it seems to erroring out). Does this need to be addressed before it can be merged? If there is anything else I can do to expedite the merge, please let me know! |
|
@yifongau don't worry about it. Sadly, it keeps failing... |
Good to know... thanks! |
|
Just have a couple of questions and I see there are linter and unit test errors. Could you please take care of those, then this is LGTM and we can merge it. :) |
|
@yifongau This is almost done now. :) Just a quick couple of things and I can merge it. :) If you finish it today, I can get it into the release. :) |
Thanks for your comments. I just made the change you suggested and resolved those linting errors (had to copy some stuff to from esv1beta1 to esv1 and change the corresponding references). |
Signed-off-by: Yi Fong Au <yi-fong.au@stater.nl> refactored executeRequest method
regenerated docs Signed-off-by: Yi Fong Au <yi-fong.au@stater.nl>
|



Problem Statement
This pull requests adds support for NTLM authentication for the webhook provider. Useful for legacy environments.
Related Issue
No issue opened (if necessary I can create one, let me know).
Proposed Changes
The ntlm authentication is achieved through 3 changes:
If NTLM is used, add wrapper around Transport when creating the client through GetHTTPClient(). This wrapper is provided by the following library: https://github.com/Azure/go-ntlmssp. I tested two Go NTLM implementations, and found this one most suitable as it has the ability to respond both "Negotiate" and "NTLM" www-authenticate headers. There is another library (vadimi/go-http-ntlm) which is also good, but unfortunately only responds to "NTLM" www-authenticate headers. Unfortunately this does not fit our use case, and I suspect many other use cases.
If NTLM is used, set the authentication header when creating the request in GetWebhookData(). When performing the request, the wrapper reads the Authentication header, and uses it in the challenge-response action with the server.
I also made the changes for the types for webhook provider, such that users can use the NTLM authentication in the following way:
Please let me know if any other changes/improvements are necessary. Thank you!
Checklist
git commit --signoffmake testmake reviewable