Repository navigation
[1.13] refactor: OIDC login handler and MCP callback auth handling - #32408
Conversation
…32274) * fix(security): bump Apache Jena and Fuseki to 6.2.0 (CVE-2026-61372) CVE-2026-61372 (high): Jena's SPARQL Update engine accepted LOAD source URLs pointing at local resources, so an update could read data off the machine running the engine. 6.2.0 restricts those URLs to http/ftp. The CVE covers everything up to and including 6.1.0, and there is no 5.x release carrying the fix (5.6.0 ends that line), so the only way off it is the major bump. Two halves to it: - The client libraries openmetadata-service compiles against, all on the root pom's ${jena.version}: jena-core, jena-arq, jena-rdfconnection, jena-shacl (plus openmetadata-integration-tests). - The Fuseki server images, which are where a LOAD actually reads local files. docker/rdf-store/Dockerfile and the quickstart variants downloaded Fuseki 5.6.0, and the compose files and docs tag the built image with that version. The base JRE goes 17 -> 21 because Fuseki 6.x is compiled with --release 21; on a 17 JRE it dies at startup with UnsupportedClassVersionError. Jena 6 removed the deprecated single-argument RDFParser.fromString(String). The seven call sites now pass the Lang alongside the string, which is the documented replacement and drops the redundant .lang() call. That removal is a binary incompatibility as well as a source one, so a downstream consumer cannot pin Jena 6.2.0 without this commit. Verified on the built 6.2.0 image (config.ttl + shiro.ini unchanged, TDB2 and the Lucene text index boot fine on JRE 21): LOAD <file:///tmp/x.ttl> -> 400 Not found (fixed) LOAD <file:///tmp/x.ttl> INTO GRAPH <urn:g> -> 204, triple loaded So upstream's fix is partial. Fuseki 6.2.0 installs a per-request StreamManager carrying only the http and ftp locators (Fuseki.java), but UpdateEngineWorker.visit(UpdateLoad) only threads the action context through the no-INTO branch — the INTO GRAPH branch calls RDFDataMgr.open(source) with no context and so resolves through the global StreamManager, which still has a file locator. Worth reporting upstream. What closes that residual path for us is SparqlFederationGuard, which already treats a LOAD source as a federation endpoint and denies it unless the deployment allowlists it (federation is off by default); the Fuseki update endpoint also requires the shiro `writer` role. Also verified: openmetadata-service compiles clean on 6.2.0 and its RDF / ontology / SPARQL / inference unit tests pass (924 tests, 0 failures). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * fix(rdf): initialize Jena before anything can touch the RDF vocabulary The integration tests went red on Jena 6.2.0 with Could not initialize class org.apache.jena.graph.NodeFactory Could not initialize class org.apache.jena.rdf.model.impl.ModelCom across GlossaryRdfImportIT, OntologyGovernanceIT, OntologyPackResourceIT, RdfGlossaryGraphIT and GlossaryOntologyExportIT. Those are secondary errors: the primary one happens once, at startup, and poisons every Jena class in the JVM for the rest of its life. Root cause is a class-initialization cycle new in Jena 6.2.0. InitJenaCore.init() calls TypeMapper.reset(), which registers the RDF 1.2 datatypes by reading RDF.dtLangString, RDF.dtDirLangString, RDF.dtRDFJSON, RDF.dtXMLLiteral and RDF.dtRDFHTML — static fields on org.apache.jena.vocabulary.RDF. But RDF's own <clinit> calls RDF.resource(), which reaches NodeFactory.<clinit>, which calls JenaSystem.init(). So if RDF is the first Jena class the JVM initializes, JenaSystem.init() runs re-entrantly on the same thread while RDF is half-built, TypeMapper reads those fields as null, and registerDatatype() throws NPE inside a static initializer. Reproduced with the module's own classpath, first Jena touch varied: vocabulary.RDF -> FAILED NullPointerException <- the trap vocabulary.RDFS -> OK ResourceFactory -> OK vocabulary.OWL -> OK ModelFactory -> OK vocabulary.SKOS -> OK RDFDataMgr -> OK vocabulary.XSD -> OK QueryFactory -> OK and against RdfResource's own startup path, which builds an RdfEntityDiffService whether or not RDF is enabled: new RdfEntityDiffService(baseUri) first -> FAILED (identical NPE) JenaSystem.init() first, then the same -> OK Jena 5.6.0 does not have the cycle: TypeMapper.reset() there does not read the RDF vocabulary class, so every ordering worked and nothing had to initialize Jena explicitly. Fix: call JenaSystem.init() at the top of OpenMetadataApplication.run(), before registerResources() constructs the RDF resources. It is idempotent, and once the subsystem is up the vocabulary classes initialize in any order. Unit tests were unaffected (924 pass either way) because their first Jena touch is a model or a parser, never the RDF vocabulary. Worth reporting upstream alongside the partial LOAD fix. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> (cherry picked from commit 49f4a79)
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
|
The Java checkstyle failed. Please run You can install the pre-commit hooks with |
Code Review ✅ ApprovedBackports pac4j 6.5.6 OIDC compatibility, Spring 7.0.9, and Apache Jena/Fuseki 6.2.0 to 1.13, while aligning Jetty dependency management to resolve runtime linkage mismatches. Comprehensive validation across authentication handlers, policy expressions, and live service integration confirms no issues. OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
The openmetadata-service unit lane is red on every 1.13 PR, not just this one: 8 failures on #32400, #32371 and #32373. This branch already showed 6 — a strict subset, the other 2 (AuthenticationCodeFlowHandlerTest) having been fixed by #32408 landing on the base. Nothing here was caused by this branch; these are the remaining 6. Three assert against entities and fields that only exist on main/2.0, having been backported wholesale: - IndexMappingNestedFieldConsistencyTest asserted mappings for auditReport, aiApplication, llmModel and aiGovernance. None of those entities exist on 1.13. - SearchIndexFactoryTest asserted page reindex fields include "parent"; page hierarchy is main-only. - SearchRepositoryBehaviorTest expected the column child index to be aliased cluster_column_search_index; on 1.13 it is cluster_tableColumn. EntityCsvTest covers domain/data-product validation on bulk edit. SearchRepositoryBehaviorTest also gains a test for an EXTERNAL_HANDLER-only change emitting no child-update call, which needs the accompanying SearchRepository fix: appendUpdate/appendDelete/appendCreate appended a separator unconditionally, so a propagation whose switch branch deliberately emits nothing (certification, driven by propagateCertificationTags) produced a whitespace-only script that still fired updateChildren against every child index. The three guards only append the separator when the branch actually wrote something. That makes two product changes on this branch: the TestCaseRepository null/EntityNotFound guard and these three separator guards. Everything else is test-only. Verified locally: EntityCsvTest 63, SearchIndexFactoryTest 200, SearchRepositoryBehaviorTest 115, IndexMappingNestedFieldConsistencyTest 4 — 382 tests, 0 failures, 0 errors. Spotless clean. Taken from PR #32340 byte for byte. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Backports the pac4j 6.5.6 OIDC compatibility changes, Spring 7.0.9, and Apache Jena/Fuseki 6.2.0 to 1.13.
Also aligns the 1.13 service Jetty dependency management with main/2.0 at 12.1.10, including the Jetty BOM. This fixes the observed runtime linkage mismatch where Jetty server 12.1.7 resolved jetty-util 12.1.1.
Validation:
AuthenticationCodeFlowHandlerTest: 51 passedAlertUtilTest,RuleEvaluatorTest,ExpressionValidatorTest: 89 passed