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

Fix the Base64-decoder failing if JWT_SECRET is not provided #1118

Merged
merged 1 commit into from
Sep 3, 2021

Conversation

burmanm
Copy link
Collaborator

@burmanm burmanm commented Sep 2, 2021

If the JWT_SECRET is not specified, rest of the signing options are expected to be in Base64-format (which they're not). This modification requires only the JWT_SECRET to be in Base64-format, rest are not decoded anymore.

This should also fix #767 since the shortest Base64 string is 4 characters.

The Base64.getDecoder() is more strict and as such, this will test if those inputs are really Base64 or not (and current tests are enough to test this new behavior).

@codecov
Copy link

codecov bot commented Sep 2, 2021

Codecov Report

Merging #1118 (676958e) into master (a13eb66) will decrease coverage by 0.29%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1118      +/-   ##
==========================================
- Coverage   74.27%   73.98%   -0.30%     
==========================================
  Files         133      133              
  Lines        9786     9788       +2     
  Branches     1018     1018              
==========================================
- Hits         7269     7242      -27     
- Misses       1926     1951      +25     
- Partials      591      595       +4     
Impacted Files Coverage Δ
...ssandrareaper/resources/auth/ShiroJwtProvider.java 56.25% <66.66%> (-0.90%) ⬇️
...va/io/cassandrareaper/storage/PostgresStorage.java 70.72% <0.00%> (-4.57%) ⬇️
.../io/cassandrareaper/service/SchedulingManager.java 69.07% <0.00%> (-1.98%) ⬇️
...main/java/io/cassandrareaper/jmx/JmxProxyImpl.java 53.44% <0.00%> (-0.72%) ⬇️
...java/io/cassandrareaper/service/RepairManager.java 77.43% <0.00%> (-0.45%) ⬇️
...java/io/cassandrareaper/service/SegmentRunner.java 76.81% <0.00%> (-0.23%) ⬇️
...a/io/cassandrareaper/storage/CassandraStorage.java 83.34% <0.00%> (ø)
.../java/io/cassandrareaper/service/RepairRunner.java 83.73% <0.00%> (+1.20%) ⬆️

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 a13eb66...676958e. Read the comment docs.

Copy link
Member

@michaelsembwever michaelsembwever left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @burmanm

@burmanm burmanm merged commit 15fdd56 into thelastpickle:master Sep 3, 2021
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.

Reaper not starting if cluster name is shorter than 4 characters
3 participants