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

Extract json, nkey and jwt utils to libraries #1061

Merged
merged 14 commits into from
Jan 31, 2024
Merged

Extract json, nkey and jwt utils to libraries #1061

merged 14 commits into from
Jan 31, 2024

Conversation

scottf
Copy link
Contributor

@scottf scottf commented Jan 13, 2024

nkey and jwt code were extracted from the library to their own to make the jwt code available without the client. The json code was extracted because the jwt code depends on it.

In all cases, no public api was changed. This was accomplished in 2 ways.

  1. In the case of nkey and json (with one exception), the extracted code was kept in the exact same package, class names did not change, and api did not change.
  2. In the case of jwt, since there was only a single class with static api, most of which were deprecated, that class ended up delegating to the extract jwt library, which removed deprecated methods.
  3. In the case of the JsonUtils, it was completely deprecated and methods that were not previously deprecated were delegated to the new JsonWriteUtils or extracted (i.e. HeaderUtils)

If the developer uses gradle or maven, extracted dependencies will automatically be for runtime use, but extra dependency management may be required if those extract libraries are used for compilation of developer code.
Since no api has changed we will not major version, but we are bumping the minor version to 18 for visibility.

@scottf scottf marked this pull request as ready for review January 26, 2024 20:00
@@ -36,7 +36,10 @@ repositories {
}

dependencies {
implementation 'net.i2p.crypto:eddsa:0.3.0'
Copy link
Contributor Author

@scottf scottf Jan 30, 2024

Choose a reason for hiding this comment

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

crypto is needed by the nkeys library, so not directly needed here

@@ -109,9 +107,9 @@ public static String endFormattedJson(StringBuilder sb) {
* @param json raw json
*/
public static void addRawJson(StringBuilder sb, String fname, String json) {
if (json != null && json.length() > 0) {
if (json != null && !json.isEmpty()) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

IntelliJ won't stop harassing me!

@scottf scottf marked this pull request as draft January 30, 2024 23:08
@scottf scottf marked this pull request as ready for review January 31, 2024 11:04
@scottf scottf merged commit 7b1b223 into main Jan 31, 2024
1 of 2 checks passed
@scottf scottf deleted the extract-libraries branch January 31, 2024 15:26
@scottf scottf restored the extract-libraries branch February 1, 2024 15:48
@scottf scottf deleted the extract-libraries branch February 1, 2024 16:18
scottf added a commit that referenced this pull request Feb 1, 2024
scottf added a commit that referenced this pull request Feb 1, 2024
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.

2 participants