Skip to content

Conversation

danish9039
Copy link
Contributor

Which problem is this PR solving?

part of

Description of the changes

Chnages

  • Moved basic auth from elastic.SetBasicAuth() to HTTP transport layer

  • Pre-encodes credentials as base64 in TokenFn for performance

  • Reuses existingTokenProviderinfrastructure for file-based password reloading

  • Added ReloadInterval field to BasicAuthentication struct

  • New CLI flag: --es.password-reload-interval (default: 10s)

How was this change tested?

Checklist

Signed-off-by: danish9039 <danishsiddiqui040@gmail.com>
@danish9039 danish9039 requested a review from a team as a code owner July 27, 2025 14:18
@danish9039 danish9039 requested a review from mahadzaryab1 July 27, 2025 14:18
@dosubot dosubot bot added the area/storage label Jul 27, 2025
Copy link

codecov bot commented Jul 27, 2025

Codecov Report

❌ Patch coverage is 95.16129% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.45%. Comparing base (9e93d83) to head (318e406).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...ternal/storage/elasticsearch/config/auth_helper.go 92.50% 2 Missing and 1 partial ⚠️
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     
Flag Coverage Δ
badger_v1 9.08% <0.00%> (-0.04%) ⬇️
badger_v2 1.71% <0.00%> (-0.01%) ⬇️
cassandra-4.x-v1-manual 11.79% <0.00%> (-0.05%) ⬇️
cassandra-4.x-v2-auto 1.71% <0.00%> (-0.01%) ⬇️
cassandra-4.x-v2-manual 1.71% <0.00%> (-0.01%) ⬇️
cassandra-5.x-v1-manual 11.79% <0.00%> (-0.05%) ⬇️
cassandra-5.x-v2-auto 1.71% <0.00%> (-0.01%) ⬇️
cassandra-5.x-v2-manual 1.71% <0.00%> (-0.01%) ⬇️
elasticsearch-6.x-v1 16.74% <0.00%> (-0.07%) ⬇️
elasticsearch-7.x-v1 16.79% <0.00%> (-0.07%) ⬇️
elasticsearch-8.x-v1 16.93% <0.00%> (-0.07%) ⬇️
elasticsearch-8.x-v2 1.71% <0.00%> (-0.10%) ⬇️
elasticsearch-9.x-v2 1.71% <0.00%> (-0.01%) ⬇️
grpc_v1 10.31% <0.00%> (-0.04%) ⬇️
grpc_v2 1.71% <0.00%> (-0.01%) ⬇️
kafka-3.x-v1 9.24% <0.00%> (-0.04%) ⬇️
kafka-3.x-v2 1.71% <0.00%> (-0.01%) ⬇️
memory_v2 1.71% <0.00%> (-0.01%) ⬇️
opensearch-1.x-v1 16.83% <0.00%> (-0.07%) ⬇️
opensearch-2.x-v1 16.83% <0.00%> (-0.07%) ⬇️
opensearch-2.x-v2 1.71% <0.00%> (-0.01%) ⬇️
opensearch-3.x-v2 1.71% <0.00%> (-0.01%) ⬇️
query 1.71% <0.00%> (-0.01%) ⬇️
tailsampling-processor 0.47% <0.00%> (-0.01%) ⬇️
unittests 95.43% <95.16%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: danish9039 <danishsiddiqui040@gmail.com>
@yurishkuro yurishkuro added the changelog:refactoring Internal code refactoring without functional changes label Jul 27, 2025
return initBasicAuthWithTime(basicAuth, logger, time.Now)
}

func initBasicAuthWithTime(basicAuth *BasicAuthentication, logger *zap.Logger, timeFn func() time.Time) (*auth.Method, error) {
Copy link
Member

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.

Copy link
Contributor Author

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

@yurishkuro
Copy link
Member

Can you bump the code coverage?

@danish9039
Copy link
Contributor Author

Can you bump the code coverage?

yeah sure ! working on it

@yurishkuro yurishkuro added this pull request to the merge queue Jul 29, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 29, 2025
@yurishkuro yurishkuro added this pull request to the merge queue Jul 29, 2025
Merged via the queue into jaegertracing:main with commit b815af5 Jul 29, 2025
62 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/storage changelog:refactoring Internal code refactoring without functional changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants