Skip to content

[1.13] refactor: OIDC login handler and MCP callback auth handling - #32408

Merged
yan-3005 merged 5 commits into
1.13from
chore/pac4j-6.5.6-1.13
Sep 2, 2026
Merged

yan-3005 merged 5 commits into
1.13from
chore/pac4j-6.5.6-1.13

Conversation

@yan-3005

@yan-3005 yan-3005 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

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 passed
  • AlertUtilTest, RuleEvaluatorTest, ExpressionValidatorTest: 89 passed
  • service and MCP Maven reactor packages passed
  • live isolated service on port 9595 with MySQL 13306 and Elasticsearch 19200: mock custom-OIDC code flow, callback, token validation, and authenticated API call passed
  • 250 authenticated live Spring SpEL policy-expression validations returned HTTP 204

yan-3005 and others added 3 commits September 1, 2026 22:44
…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)
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

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 skip-pr-checks label.

@github-actions github-actions Bot added backend safe to test Add this label to run secure Github workflows on PRs labels Sep 1, 2026
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

The Java checkstyle failed.

Please run mvn spotless:apply in the root of your repository and commit the changes to this PR.
You can also use pre-commit to automate the Java code formatting.

You can install the pre-commit hooks with make install_test precommit_install.

@gitar-bot

gitar-bot Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved

Backports 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.

Options

Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@yan-3005
yan-3005 merged commit 8e26cec into 1.13 Sep 2, 2026
83 of 116 checks passed
@yan-3005
yan-3005 deleted the chore/pac4j-6.5.6-1.13 branch September 2, 2026 06:22
mohityadav766 added a commit that referenced this pull request Sep 2, 2026
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>
@yan-3005 yan-3005 self-assigned this Nov 19, 2026

This branch was previously deployed

1 inactive deployment
test — f7800cbe Deployed Sep 1, 2026 by yan-3005 via playwright-knowledge-graph-postgresql #5243
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants