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

[Authentication] Support chained authentication with same auth method name #9094

Merged
merged 8 commits into from Jan 5, 2021

Conversation

sijie
Copy link
Member

@sijie sijie commented Dec 30, 2020

Motivation

Chained authentication is a very useful mechanism for migrating a cluster from
one authentication provider to the other authentication provider. However,
Pulsar doesn't support configuring multiple authentication providers with same
auth method name.

For example, a Pulsar cluster was using standard JWT authentication initially.
The users want to upgrade the Pulsar cluster to use an OAuth2 authentication
mechanism. But both JWT and OAuth2 share the same authentication method name.

This change improves the authentication logic to support chained authentication
with same auth method name.

… name

*Motivation*

Chained authentication is a very useful mechanism for migrating a cluster from
one authentication provider to the other authentication provider. However,
Pulsar doesn't support configuring multiple authentication providers with same
auth method name.

For example, a Pulsar cluster was using standard JWT authentication initially.
The users want to upgrade the Pulsar cluster to use an OAuth2 authentication
mechanism. But both JWT and OAuth2 share the same authentication method name.

This change improves the authentication logic to support chained authentication
with same auth method name.
Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

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

Nice feature

LGTM

@jiazhai
Copy link
Member

jiazhai commented Dec 30, 2020

/pulsarbot run-failure-checks

1 similar comment
@codelipenghui
Copy link
Contributor

/pulsarbot run-failure-checks

@sijie
Copy link
Member Author

sijie commented Dec 30, 2020

/pulsarbot run-failure-checks

3 similar comments
@sijie
Copy link
Member Author

sijie commented Dec 31, 2020

/pulsarbot run-failure-checks

@codelipenghui
Copy link
Contributor

/pulsarbot run-failure-checks

@jiazhai
Copy link
Member

jiazhai commented Jan 1, 2021

/pulsarbot run-failure-checks

@codelipenghui
Copy link
Contributor

/pulsarbot run-failure-checks

1 similar comment
@codelipenghui
Copy link
Contributor

/pulsarbot run-failure-checks

@codelipenghui
Copy link
Contributor

@sijie There is a failed test, please take a look

Error:  Tests run: 3, Failures: 1, Errors: 0, Skipped: 1, Time elapsed: 26.913 s <<< FAILURE! - in org.apache.pulsar.broker.authentication.SaslAuthenticateTest
Error:  testSaslServerAndClientAuth(org.apache.pulsar.broker.authentication.SaslAuthenticateTest)  Time elapsed: 0.011 s  <<< FAILURE!
java.lang.ClassCastException: org.apache.pulsar.broker.authentication.AuthenticationProviderList cannot be cast to org.apache.pulsar.broker.authentication.AuthenticationProviderSasl
	at org.apache.pulsar.broker.authentication.SaslAuthenticateTest.testSaslServerAndClientAuth(SaslAuthenticateTest.java:256)

@sijie
Copy link
Member Author

sijie commented Jan 4, 2021

@codelipenghui I have just pushed a change to fix the test.

@sijie
Copy link
Member Author

sijie commented Jan 4, 2021

/pulsarbot run-failure-checks

@sijie sijie merged commit c2a4e66 into apache:master Jan 5, 2021
codelipenghui pushed a commit that referenced this pull request Jan 6, 2021
… name (#9094)

*Motivation*

Chained authentication is a very useful mechanism for migrating a cluster from
one authentication provider to the other authentication provider. However,
Pulsar doesn't support configuring multiple authentication providers with same
auth method name.

For example, a Pulsar cluster was using standard JWT authentication initially.
The users want to upgrade the Pulsar cluster to use an OAuth2 authentication
mechanism. But both JWT and OAuth2 share the same authentication method name.

This change improves the authentication logic to support chained authentication
with same auth method name.

(cherry picked from commit c2a4e66)
@codelipenghui codelipenghui added the cherry-picked/branch-2.7 Archived: 2.7 is end of life label Jan 7, 2021
codelipenghui pushed a commit that referenced this pull request Jan 7, 2021
… name (#9094)

*Motivation*

Chained authentication is a very useful mechanism for migrating a cluster from
one authentication provider to the other authentication provider. However,
Pulsar doesn't support configuring multiple authentication providers with same
auth method name.

For example, a Pulsar cluster was using standard JWT authentication initially.
The users want to upgrade the Pulsar cluster to use an OAuth2 authentication
mechanism. But both JWT and OAuth2 share the same authentication method name.

This change improves the authentication logic to support chained authentication
with same auth method name.

(cherry picked from commit c2a4e66)
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

4 participants