Skip to content
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

Add Flag for Custom Authenticators in Cassandra Storage #5628

Merged
merged 12 commits into from
Jun 18, 2024

Conversation

hellspawn679
Copy link
Contributor

Which problem is this PR solving?

Description of the changes

  • added defaultApprovedAuthenticators

How was this change tested?

Checklist

Signed-off-by: mehul gautam <mehulsharma4786@gmail.com>
@hellspawn679 hellspawn679 requested a review from a team as a code owner June 14, 2024 20:58
Copy link

codecov bot commented Jun 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.36%. Comparing base (60c2efb) to head (82204d4).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5628      +/-   ##
==========================================
+ Coverage   96.34%   96.36%   +0.01%     
==========================================
  Files         327      327              
  Lines       16016    16026      +10     
==========================================
+ Hits        15431    15443      +12     
+ Misses        407      405       -2     
  Partials      178      178              
Flag Coverage Δ
badger_v1 8.04% <0.00%> (-0.01%) ⬇️
badger_v2 1.93% <0.00%> (-0.01%) ⬇️
cassandra-3.x-v1 16.60% <100.00%> (+0.14%) ⬆️
cassandra-3.x-v2 1.85% <0.00%> (-0.01%) ⬇️
cassandra-4.x-v1 16.60% <100.00%> (+0.14%) ⬆️
cassandra-4.x-v2 1.85% <0.00%> (-0.01%) ⬇️
elasticsearch-7.x-v1 18.86% <0.00%> (-0.04%) ⬇️
elasticsearch-8.x-v1 19.06% <0.00%> (-0.02%) ⬇️
elasticsearch-8.x-v2 19.05% <0.00%> (-0.04%) ⬇️
grpc_v1 9.47% <0.00%> (+<0.01%) ⬆️
grpc_v2 7.52% <0.00%> (-0.01%) ⬇️
kafka 9.76% <0.00%> (-0.02%) ⬇️
opensearch-1.x-v1 18.91% <0.00%> (-0.04%) ⬇️
opensearch-2.x-v1 18.92% <0.00%> (-0.03%) ⬇️
opensearch-2.x-v2 18.91% <0.00%> (-0.04%) ⬇️
unittests 94.20% <75.00%> (-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.

Signed-off-by: mehul gautam <mehulsharma4786@gmail.com>
@hellspawn679
Copy link
Contributor Author

@yurishkuro where can i add cli flags ? can you specify the file location where we define flags for cassendra ?

Signed-off-by: mehul gautam <mehulsharma4786@gmail.com>
Signed-off-by: mehul gautam <mehulsharma4786@gmail.com>
Signed-off-by: mehul gautam <mehulsharma4786@gmail.com>
@hellspawn679
Copy link
Contributor Author

@yurishkuro where is this pkg/cassandra/config/config.go is being tested?

@yurishkuro
Copy link
Member

please write PR title according to the contributing guidelines

@hellspawn679 hellspawn679 changed the title added more options auth for cassandra Added flag for custom authenticators for jaeger cassandra storage Jun 16, 2024
@hellspawn679 hellspawn679 changed the title Added flag for custom authenticators for jaeger cassandra storage Add Flag for Custom Authenticators in Jaeger Cassandra Storage Jun 16, 2024
@hellspawn679
Copy link
Contributor Author

please write PR title according to the contributing guidelines

done

@yurishkuro yurishkuro changed the title Add Flag for Custom Authenticators in Jaeger Cassandra Storage Add Flag for Custom Authenticators in Cassandra Storage Jun 16, 2024
Signed-off-by: mehul gautam <mehulsharma4786@gmail.com>
Signed-off-by: mehul gautam <mehulsharma4786@gmail.com>
Signed-off-by: mehul gautam <mehulsharma4786@gmail.com>
pkg/cassandra/config/config.go Outdated Show resolved Hide resolved
plugin/storage/cassandra/options.go Outdated Show resolved Hide resolved
Basic BasicAuthenticator `yaml:"basic" mapstructure:",squash"`
// TODO: add more auth types
Basic BasicAuthenticator `yaml:"basic" mapstructure:",squash"`
AllowedAuthenticators []string `yaml:"allowed_authenticators" mapstructure:"allowed_authenticators"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AllowedAuthenticators should be inside BasicAuthenticator struct. And lets add a comment to it

// The comma-separated list of allowed password authenticators for Cassandra.
// If none are specified, there is a default "approved" list that is used
//    https://github.com/gocql/gocql/blob/34fdeebefcbf183ed7f916f931aa0586fdaa1b40/conn.go#L27
// If a non-empty list is provided, only specified authenticators are allowed.
// See also https://github.com/jaegertracing/jaeger/issues/5627#issuecomment-2174454633

plugin/storage/cassandra/options.go Outdated Show resolved Hide resolved
Signed-off-by: mehul gautam <mehulsharma4786@gmail.com>
@@ -62,6 +62,9 @@ func (*CassandraStorageIntegration) initializeCassandraFactory(t *testing.T, fla

func (s *CassandraStorageIntegration) initializeCassandra(t *testing.T) {
f := s.initializeCassandraFactory(t, []string{
"--cassandra.basic.allowed-authenticators=",
"--cassandra.password=password",
"--cassandra.username=username",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why does this work? Are these the default values for username/password in Cassandra image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I think it's because we have no auth configured on the server, so the extra auth client might send is just getting ignored.

@yurishkuro yurishkuro merged commit c33abab into jaegertracing:main Jun 18, 2024
40 checks passed
@yurishkuro yurishkuro mentioned this pull request Jun 18, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants