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

Implement default server authenticators #4558

Merged
merged 3 commits into from
Jan 3, 2022

Conversation

jpkrohling
Copy link
Member

Allow the interfaces to be extended without affecting implementations by allowing authenticators to provide which functions to override.

This is a non-breaking change, and current implementations might be changed in the future to use this.

Fixes #4556

Signed-off-by: Juraci Paixão Kröhling [email protected]

@codecov
Copy link

codecov bot commented Dec 15, 2021

Codecov Report

Merging #4558 (7999592) into main (3db1d11) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4558      +/-   ##
==========================================
+ Coverage   90.25%   90.26%   +0.01%     
==========================================
  Files         181      181              
  Lines       10595    10613      +18     
==========================================
+ Hits         9562     9580      +18     
  Misses        805      805              
  Partials      228      228              
Impacted Files Coverage Δ
config/configauth/default_serverauthenticator.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3db1d11...7999592. Read the comment docs.

componenthelper.ShutdownFunc
}

// WithAuthenticate
Copy link
Member Author

Choose a reason for hiding this comment

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

If the general direction looks good, I'll work on the godoc.

host := &mockHost{
ext: map[config.ComponentID]component.Extension{
config.NewComponentID("mock"): &configauth.MockServerAuthenticator{
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a good example of how consumers would be able to use this. I like the new approach, especially as it allows consumers to omit specifying the default implementations to use, like demonstrated by the removal of line 785.

@jpkrohling
Copy link
Member Author

Interesting, the changelog check is failing even though there's a changelog entry...

@jpkrohling
Copy link
Member Author

Rebased.

@jpkrohling
Copy link
Member Author

@bogdandrutu, can you take a quick look and see if this is roughly the direction you wanted it to go? If so, I'll add godoc and ask @codeboten to review this.

@jpkrohling jpkrohling marked this pull request as draft December 20, 2021 09:49
@jpkrohling
Copy link
Member Author

I'm converting this to draft, as we would probably re-evaluate this after #4583.

@jpkrohling
Copy link
Member Author

@bogdandrutu, @pavankrish123, do you still see the need for this PR? The interface now has only one function on its own (Authenticate), plus the ones from the component interface.

In any case, I updated this PR to remove the interceptor functions as a follow-up from #4582.

@jpkrohling jpkrohling marked this pull request as ready for review December 21, 2021 09:54
@jpkrohling
Copy link
Member Author

While the contrib test failures are related to the same area, I don't think they are caused by this PR. Once open-telemetry/opentelemetry-collector-contrib#6922 is merged, I'lll trigger the build again and see how it goes.

@bogdandrutu
Copy link
Member

@jpkrohling I like it, please move forward with this. Also consider to enforce everyone using the framework by adding a private func, this way we can extend the interface in the future.

Allow the interfaces to be extended without affecting implementations by allowing authenticators to provide which functions to override.

This is a non-breaking change, and current implementations might be changed in the future to use this.

Fixes open-telemetry#4556

Signed-off-by: Juraci Paixão Kröhling <[email protected]>
Signed-off-by: Juraci Paixão Kröhling <[email protected]>
Signed-off-by: Juraci Paixão Kröhling <[email protected]>
@jpkrohling jpkrohling force-pushed the jpkrohling/issue4556 branch from b6f0c01 to 7999592 Compare January 3, 2022 14:18
@jpkrohling
Copy link
Member Author

Also consider to enforce everyone using the framework by adding a private func

Sorry, could you expand on this?

I just updated this PR with the missing godoc and I think this is now ready to be merged.

@bogdandrutu bogdandrutu merged commit 51fcb65 into open-telemetry:main Jan 3, 2022
jpkrohling added a commit to jpkrohling/opentelemetry-collector that referenced this pull request Feb 10, 2022
Similar to open-telemetry#4558, this allows client authenticators to be created without having to implement all the functions from the ClientAuthenticator interface.

This is non-breaking change.

Fixes open-telemetry#4557

Signed-off-by: Juraci Paixão Kröhling <[email protected]>
jpkrohling added a commit to jpkrohling/opentelemetry-collector that referenced this pull request Feb 10, 2022
Similar to open-telemetry#4558, this allows client authenticators to be created without having to implement all the functions from the ClientAuthenticator interface.

This is non-breaking change.

Fixes open-telemetry#4557

Signed-off-by: Juraci Paixão Kröhling <[email protected]>
jpkrohling added a commit to jpkrohling/opentelemetry-collector that referenced this pull request Feb 17, 2022
Similar to open-telemetry#4558, this allows client authenticators to be created without having to implement all the functions from the ClientAuthenticator interface.

This is non-breaking change.

Fixes open-telemetry#4557

Signed-off-by: Juraci Paixão Kröhling <[email protected]>
jpkrohling added a commit to jpkrohling/opentelemetry-collector that referenced this pull request Mar 10, 2022
Similar to open-telemetry#4558, this allows client authenticators to be created without having to implement all the functions from the ClientAuthenticator interface.

This is non-breaking change.

Fixes open-telemetry#4557

Signed-off-by: Juraci Paixão Kröhling <[email protected]>
codeboten pushed a commit that referenced this pull request Mar 11, 2022
* Implement default client authenticators

Similar to #4558, this allows client authenticators to be created without having to implement all the functions from the ClientAuthenticator interface.

This is non-breaking change.

Fixes #4557

Signed-off-by: Juraci Paixão Kröhling <[email protected]>
Nicholaswang pushed a commit to Nicholaswang/opentelemetry-collector that referenced this pull request Jun 7, 2022
* Implement default client authenticators

Similar to open-telemetry#4558, this allows client authenticators to be created without having to implement all the functions from the ClientAuthenticator interface.

This is non-breaking change.

Fixes open-telemetry#4557

Signed-off-by: Juraci Paixão Kröhling <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement default server authenticators, where functions can be overridden
2 participants