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

[SHIRO-552] Support base64 encoded salt in JdbcRealm #138

Merged
merged 1 commit into from
Aug 2, 2019

Conversation

steinarb
Copy link
Contributor

This fixes SPAP-552

The change has been tested in https://github.com/steinarb/authservice/ and worked as a drop in replacement for the existing AuthserviceDbRealm

Note that the change makes JdbcRealm expect salt to be base64 encoded by default. It is possible to get the original behaviour back, by setting the JdbcRealm saltIsBase64Encoded property to false.

@bdemers bdemers changed the base branch from 1.4.x to master May 29, 2019 20:41
@bdemers bdemers changed the base branch from master to 1.4.x May 29, 2019 20:41
@bdemers
Copy link
Member

bdemers commented May 29, 2019

@steinarb can you rebase your branch against master?

@asfgit
Copy link

asfgit commented May 29, 2019

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Shiro-pr/91/

@asfgit
Copy link

asfgit commented May 29, 2019

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Shiro-pr/92/

@asfgit
Copy link

asfgit commented May 29, 2019

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Shiro-pr/93/

@steinarb steinarb force-pushed the shiro-jdbcrealm-bas64-coded-salt branch from 55e6e93 to 7c8baad Compare May 29, 2019 23:27
@steinarb
Copy link
Contributor Author

@bdemers I have rebased the branch against master and force-pushed (but I'm not really sure what the force push did to the pull request...?).

@asfgit
Copy link

asfgit commented May 30, 2019

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Shiro-pr/94/

@bdemers bdemers changed the base branch from 1.4.x to master May 30, 2019 13:15
@bdemers
Copy link
Member

bdemers commented May 30, 2019

Thanks @steinarb! I just retargeted the PR against master (it was 1.4 previously)

@@ -247,7 +261,11 @@ protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken token)
info = new SimpleAuthenticationInfo(username, password.toCharArray(), getName());

if (salt != null) {
info.setCredentialsSalt(ByteSource.Util.bytes(salt));
if (saltStyle == SaltStyle.COLUMN && saltIsBase64Encoded) {
info.setCredentialsSalt(ByteSource.Util.bytes(Base64.decode(salt)));
Copy link
Member

@bdemers bdemers May 30, 2019

Choose a reason for hiding this comment

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

We could probably decode this once in setSaltIsBase64Encoded() and reduce the branch here
scratch that, i was miss reading this whole thing... (still need some caffeine)

@bdemers
Copy link
Member

bdemers commented May 30, 2019

@steinarb Looks good to me! can you sign an Apache CLA? https://www.apache.org/licenses/#contributor-license-agreements

@asfgit
Copy link

asfgit commented May 30, 2019

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Shiro-pr/96/

@steinarb
Copy link
Contributor Author

@steinarb Looks good to me! can you sign an Apache CLA? https://www.apache.org/licenses/#contributor-license-agreements

@bdemers I have filled out the ICLA PDF and printed it to another PDF and signed the result with gpg and sent both the PDF and the asc to secretary@apache.org (I wasn't able to fill out anything in the signature field in the PDF but I assume the .asc takes care of that...?)

@bdemers
Copy link
Member

bdemers commented May 30, 2019

@steinarb yup, you should be all set!
Thanks again!!

@fpapon
Copy link
Member

fpapon commented Jul 27, 2019

Hi @steinarb , any update about the ICLA?

@steinarb
Copy link
Contributor Author

Hi @steinarb , any update about the ICLA?

Hi @fpapon I understood from the comment by @bdemers above that it was OK...?

In my INBOX there's received an automated response from secretary@apache.org, received 8 weeks ago, saying that "If you have been invited as a committer, please advise the (P)PMC that your ICLA has been filed."

@fpapon
Copy link
Member

fpapon commented Jul 27, 2019

@steinarb ok, thanks!

@steinarb
Copy link
Contributor Author

steinarb commented Aug 2, 2019

@bdemers @fpapon Should I resolve the conflict and re-push?

@fpapon
Copy link
Member

fpapon commented Aug 2, 2019

@steinarb yes, thanks!

@steinarb steinarb force-pushed the shiro-jdbcrealm-bas64-coded-salt branch from 7c8baad to 2b4594e Compare August 2, 2019 15:53
@steinarb
Copy link
Contributor Author

steinarb commented Aug 2, 2019

@fpapon rebased, conflict resolved, built with "mvn clean install" with no errors, and branch force-pushed

@asf-ci
Copy link
Contributor

asf-ci commented Aug 2, 2019

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Shiro-pr/155/

@fpapon fpapon changed the title Support base64 encoded salt in JdbcRealm [SHIRO-552] Support base64 encoded salt in JdbcRealm Aug 2, 2019
@fpapon fpapon self-requested a review August 2, 2019 19:05
Copy link
Member

@fpapon fpapon left a comment

Choose a reason for hiding this comment

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

LGTM!
@steinarb thanks!

@fpapon fpapon merged commit 010e456 into apache:master Aug 2, 2019
@steinarb steinarb deleted the shiro-jdbcrealm-bas64-coded-salt branch August 2, 2019 22:00
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.

5 participants