Repository navigation
[2.0] Fixes #28299: mask and encrypt secrets nested in a schema oneOf (#33193) - #37962
Conversation
…#33193) Backport of #33193 to 2.0. On 2.0 a secret inside a oneOf auth property (Databricks Pipeline token / clientSecret, SFTP, OpenSearch, sslConfig, ...) was returned unmasked by the API and rendered as plain text in the UI. 2.0 adaptations: - drop the NatsConnection converter (the connector is not on 2.0) - keep MicroStrategy's dedicated converter, as 2.0 has it - port only getSchemaProperties into 2.0's ServiceConnectionDetailsUtils - add Databricks Pipeline masking tests (backend and UI) (cherry picked from commit 8e465d2)
❌ 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 |
| } catch (Exception ignored) { | ||
| // Not every JSON under json/schema parses as a schema; those cannot declare secrets. |
There was a problem hiding this comment.
Java additions violate repository requirements
loadSchemas silently catches Exception, contrary to the Java guide's requirements to catch specific errors and report them. Catch the expected read/parse errors and make skipped schemas visible.
The additions also violate these guide requirements:
- Use one trailing return, small focused methods, named constants for repeated strings, and
finalon unchanged locals and parameters. - Import classes instead of adding the fully qualified reference in
ClassConverterFactory. - Share the repeated Elasticsearch/OpenSearch conversion flow instead of copying it into
OpenSearchConnectionClassConverter.
These repository requirements must be satisfied before merging.
Context Used: CLAUDE.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
The coverage test from #33193 converted only the first secret-bearing branch of each oneOf and only checked that the property itself was no longer a Map, so a secret in a later branch, or a oneOf nested inside a typed value, passed unnoticed. Checking every branch through a walk that mirrors the password walkers finds three secrets still returned unmasked: - PowerBI GCS pbitFilesSource: securityConfig.gcpConfig.privateKey - Superset API connection: sslConfig certificates and key - MySQL GCP CloudSQL authType: password and gcpConfig.privateKey convertProperty now sets a property through its getter's type, so a typed property such as GCPCredentials can be run through its own converter, and the registry gains converters for GcpCloudSqlConfig, the PowerBI GCSConfig and SupersetApiConnection. MySQL's authType candidates include CloudSQL. 2.0: the coverage test also lists SampleDataStorageConfig.config as a known gap (2.0-only; the property is gone on main) and skips allowlisted properties where they are nested in another connection. (cherry picked from commit bcadc18)
…chemas A converter that dropped a nested secret would have passed the previous check, which only looked for the original value and any mask in the JSON. The coverage test also stops silently skipping a schema it cannot read, matching main's JsonSchemas helper.
Choosing None for an optional oneOf (e.g. the Alation database connection)
submits {}, which converted to the first candidate class filled with schema
defaults.
…/OpenMetadata into backport-33193-2.0
Code Review ✅ Approved 🔴 High riskExpands credential encryption and API masking across nested connection schemas; conversion regressions could leave connector secrets stored or returned in clear. Masks and encrypts secrets nested inside schema VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
…38167) Partial cherry-pick of #38070 (d3649e0), ServiceForm.spec.ts hunk only. #37962 backported masking of Superset sslConfig certificates to 2.0, so the workflow response now returns caCertificate as a mask. Assert on the request body the form sent instead. The other #38070 hunks cover personal-space and AI profile code that does not exist on 2.0.
Fixes #28299
Backport of #33193 to 2.0, plus the follow-up from #37965.
On 2.0, secrets inside a
oneOfauth property come back unmasked from the API and show as plain text on the service Connection tab. Example: the Databricks Pipelinetoken/clientSecret; SFTP, OpenSearch andsslConfigare affected too.Commit 1: backport of #33193, with these 2.0 adaptations
NatsConnectionconverter (connector not on 2.0)MicroStrategyConnectionClassConvertergetSchemaPropertiesinto 2.0'sServiceConnectionDetailsUtils.tsx(main's file has diverged)Commit 2: cherry-pick of #37965 (review follow-up)
sslConfig, MySQL CloudSQL), now fixed.SampleDataStorageConfig.configis listed as a known gap. Its S3 credentials are not typed on 2.0, and the property no longer exists on main.Verification (on 2.0)
org.openmetadata.service.secrets.**tests pass (251). The new tests fail without the fixes.ServiceConnectionDetailsUtils.test.tsxpasses🤖 Generated with Claude Code
The remaining explicit Java requirements must be satisfied before merging.
Findings
Summary
This PR extends secret masking and encryption to credentials nested inside
oneOfconnection settings on 2.0.No new findings. The previous Java requirements finding remains partly addressed. Khairajani lists
SampleDataStorageConfig.configas a known 2.0 gap because its S3 credentials lack generated types and the property no longer exists on main.Reviews (6) · Last reviewed commit: "Merge branch '2.0' into backport-33193-2..." · Reviewed by Greptile