Repository navigation
Conversation
…signatures Move the reactor to org.owasp coordinates (issue #531): the library is org.owasp:java-html-sanitizer, its parent java-html-sanitizer-parent, and the unpublished modules get the same prefix. A new legacy-relocation module publishes, with each release, a POM-only relocation at com.googlecode.owasp-java-html-sanitizer: owasp-java-html-sanitizer that points to the same version under the new coordinates. Java packages, the JPMS module name and, now pinned, the OSGi bundle symbolic name are unchanged. The shade exclude names the shim metadata directories in full, since java*/** under org.owasp would also strip the library's own pom.properties. JReleaser's built-in signer hashes with SHA-1, so sign with gpg in command mode with SHA-512 instead. scripts/with-release-key.sh puts the pinned release key alone in a temporary keyring for it. The release and the no-publish check now verify the staging repository holds exactly the expected components before anything is tagged or uploaded, and the signature check rejects digests weaker than SHA-256. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in release 20261110.1. The only conflict was change_log.md: the Next release section of this branch now sits above Release 20261110.1. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The staging check looked for a version only as the first child of the relocation element, and it also requires groupId and artifactId to come first, so a version written after them passed. A pinned version would send every later release at the old coordinates to one fixed release. Look anywhere inside the element. See issue #531. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A release now deploys two namespaces in one bundle, and nothing in the repository can show whether the publishing token may deploy both. If it may not, the release fails after the release commit and the signed tag are pushed, which the workflow does not undo. The Verify release signing workflow gets an opt-in central_upload input. With it, the bundle JReleaser built at the placeholder version is uploaded to the Central Portal as USER_MANAGED, which Central holds until a separate publish request that the script never makes. The script reports Central's validation result and errors, then drops the deployment. See issue #531. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The library becomes org.owasp.html-sanitizer:html-sanitizer rather than org.owasp:java-html-sanitizer. A namespace of its own matches the other OWASP libraries on Maven Central (org.owasp.encoder, org.owasp.antisamy, org.owasp.json-sanitizer), and Central grants publishing rights per namespace, so the token this repository holds can be limited to this project instead of covering all of org.owasp. "java" is dropped from both names as redundant on Maven Central. The parent and the unpublished modules take the html-sanitizer- prefix. The relocation module, the staging check, the packaging checks and the Java 8 consumer job follow. The Java package, the JPMS module name and the OSGi symbolic name are unchanged. See issue #531. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
When Central refused a request, the script exited with curl's status alone and discarded the response body, the one thing that says why. The body now goes to the log. A failed status request ended the run at once and left a deployment that might still validate; three in a row are needed now. When the deployment validated but could not be dropped the run was green; it now fails, since a validated placeholder left in the Portal has a Publish button. The upload is named validation-only-DO-NOT-PUBLISH. Before uploading, the script asks Central whether each POM in the bundle is already published, as JReleaser does before a release, so the check exercises that request for both namespaces too. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Checksum and signature files were skipped wherever they were, so a stray one, such as org/owasp/stray.sha512, passed the check and would have been uploaded: JReleaser leaves only the repository metadata out of the bundle. Each such file now counts as the file it belongs to, which must be an expected component, and each expected component must itself be present. The check also reads the staged library POM. The library has no runtime dependencies and the shims are unpublished, so a dependency there that is neither test nor provided scope fails the release. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The file's own header says a new module needs a line under directories, and legacy-relocation had none. The ignore rule for the new coordinates now covers the whole project namespace, as the rule for the old one does. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
with-release-key.sh ran its command with GPG_SECRET_KEY and GPG_PUBLIC_KEY still exported, so the armored secret key reached Maven, every plugin and JReleaser, none of which need it once it is in the temporary keyring. They are unset before the command runs. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The release workflow rewrites the version in docs/maven.md in place. With the docs left for a later change, a release cut in between, such as an urgent security fix, would have told users to depend on the old coordinates at a version that is only a relocation POM, and the relocation message would have sent them to a guide that did not yet mention the move. The Maven guide, the README badge and the javadoc and download links now name org.owasp.html-sanitizer:html-sanitizer, and docs/maven.md gains a migration section: what changed and what did not, where the old coordinates may be named, what the relocation POM does, and how to find and remove a second copy of the library when an older release still arrives under the old coordinates. The Maven and Gradle fixes it lists were each resolved against a staged repository. The change log entry says the same in brief. This pull request should therefore be merged just before the first release under the new coordinates: until then they, and the javadoc.io pages for them, do not exist. See issue #531. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Update: new coordinates, main merged in, review takenCoordinates. The target is now Main. Merged in (9e780ff); the only conflict was Review. An independent Opus 5.5 review of ced9c86 found the build, the artifacts and the signing correct, and no blocker in the code. Its findings and what was done:
Left for the maintainers to decide:
Verification on the final head 3290f42: 🤖 Generated with Claude Code |
The script runs with pipefail, so when the library POM held no dependency, or none in test or provided scope, the grep that counts them matched nothing, failed the pipeline, and ended the script with status 1 and no message. The release was stopped, correctly, but the log did not say by what. The counts now tolerate zero matches and the check reports them. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The check read only the first dependencies element outside build. The dependency-reduced POM writes profiles before dependencies, so a profile holding only test dependencies was the block that got read, and a compile-scope dependency in the main block after it passed. The reviewer got this through a real publication build. Every dependency outside build is counted now, and a POM with profiles or dependency management of its own is refused, since the count would misread it; the library POM has neither. The file listing also takes symbolic links, which JReleaser follows into the bundle and find -type f skipped. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A bundle that could not be read, or held no POM, skipped the
published check in silence and went on to upload; it now stops.
A reply of {"published":"false"}, a string, passed as unpublished;
the value must be the boolean. When the upload request failed or
returned no identifier, nothing said that Central might still hold a
deployment; a warning now does. A status reply that was not JSON
ended the run on jq's parse error; it now counts as a failed request
and the reply is logged if three come in a row.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
After a correct fix Gradle's dependencyInsight still lists the old coordinates, at the relocated version, so "if the old coordinates show up" sent readers looking for a problem they no longer had. The guide now says to act on 20261110.1 or earlier. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Second review, of the fixesBecause the fix series changed behaviour (a second rename, a rewritten Central script, a tighter release gate, the docs), a second independent Opus 5.5 review covered
Each new failing case was run against the previous commit as well, where it passed the gate or failed silently, and against the fix, where it is reported. Not run anywhere yet: the scripts on Linux. They were exercised under bash 3.2 with BSD tools only; a 🤖 Generated with Claude Code |
Summary
Implements #531: future releases publish as
org.owasp.html-sanitizer:html-sanitizer, signed only with the project release keyF6109A4F3F5616E1A7A62099E02DB03BAF6C438C.Draft until one Maven Central token can publish both namespaces. Every release stages a relocation POM at the old coordinates, and
com.googlecode.owasp-java-html-sanitizeris not in the Owasp Central organization. Claiming it there is refused ("Protected domain which requires manual review"); a request to Sonatype support covers it. Until then Central would reject the whole deployment, after the release commit and signed tag are pushed.Merge just before the first release under the new coordinates. The user-facing docs are part of this change, and they name coordinates that do not exist until that release.
Coordinates
org.owasp.html-sanitizer:html-sanitizer, in a project namespace like the other OWASP libraries on Central (org.owasp.encoder,org.owasp.antisamy,org.owasp.json-sanitizer). Central grants publishing rights per namespace, so the repository's token can be limited to this project.org.owasp.html-sanitizer:html-sanitizer-parent. The shims, examples and empiricism modules take thehtml-sanitizer-prefix and stay unpublished.legacy-relocation/module publishes, with each release, a POM-onlycom.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer:<version>. It relocates to the new coordinates, with no dependencies and no pinned target version. Existing releases at the old coordinates are untouched.org.owasp.htmlpackage, the JPMS moduleowasp.java.html.sanitizer, Java 8 bytecode, and the version scheme.Bundle-SymbolicNameis pinned tocom.googlecode.owasp-java-html-sanitizer, because bnd would otherwise derive a new name from the coordinates. The packaging verification checks this.pom.properties, which scanners use to identify the JAR, stays in.Signing
--digest-algo SHA512.scripts/with-release-key.shputs only the pinned release key in a temporary keyring for JReleaser, and does not pass the armored key on to the command it runs.scripts/verify-artifact-signatures.shrejects digests weaker than SHA-256 and prints gpg's status on failure.Release safety
scripts/check-staged-release.shruns after the build and before tagging. Staging must hold exactly the library jar, sources, javadoc and POM, the parent POM, and the relocation POM; every other file must be a checksum or signature of one of them. It also checks the relocation target, that the library POM declares only test and provided dependencies, the JAR's own Maven metadata, the absence of shim metadata, and the OSGi name.Verify release signinghas an opt-incentral_uploadinput. With it,scripts/validate-central-bundle.shuploads the placeholder bundle to the Central Portal asUSER_MANAGED, reports Central's validation result and drops the deployment. It makes no publish request. Run it, and get VALIDATED, before the first release. It has been tested against a mock of the Publisher API only, never against Central.Docs
docs/maven.md, the README badge and the javadoc and download links name the new coordinates.docs/maven.mdgains a migration section, including how to find and remove a second copy of the library when an older release still arrives under the old coordinates.Validation (local, Homebrew JDKs)
./mvnw clean verifyon JDK 11, 17, 21 and 25: 768 + 7 tests pass on each, including the JPMS and Java 8 consumer checks.The release workflow's version-bump commands, run in a scratch clone, update all seven POMs,
change_log.md,SECURITY.mdand both version lines indocs/maven.md.A publication build at placeholder version
20991231.0stages exactly the six expected components, andcheck-staged-release.shpasses. The staged jar has the same entries as the released 20261110.1 jar apart from theMETA-INF/maven/path, and the same manifest apart from version strings.JReleaser
deployin dry-run mode with a throwaway key signs all six files with SHA-512, and the verifier passes.Negative cases fail as intended: a SHA-1 signature, a key that does not match the pinned fingerprint, an extra artifact, a stray checksum or signature file, a missing component, a compile-scope or shim dependency in the library POM, a pinned or redirected relocation.
validate-central-bundle.shagainst a mock Publisher API: validated, failed, stuck, drop refused, upload refused, namespace refused, already published, and failing status requests.Resolution against the staged repository, with Maven 3.10 and Gradle 8.14:
ShellCheck, actionlint and
git diff --checkpass.Before the first release
mainin again. If any release has gone out frommainsince 20261110.1, update that version wheredocs/maven.mdnames it as the last release under the old coordinates.org.owasp.html-sanitizerandcom.googlecode.owasp-java-html-sanitizer, and be in the repository secrets.Verify release signingon this branch withcentral_uploadand confirm VALIDATED.Not in this PR
🤖 Generated with Claude Code