Skip to content

Fixes #28299: mask secrets nested below every oneOf branch - #37965

Merged
Khairajani merged 3 commits into
mainfrom
secrets-oneof-coverage-main
Nov 17, 2026
Merged

Khairajani merged 3 commits into
mainfrom
secrets-oneof-coverage-main

Conversation

@Khairajani

@Khairajani Khairajani commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #28299

Follow-up to #33193. A bot review on its 2.0 backport (#37962) flagged that NestedSecretConverterCoverageTest checked only the first secret-bearing oneOf branch, and only that the property itself was no longer a Map. Checking every branch, all the way down, finds three secrets the API still returns unmasked:

  • PowerBI GCS pbitFilesSource: securityConfig.gcpConfig.privateKey
  • Superset API connection: sslConfig certificates and key
  • MySQL GCP CloudSQL authType: password and gcpConfig.privateKey

Changes

  • ClassConverter.convertProperty sets a property through its getter's type, so a typed property (e.g. GCPCredentials) can run through its own converter
  • Registry: converters for GcpCloudSqlConfig, PowerBI GCSConfig, SupersetApiConnection; MySQL authType candidates include CloudSQL
  • Coverage test: every secret-bearing branch, realistic payloads, and a walk that mirrors the password walkers
  • PasswordEntityMaskerTest: one test per leak through maskServiceConnectionConfig

Verification

  • All org.openmetadata.service.secrets.** tests pass (417)
  • The new coverage test and the three masker tests fail without the fix, listing exactly these three leaks

🤖 Generated with Claude Code


Summary by Gitar

  • Behavior change:
    • Empty oneOf maps are left unconverted in ClassConverter.convertProperty to avoid schema-default candidates
  • New tests:
    • Added NestedConfigClassConverterTest covering populated and empty database connections

This will update automatically on new commits.

RetriggerView in GreptileConfidence Score: 5/5

The reviewed changes appear safe to merge.

Summary

The PR makes nested secrets reachable by the password walkers for PowerBI GCS, Superset API, and MySQL CloudSQL connections.

  • Nested settings now reach their own converters without filling empty choices.
  • PowerBI, Superset, and MySQL connection secrets now reach the masker.

Reviews (3) · Last reviewed commit: "Keep an empty oneOf object as it is inst..." · Reviewed by Greptile

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.
@Khairajani
Khairajani requested a review from a team as a code owner November 17, 2026 09:25
@Khairajani
Khairajani requested a review from IceS2 November 17, 2026 09:25
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.
Choosing None for an optional oneOf (e.g. the Alation database connection)
submits {}, which converted to the first candidate class filled with schema
defaults.
@gitar-bot

gitar-bot Bot commented Nov 17, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 🔴 High risk

Extending nested secret conversion changes credential masking in API responses; incorrect conversion could expose stored passwords and private keys.

Extends secret masking to nested oneOf branches by converting PowerBI GCS gcpConfig.privateKey, Superset API SSL certificates and key, and MySQL GCP CloudSQL password and gcpConfig.privateKey, with new converters and coverage tests. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

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

@Khairajani
Khairajani merged commit 76fc132 into main Nov 17, 2026
55 checks passed
@Khairajani
Khairajani deleted the secrets-oneof-coverage-main branch November 17, 2026 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sftp Service connection details contain unmasked password

2 participants