-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Refactor Basic Authentication to HTTP Transport Layer #7388
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
Signed-off-by: danish9039 <danishsiddiqui040@gmail.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7388 +/- ##
==========================================
- Coverage 96.46% 96.45% -0.02%
==========================================
Files 375 375
Lines 22878 22919 +41
==========================================
+ Hits 22070 22106 +36
- Misses 611 615 +4
- Partials 197 198 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
return initBasicAuthWithTime(basicAuth, logger, time.Now) | ||
} | ||
|
||
func initBasicAuthWithTime(basicAuth *BasicAuthentication, logger *zap.Logger, timeFn func() time.Time) (*auth.Method, error) { |
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.
Q: why does this file belong under elasticsearch instead of internal/auth? I don't see anything specific to ES in this whole file.
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.
Q: why does this file belong under elasticsearch instead of internal/auth? I don't see anything specific to ES in this whole file.
@yurishkuro I think we should keep this here , moving this under internal/auth
would result in cyclic import issue due to authentication type dependencies , avoiding cyclic dependency was the initial motivation for placing this file here
Can you bump the code coverage? |
yeah sure ! working on it |
Signed-off-by: danish9039 <danishsiddiqui040@gmail.com>
Which problem is this PR solving?
part of
Description of the changes
Refactors Elasticsearch basic authentication from client-level initialization to HTTP transport layer, enabling hot password reloading and consistent authentication patterns. Add bearer token reloading and reuse in multiple storage backends #7360 (comment)
It is part of the planned work to add support for API authentication, as discussed in Elasticsearch support for API Keys #7230 (comment)
Chnages
Moved basic auth from
elastic.SetBasicAuth()
to HTTP transport layerPre-encodes credentials as base64 in
TokenFn
for performanceReuses existing
TokenProvider
infrastructure for file-based password reloadingAdded
ReloadInterval
field toBasicAuthentication
structNew CLI flag:
--es.password-reload-interval
(default: 10s)How was this change tested?
Checklist
jaeger
:make lint test
jaeger-ui
:npm run lint
andnpm run test