Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .github/actions/setup-build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: 'Setup Build Environment'
description: 'Sets up JDK(s), Maven Develocity, and optionally SoftHSM'
inputs:
java-version-tests:
description: 'The primary/test Java version'
required: false
default: '17'
distribution:
description: 'JDK distribution to use'
required: false
default: 'zulu'
java-version-maven:
description: 'The Java version used to execute Maven'
required: false
default: '17'
develocity-access-key:
description: 'Develocity access key'
required: false
setup-softhsm:
description: 'Whether to set up SoftHSM'
required: false
default: 'true'

runs:
using: 'composite'
steps:

- name: Set up JDK ${{ inputs.java-version-tests }} (Runs Tests)
if: ${{ inputs.java-version != inputs.java-version-maven }}
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: ${{ inputs.distribution }}
java-version: ${{ inputs.java-version-tests }}
cache: 'maven'
check-latest: true

- name: Set up JDK ${{ inputs.java-version-maven }} (Runs Maven)
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: ${{ inputs.distribution }}
java-version: ${{ inputs.java-version-maven }}
cache: 'maven'
check-latest: true

- name: Set up OSS Community Develocity Instance for Maven
uses: gradle/develocity-actions/setup-maven@974e8dbcbda40db6828fc35f349c80a7c0e71529 #v2.1
with:
develocity-access-key: ${{ inputs.develocity-access-key }}

- name: Install softhsm2
if: ${{ inputs.setup-softhsm == 'true' }}
run: sudo apt-get install -y softhsm2
shell: bash

- name: Install opensc
if: ${{ inputs.setup-softhsm == 'true' }}
run: sudo apt-get install -y opensc
shell: bash

- name: Ensure SoftHSM user configuration
if: ${{ inputs.setup-softhsm == 'true' }}
run: impl/src/test/scripts/softhsm configure
shell: bash

- name: Populate SoftHSM with JJWT test keys
if: ${{ inputs.setup-softhsm == 'true' }}
run: impl/src/test/scripts/softhsm import
shell: bash
153 changes: 31 additions & 122 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: CI

on:
workflow_dispatch:
workflow_dispatch:
pull_request: # all pull requests
push:
branches:
Expand All @@ -11,151 +11,60 @@ env:
MVN_CMD: ./mvnw --no-transfer-progress -B

jobs:
oracle:
strategy:
matrix:
java: [ '17' ]
build:
runs-on: 'ubuntu-latest'
name: jdk-${{ matrix.java }}-oracle
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4.7.0
with:
distribution: oracle
java-version: ${{ matrix.java }}
- name: Set up OSS Community Develocity Instance for Maven
uses: gradle/develocity-actions/setup-maven@v2.1
with:
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
- name: Install softhsm2
run: sudo apt-get install -y softhsm2
- name: Install opensc
run: sudo apt-get install -y opensc
- name: Ensure SoftHSM user configuration
run: impl/src/test/scripts/softhsm configure
- name: Populate SoftHSM with JJWT test keys
run: impl/src/test/scripts/softhsm import
- name: Build
# run a full build, just as we would for a release (i.e. the `ossrh` profile), but don't use gpg
# to sign artifacts, since we don't want to mess with storing signing credentials in CI:
run: ${{env.MVN_CMD}} verify -Possrh -Dgpg.skip=true

temurin:
strategy:
fail-fast: false
matrix:
java: [ '8', '11', '17', '18' ]
runs-on: 'ubuntu-latest'
name: jdk-${{ matrix.java }}-temurin
distribution: [ 'oracle', 'temurin', 'zulu', 'corretto', 'semeru' ]
java-version: [ 8, 11, 17, 21, 25 ]
# Oracle only provides JDK 17+, so exclude earlier versions:
exclude:
- distribution: 'oracle'
java-version: 8
- distribution: 'oracle'
java-version: 11
name: jdk-${{ matrix.java-version }}-${{ matrix.distribution }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: 'maven'
check-latest: true
- name: Set up OSS Community Develocity Instance for Maven
uses: gradle/develocity-actions/setup-maven@v2.1
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Setup Build Environment
uses: ./.github/actions/setup-build
with:
java-version-tests: ${{ matrix.java-version }}
distribution: ${{ matrix.distribution }}
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
- name: Install softhsm2
run: sudo apt-get install -y softhsm2
- name: Install opensc
run: sudo apt-get install -y opensc
- name: Ensure SoftHSM user configuration
run: impl/src/test/scripts/softhsm configure
- name: Populate SoftHSM with JJWT test keys
run: impl/src/test/scripts/softhsm import
- name: Build
# run a full build, just as we would for a release (i.e. the `ossrh` profile), but don't use gpg
# to sign artifacts, since we don't want to mess with storing signing credentials in CI:
run: ${{env.MVN_CMD}} verify -Possrh -Dgpg.skip=true

zulu:
strategy:
matrix:
java: [ '7', '8', '9', '11', '12', '13', '14', '15', '16', '17', '18', '21' ]
runs-on: 'ubuntu-latest'
env:
JDK_MAJOR_VERSION: ${{ matrix.java }}
name: jdk-${{ matrix.java }}-zulu
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'zulu'
cache: 'maven'
check-latest: true
- name: Set up OSS Community Develocity Instance for Maven
uses: gradle/develocity-actions/setup-maven@v2.1
with:
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
- name: Install softhsm2
run: sudo apt-get install -y softhsm2
- name: Install opensc
run: sudo apt-get install -y opensc
- name: Ensure SoftHSM user configuration
run: impl/src/test/scripts/softhsm configure
- name: Populate SoftHSM with JJWT test keys
run: impl/src/test/scripts/softhsm import
- name: Build
# run a full build, just as we would for a release (i.e. the `ossrh` profile), but don't use gpg
# to sign artifacts, since we don't want to mess with storing signing credentials in CI:
run: |
if [ "$JDK_MAJOR_VERSION" == "7" ]; then export MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=128m"; fi
${{env.MVN_CMD}} verify -Possrh -Dgpg.skip=true
run: ${{env.MVN_CMD}} verify -Possrh -Dgpg.skip=true -Dtest.jdk.version=${{ matrix.java-version }}

# ensure all of our files have the correct/updated license header
license-check:
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
fetch-depth: 0 # avoid license plugin history warnings (plus it needs full history)
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '8'
cache: 'maven'
check-latest: true
- name: Set up OSS Community Develocity Instance for Maven
uses: gradle/develocity-actions/setup-maven@v2.1
fetch-depth: 0
- name: Setup Build Environment
uses: ./.github/actions/setup-build
with:
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
setup-softhsm: 'false'
- name: License Check
# This adds about 1 minute to any build, which is why we don't want to do it on every other build:
run: |
${{env.MVN_CMD}} license:check
# This adds about 1 minute to any build, which is why we don't want to do it on every build:
run: ${{env.MVN_CMD}} license:check

code-coverage:
needs: [oracle, temurin, zulu]
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
cache: 'maven'
check-latest: true
- name: Set up OSS Community Develocity Instance for Maven
uses: gradle/develocity-actions/setup-maven@v2.1
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Setup Build Environment
uses: ./.github/actions/setup-build
with:
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
- name: Install softhsm2
run: sudo apt-get install -y softhsm2
- name: Install opensc
run: sudo apt-get install -y opensc
- name: Ensure SoftHSM user configuration
run: impl/src/test/scripts/softhsm configure
- name: Populate SoftHSM with JJWT test keys
run: impl/src/test/scripts/softhsm import
- name: Code Coverage
# run a full build, just as we would for a release (i.e. the `ossrh` profile), but don't use gpg
# to sign artifacts, since we don't want to mess with storing signing credentials in CI:
Expand Down
19 changes: 18 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
## Release Notes

### 0.14.0

The first JJWT release that uses Java 8+ features. This release is not strictly backwards compatible and will also not work with Java 7.

#### Backwards Compatibility Breaking Changes

- The `io.jsonwebtoken.lang.Supplier` interface has been renamed and moved to `io.jsonwebtoken.security.ConfidentialValue` to avoid any potential risk of conflict or accidental use
with `java.util.function.Supplier`. If you have explicitly configured a `Gson` instance to work with this type previously, you must update your usage to reference the new interface, for example:
```java
new GsonBuilder()
.registerTypeHierarchyAdapter(io.jsonwebtoken.security.ConfidentialValue.class, GsonConfidentialValueSerializer.INSTANCE)
// ... etc ...
.create();
```
- The `io.jsonwebtoken.gson.io.GsonSupplierSerializer` class has been renamed to `GsonConfidentialValueSerializer`
- The `io.jsonwebtoken.jackson.io.JacksonSupplierSerializer` has been renamed to `JacksonConfidentialValueSerializer`.`

### 0.13.0

This is the last minor JJWT release branch that will support Java 7. Any necessary emergency bug fixes will be fixed in subsequent `0.13.x` patch releases, but all new development, including Java 8 compatible changes, will be in the next minor (`0.14.0`) release.
Expand Down Expand Up @@ -412,7 +429,7 @@ deprecate some concepts, or in some cases, completely break backwards compatibil
`GsonSupplierSerializer` type adapter, for example:
```java
new GsonBuilder()
.registerTypeHierarchyAdapter(io.jsonwebtoken.lang.Supplier.class, GsonSupplierSerializer.INSTANCE)
.registerTypeHierarchyAdapter(io.jsonwebtoken.security.ConfidentialValue.class, GsonSupplierSerializer.INSTANCE)
.disableHtmlEscaping().create();
```
This is to ensure JWKs have `toString()` and application log safety (do not print secure material), but still
Expand Down
Loading
Loading