Skip to content

remove Apache Commons Codec dependency#1256

Merged
bsideup merged 2 commits intomasterfrom
remove_commons_codec_from_api
Nov 17, 2019
Merged

remove Apache Commons Codec dependency#1256
bsideup merged 2 commits intomasterfrom
remove_commons_codec_from_api

Conversation

@bsideup
Copy link
Copy Markdown
Member

@bsideup bsideup commented Oct 6, 2019

After #1249, we can use Java's built-in Base64 support and remove the codec dependency completely


This change is Reviewable

@bsideup bsideup added this to the 3.2.0 milestone Oct 6, 2019
@bsideup bsideup requested a review from KostyaSha October 6, 2019 12:44
*/
public SecretSpec withData(String data) {
this.data = Base64.encodeBase64String(data.getBytes());
this.data = Base64.getEncoder().encodeToString(data.getBytes());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

we had issues with encoders, are they 100% same?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

if you had issues, why did you add a test? ;)

It should be. Any idea how to test?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Not sure with this case, but they are generally not same - with JDK encoder you have better API and you need only to select the right encoder for the purpose. They differ in splitting to lines, for example. See Base64 sources and RFC or write some trivial test to compare.

Btw, problems are usually connected with the usage String.getBytes, because it depends on default system encoding (UTF-8/ISO-8859-2/ISO-8859-1/...?).

@codecov-io
Copy link
Copy Markdown

Codecov Report

Merging #1256 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #1256   +/-   ##
======================================
  Coverage      75%     75%           
======================================
  Files           1       1           
  Lines          16      16           
======================================
  Hits           12      12           
  Misses          3       3           
  Partials        1       1

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 9485033...a92ff87. Read the comment docs.

@bsideup bsideup merged commit 92994bd into master Nov 17, 2019
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.

4 participants