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

Replace usage of nimbusds Algorithm and Curve with our own enums #239

Merged
merged 9 commits into from
Feb 15, 2024

Conversation

jiyoonie9
Copy link
Contributor

@jiyoonie9 jiyoonie9 commented Feb 14, 2024

Overview

Eliminating use of Curve and Algorithm from nimbusds dependency and instead using our own enums JwaCurve and Jwa, respectively. Adopting use of AlgorithmId which is a combination of JwaCurve and Jwa.

This PR is the first step to remove dependency on the nimbusds library and preventing exposing their types through our public API surface.

Description

Impact

  • Changes to many method signatures in crypto and dids package. Mostly requiring passing in of AlgorithmId instead of nimbus Algorithm and nimbus Curve.

Follow up tasks

  • Roll our own enums for JWK as well as various nimbus methods we still use internally, and completely remove nimbusds dependency

How Has This Been Tested?

  • Unit tests have been fixed to align with the new public API surface. No implementation change happened.

Checklist

Before submitting this PR, please make sure:

  • I have read the CONTRIBUTING document.
  • My code is consistent with the rest of the project
  • I have tagged the relevant reviewers and/or interested parties
  • I have updated the READMEs and other documentation of affected packages

References

JWA spec

…te AlgorithmId enum. probably wrong. very drafty
@jiyoonie9 jiyoonie9 changed the title replace usage of nimbusds Algorithm and Curve with our own enums [WIP] replace usage of nimbusds Algorithm and Curve with our own enums Feb 14, 2024
@jiyoonie9 jiyoonie9 marked this pull request as ready for review February 15, 2024 04:35
@jiyoonie9 jiyoonie9 changed the title [WIP] replace usage of nimbusds Algorithm and Curve with our own enums Replace usage of nimbusds Algorithm and Curve with our own enums Feb 15, 2024
@JvmOverloads
public fun from(curve: JwaCurve?, algorithm: Jwa? = null): AlgorithmId {
return when (algorithm to curve) {
// todo do i need to add the null algo or null curve cases?
Copy link
Member

Choose a reason for hiding this comment

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

nop! in fact can ditch algorithm arg entirely

Copy link
Member

@mistermoe mistermoe left a comment

Choose a reason for hiding this comment

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

left 2 comments. great work @jiyoontbd !

Copy link

codecov bot commented Feb 15, 2024

Codecov Report

Merging #239 (c205068) into main (1486951) will decrease coverage by 0.46%.
The diff coverage is 47.66%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #239      +/-   ##
==========================================
- Coverage   80.04%   79.59%   -0.46%     
==========================================
  Files          37       38       +1     
  Lines        2200     2220      +20     
  Branches      312      316       +4     
==========================================
+ Hits         1761     1767       +6     
- Misses        299      314      +15     
+ Partials      140      139       -1     
Components Coverage Δ
credentials 82.16% <100.00%> (+0.09%) ⬆️
crypto 43.64% <37.34%> (-1.43%) ⬇️
dids 89.91% <80.00%> (+0.20%) ⬆️
common 69.44% <ø> (ø)

Copy link
Contributor

@amika-sq amika-sq left a comment

Choose a reason for hiding this comment

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

Nice work! Looks great!

Copy link
Contributor

@tomdaffurn tomdaffurn left a comment

Choose a reason for hiding this comment

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

Approving the AwsKeyManager changes.

Nice work.

@jiyoonie9 jiyoonie9 merged commit e5a728d into main Feb 15, 2024
6 of 10 checks passed
@jiyoonie9 jiyoonie9 deleted the 110-replace-nimbusds-algo-curve branch February 15, 2024 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants