Create JWT claims with ClaimsBuilder

Proprietary

JJWT 0.12 Claims are immutable, and Jwts.claims() returns a ClaimsBuilder. Claims created with Jwts.claims() or Jwts.claims(Map) are built with the ClaimsBuilder instead. A local variable holding the new claims becomes a ClaimsBuilder when it's only changed by statements like claims.put(..) or claims.setSubject(..), which become builder calls, and its other uses build the claims. Claims that are changed otherwise, or passed to methods that might change them, are left unchanged, for a manual migration, as are changes of claims it doesn't create, like claims parsed from a token; both are marked with a warning.

org.openrewrite.java.security.jjwt.MigrateClaimsCreation
mod run . --recipe=org.openrewrite.java.security.jjwt.MigrateClaimsCreation

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.