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

Migrate to Jakarta EE 10, Jersey 3.x, and Jetty 12 #570

Merged
merged 3 commits into from
May 28, 2024

Conversation

nscuro
Copy link
Collaborator

@nscuro nscuro commented May 17, 2024

Migrates javax namespaces to their jakarta counterparts.

Performs the following notable version bumps:

  • Jakarta Servlet API: 4.0.1 -> 6.0.0 (latest)
  • JAXB: 2.3.6 -> 4.0.5 (latest)
  • Jersey: 2.41 -> 3.1.6 (latest)
  • Jetty: 10.0.18 -> 12.0.9 (latest)

The following changes were necessary due to compatibility issues with Jakarta EE 10:

  • io.jsonwebtoken:jjwt: 0.9.1 -> 0.12.5
    • Signing and verifying of JWTs with Alpine's SecretKey no longer worked. I'm not sure why it worked before, but now the library complained about AES keys not being suitable for HMAC signing. I modified the JsonWebToken class to use Alpine's public/private key pair instead, which works. It changes the signature algorithm to RS512. I believe this change makes sense anyway.
    • The above was resolved by converting the SecretKey generated for AES to an appropriate HmacSHA* algorithm (a3687b4)
  • The default implementation of jakarta.json is Eclipse Parsson. Replaced org.glassfish:javax-json with it.
  • The default implementation of jakarta.mail-api is Eclipse Angus. Added it.

Closes #402


FTR, Dependency-Track has been migrated accordingly. The test suite passes locally, and manual testing of the running application did not yield any complications. Pending PR is here: DependencyTrack/dependency-track#3730

@nscuro

This comment was marked as outdated.

nscuro added a commit to nscuro/dependency-track that referenced this pull request May 17, 2024
Depends on stevespringett/Alpine#570

Signed-off-by: nscuro <nscuro@protonmail.com>
nscuro added a commit to nscuro/dependency-track that referenced this pull request May 17, 2024
Depends on stevespringett/Alpine#570

Signed-off-by: nscuro <nscuro@protonmail.com>
Migrates `javax` namespaces to their `jakarta` counterparts.

Performs the following notable version bumps:

* Jakarta Servlet API: `4.0.1` -> `6.0.0` (latest)
* JAXB: `2.3.6` -> `4.0.5` (latest)
* Jersey: `2.41` -> `3.1.6` (latest)
* Jetty: `10.0.18` -> `12.0.9` (latest)

The following changes were necessary due to compatibility issues with Jakarta EE 10:

* `io.jsonwebtoken:jjwt`: `0.9.1` -> `0.12.5`
  * Signing and verifying of JWTs with Alpine's `SecretKey` no longer worked. I'm not sure why it worked before, but now the library complained about AES keys not being suitable for HMAC signing. I modified the `JsonWebToken` class to use Alpine's public/private key pair instead, which works. It changes the signature algorithm to `RS512`. I believe this change makes sense anyway.
* The default implementation of `jakarta.json` is Eclipse Parsson. Replaced `org.glassfish:javax-json` with it.
* The default implementation of `jakarta.mail-api` is Eclipse Angus. Added it.

Signed-off-by: nscuro <nscuro@protonmail.com>
nscuro added a commit to nscuro/dependency-track that referenced this pull request May 17, 2024
Depends on stevespringett/Alpine#570

Signed-off-by: nscuro <nscuro@protonmail.com>
@stevespringett
Copy link
Owner

@nscuro The SecretKey is a symmetrical key used to sign the JWT (e.g. HS512). The private/public key pair are asymmetrical keys for the encryption and decryption of data. Both key types are required.

@nscuro

This comment was marked as outdated.

@nscuro

This comment was marked as outdated.

nscuro added a commit to nscuro/dependency-track that referenced this pull request May 20, 2024
Depends on stevespringett/Alpine#570

Signed-off-by: nscuro <nscuro@protonmail.com>
nscuro added a commit to nscuro/dependency-track that referenced this pull request May 20, 2024
Depends on stevespringett/Alpine#570

Signed-off-by: nscuro <nscuro@protonmail.com>
nscuro added a commit to nscuro/dependency-track that referenced this pull request May 20, 2024
Depends on stevespringett/Alpine#570

Signed-off-by: nscuro <nscuro@protonmail.com>
@nscuro nscuro marked this pull request as ready for review May 20, 2024 16:15
@stevespringett
Copy link
Owner

Can you resolve the conflict?

Instead of switching to public/private key pair, convert the secret key to the appropriate `HmacSHA*` algorithm instead. Switching the keys used for signing would have been a breaking change.

Signed-off-by: nscuro <nscuro@protonmail.com>
@stevespringett stevespringett merged commit 83abb23 into stevespringett:master May 28, 2024
2 checks passed
@nscuro nscuro deleted the jakarta-ee branch May 28, 2024 09:19
MM-msr pushed a commit to MM-msr/dependency-track that referenced this pull request Jun 18, 2024
Depends on stevespringett/Alpine#570

Signed-off-by: nscuro <nscuro@protonmail.com>
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.

Migrate to Jakarta EE namespace
2 participants