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

[Minor] Refactor the client Authenticators for the new "ClientAuthenticator" interfaces #5905

Merged
merged 3 commits into from
Oct 26, 2021
Merged

[Minor] Refactor the client Authenticators for the new "ClientAuthenticator" interfaces #5905

merged 3 commits into from
Oct 26, 2021

Conversation

pavankrish123
Copy link
Contributor

@pavankrish123 pavankrish123 commented Oct 25, 2021

Description:

As a part of Removing protocol specific client authentication interfaces (open-telemetry/opentelemetry-collector#4239) client authenticators will have to implement top level "ClientAuthenticator" which now comprises of all the protocol interfaces.

This PR does some minor adjustments to implementations and removes explicit references to old protocol specific interface types and implements NoOps for missing methods

Link to tracking Issue: #5904

Testing

  • Minor refactoring - Unit Tests

Note that this PR can be merged regardless of the core PR because of Go's implicit way of treating interfaces.

@pavankrish123 pavankrish123 requested a review from a team as a code owner October 25, 2021 20:05
@pavankrish123 pavankrish123 changed the title [Minor] Refactor the client Authenticators to account for the new "ClientAuthenticator" interfaces [Minor] Refactor the client Authenticators for the new "ClientAuthenticator" interfaces Oct 25, 2021
@pavankrish123
Copy link
Contributor Author

@jpkrohling please review this. Thank you.

var _ configauth.GRPCClientAuthenticator = (*BearerTokenAuth)(nil)
var (
_ configauth.ClientAuthenticator = (*BearerTokenAuth)(nil)
errNotHTTPClientAuthenticator = errors.New("requested authenticator is not a HTTP client authenticator")
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't this extension usable, or otherwise should be usable, with gRPC or HTTP? A bearer token is a common concept of HTTP. What is the future direction for the extension?

Copy link
Member

Choose a reason for hiding this comment

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

It should be usable with both

Copy link
Member

Choose a reason for hiding this comment

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

Also, the formatting of these two lines is a bit odd. I think it would be better to have two lines starting with var instead of grouping them together.

@bogdandrutu bogdandrutu merged commit fc0caf5 into open-telemetry:main Oct 26, 2021
@pavankrish123 pavankrish123 deleted the refactor/client_auth branch October 27, 2021 06:55
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.

None yet

4 participants