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

[Broker] Fix prefix setting in JWT authn and avoid multi calls for the getProperty #12132

Merged
merged 2 commits into from
Nov 5, 2021

Conversation

RobertIndie
Copy link
Member

Motivation

Currently, the setting prefix for JWT authentication does not work because the code does not specify the property name for the token setting prefix.

Modifications

  • Add token setting prefix property name: tokenSettingPrefix.
  • Avoid multi calls for the getProperty in JWT authn.

Verifying this change

This change is already covered by the existing test, such as testTokenSettingPrefix.

Documentation

Check the box below and label this PR (if you have committer privilege).

Need to update docs?

  • doc-required

@Anonymitaet Anonymitaet added the doc-required Your PR changes impact docs and you will update later. label Sep 23, 2021
@Anonymitaet
Copy link
Member

@RobertIndie Thanks for your contribution. Please do not forget to add docs accordingly to allow users to know your great code changes. And you can ping me to review the docs, thanks.

@RobertIndie
Copy link
Member Author

@RobertIndie Thanks for your contribution. Please do not forget to add docs accordingly to allow users to know your great code changes. And you can ping me to review the docs, thanks.

I have created a PR: #12152 for doc. PTAL

@RobertIndie
Copy link
Member Author

/pulsarbot run-failure-checks

@eolivelli eolivelli modified the milestones: 2.9.0, 2.10.0 Oct 6, 2021
@Anonymitaet Anonymitaet removed the doc-required Your PR changes impact docs and you will update later. label Oct 11, 2021
Signed-off-by: Zike Yang <ar@armail.top>
@RobertIndie
Copy link
Member Author

/pulsarbot run-failure-checks

@@ -54,7 +54,7 @@
static final String HTTP_HEADER_VALUE_PREFIX = "Bearer ";

// When symmetric key is configured
static final String CONF_TOKEN_SETTING_PREFIX = "";
static final String CONF_TOKEN_SETTING_PREFIX = "tokenSettingPrefix";
Copy link
Contributor

Choose a reason for hiding this comment

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

Will there be compatibility issues here? After the upgrade, the previous token cannot be used

Copy link
Member Author

@RobertIndie RobertIndie Nov 1, 2021

Choose a reason for hiding this comment

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

No compatibility issues will be introduced here. The tokenSettingPrefix is empty by default.

@315157973
Copy link
Contributor

@RobertIndie PTAL

@315157973 315157973 merged commit b9a250d into apache:master Nov 5, 2021
codelipenghui pushed a commit that referenced this pull request Nov 5, 2021
…e getProperty (#12132)

Motivation
Currently, the setting prefix for JWT authentication does not work because the code does not specify the property name for the token setting prefix.

Modifications
Add token setting prefix property name: tokenSettingPrefix.
Avoid multi calls for the getProperty in JWT auth.
Verifying this change
This change is already covered by the existing test, such as testTokenSettingPrefix.

(cherry picked from commit b9a250d)
@codelipenghui codelipenghui added the cherry-picked/branch-2.8 Archived: 2.8 is end of life label Nov 5, 2021
@Anonymitaet Anonymitaet added the doc-complete Your PR changes impact docs and the related docs have been already added. label Nov 8, 2021
eolivelli pushed a commit to eolivelli/pulsar that referenced this pull request Nov 29, 2021
…e getProperty (apache#12132)

Motivation
Currently, the setting prefix for JWT authentication does not work because the code does not specify the property name for the token setting prefix.

Modifications
Add token setting prefix property name: tokenSettingPrefix.
Avoid multi calls for the getProperty in JWT auth.
Verifying this change
This change is already covered by the existing test, such as testTokenSettingPrefix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-picked/branch-2.8 Archived: 2.8 is end of life doc-complete Your PR changes impact docs and the related docs have been already added. release/2.8.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants