Repository navigation
Conversation
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
| "$ref": "sftp/basicAuth.json" | ||
| }, | ||
| { | ||
| "$ref": "#/definitions/keyAuth" | ||
| "$ref": "sftp/keyAuth.json" |
There was a problem hiding this comment.
Moving these authentication definitions into separate schema files removes BasicAuth and KeyAuth from the generated sftpConnection Python module. However, ingestion/tests/unit/source/drive/sftp/test_connection.py still imports and instantiates BasicAuth from that module. After model generation, the test raises ImportError during collection, preventing the ingestion unit suite from completing.
| } catch (ClassNotFoundException e) { | ||
| return false; // Not a generated class, so nothing walks it either. | ||
| } | ||
| Ref branch = secretBearingBranch(oneOf.node(), oneOf.path(), schemas); |
There was a problem hiding this comment.
Later Secret Branches Untested
This gate builds a payload for only the first secret-bearing branch. Properties such as SFTP authType and Alation authType have multiple secret-bearing branches, so a converter that handles the first but omits a later branch would still pass. The omitted branch could remain a map, leaving its secrets unencrypted and unmasked. The gate should exercise every secret-bearing branch.
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!
✅ Generated Sources Auto-UpdatedThe generated TypeScript types ( |
| "title": "Username/Password Authentication", | ||
| "description": "Username and password authentication for SFTP", | ||
| "type": "object", | ||
| "javaType": "org.openmetadata.schema.services.connections.drive.sftp.SftpBasicAuth", |
There was a problem hiding this comment.
SFTP Schemas Break Naming Convention
The new basicAuth.json schema declares the descriptive title Username/Password Authentication and the explicit Java type SftpBasicAuth. The same pattern appears in keyAuth.json, which declares Private Key Authentication and SftpKeyAuth. This violates the repository requirement that schema titles follow the camelCase filename and generated classes follow that schema identity. This repository requirement must be satisfied before merging.
Context Used: AGENTS.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!
| org.openmetadata.schema.services.connections.dasboard.powerbi.GCSConfig | ||
| .class, |
There was a problem hiding this comment.
The Power BI converter references org.openmetadata.schema.services.connections.dasboard.powerbi.GCSConfig.class inline. This violates the repository requirement to import Java classes instead of using fully qualified names in code, and the requirement must be satisfied before merging.
Context Used: AGENTS.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!
✅ Generated Sources Auto-UpdatedThe generated TypeScript types ( |
jsonschema2pojo ignores `oneOf`, so a `oneOf` property is generated as a bare `Object` and holds a `LinkedHashMap` at runtime. Both `PasswordEntityMasker` and `SecretsManager` recurse only into values whose package starts with `org.openmetadata`, so that map is skipped entirely: every `format: password` leaf below it was never Fernet-encrypted, never handed to the external secrets manager, and never masked on read. The UI lost the `format: password` marker for the same reason and rendered the value in a plain text input, which is what #28299 reports for SFTP. Audited every connection schema: 41 (connection, property) pairs were uncovered. 37 are fixed here by registering a converter that re-types the property before either walk runs -- SFTP, OpenSearch, Alation, Databricks Pipeline, REST, PowerBI, Microsoft Access, MyDb, QuestDB auth configs, the ES/OS SSL certificate values, and every `sslConfig` (its certificate and key fields are `format: password` too). `NestedConfigClassConverter` covers the 26 connections that need nothing but re-typing, so the registry stays the single source of truth instead of 26 near-identical classes. SFTP's auth branches were inline `#/definitions`, and jsonschema2pojo generates a class per schema *file*, so no class existed to convert into; they are extracted to `drive/sftp/{basicAuth,keyAuth}.json` with the titles unchanged. The stray `type: object` on `common/sslConfig.json` is dropped for the same reason. `NestedSecretConverterCoverageTest` is the regression gate: it walks every connection schema on the classpath, builds a payload per secret-bearing `oneOf` branch, runs the registered converter and fails if the property is still a `Map`. Its `KNOWN_UNCONVERTIBLE` allowlist holds the four remaining schema-extraction cases so they stay visible and the set cannot grow.
The `oneOf` fix moved SFTP's inline auth branches into
`drive/sftp/{basicAuth,keyAuth}.json`, so `BasicAuth` no longer exists on
`sftpConnection`. `tests/unit/topology/drive/test_sftp.py` was updated;
`tests/unit/source/drive/sftp/test_connection.py` was missed and failed to
import on all three Python versions.
Also drop `MicrosoftAccessConnectionClassConverter`: the registry now maps
`MicrosoftAccessConnection` to an equivalent `NestedConfigClassConverter`, and
because `converters.putAll(NESTED_CONFIG_CONVERTERS)` runs last the dedicated
class was already unreachable.
`ReflectionException` gains a cause-carrying constructor so `convertProperty`
reports which property on which connection failed instead of a bare message.
Code Review ✅ Approved 3 closed / 3 findings🔴 High risk · Extends encryption and masking to nested credentials across dozens of connectors Fixes nested secret encryption and masking across 41 connector properties by re-typing ✅ 3 closed✅ Quality: MicrosoftAccessConnection converter is silently shadowed
✅ Quality: convertProperty discards the reflective exception cause
Closed: Quality: Coverage gate checks only the first secret-bearing oneOf branch
OptionsDisplay: compact → Counting what did not apply, without listing it. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
|
|
🤖 Backport to |
|
🤖 Backport to |
|
🤖 Backport to |
|
🤖 Backport to |



Describe your changes:
Fixes #28299
I worked on masking the SFTP connection password because the plain-text input the issue reports turned out to be the visible symptom of a deeper bug that spans 41 connector properties.
jsonschema2pojoignoresoneOf, so aoneOfproperty is generated as a bareObjectand holds aLinkedHashMapat runtime.PasswordEntityMasker.maskPasswordFieldsandSecretsManager.encryptPasswordFieldsboth recurse only into values whose package starts withorg.openmetadata, so that map is skipped entirely: everyformat: passwordleaf below it was never Fernet-encrypted, never handed to the external secrets manager, and never masked on read. The UI lost theformat: passwordmarker for the same reason and rendered the value in a readable text input. The thing that closes the hole is aClassConverterthat re-types the property before either walk runs (SecretsUtil.convertruns first in both paths).Type of change:
High-level design:
Audit. I walked every connection schema and cross-referenced converter coverage: 41
(connection, property)pairs were uncovered. 37 are fixed here.password,privateKey,privateKeyPassphrase), OpenSearch, Alation, Alation Sink, Databricks Pipeline, MyDb, QuestDB, Microsoft Access, RESTopenAPISchemaConnection, PowerBIpbitFilesSource, and the Elasticsearch/OpenSearchSSLConfig.certificatesvalues.sslConfig(itscaCertificate/sslCertificate/sslKeyare allformat: password): Db2, Doris, Informix, MongoDB, MyDb, SAP ERP, SAP S/4HANA, SAP SuccessFactors, Omni, SSRS, REST, Tableau, Cassandra, Hive, Prefect, Fivetran, Flink, Alation Sink, OpenMetadata, NATS, Kafka (x2), OpenLineage Kafka broker, Matillion ETL.Approach. 26 of these connections need nothing but re-typing, so rather than 26 near-identical converter classes I added
NestedConfigClassConverter— constructed with aproperty -> candidate classesmap — plus a reflectiveClassConverter.convertPropertyhelper.ClassConverterFactorystays the single source of truth for the registry. Four existing converters (Tableau, Cassandra, Hive, Prefect) gained their missingsslConfigpass, andOpenSearchConnectionClassConverteris new because it also needs the nestedSSLConfig.certificatespass that Elasticsearch's converter now does.Why the schema changed. SFTP's auth branches were inline
#/definitions, and jsonschema2pojo generates a class per schema file, not per$reftarget — so no Java class existed to convert into. They are extracted todrive/sftp/{basicAuth,keyAuth}.jsonwith thetitles unchanged, so the UI form labels are identical; the only cross-language cost is thatdatamodel-codegennames the Python models after the title, hence the two import renames in the SFTP connector. A straytype: objectoncommon/sslConfig.jsonis dropped for the same reason (it madecertificatesa fieldlessCertificatesclass with an untypedadditionalPropertiesmap; no Java code referenced it).Alternative rejected. Teaching the reflection walk to descend into
Mapvalues and mask any key matching a known secret name would fix all 41 at once with no schema change — but it changes the semantics of the core secrets path for every entity, including free-formconnectionArguments, which is a much riskier diff than extending the established converter pattern.Regression gate.
NestedSecretConverterCoverageTestwalks every connection schema on the classpath, builds a payload per secret-bearingoneOfbranch, runs the registered converter and fails if the property is still aMap. ItsKNOWN_UNCONVERTIBLEallowlist holds the four cases that still need a branch extracted into its own file — SAP S/4HANAauthType, NATSauthType, Delta LakeMetastoreConfig.connection, Qlik Sensecertificates— so they stay visible and the set cannot grow silently. I verified the gate is not vacuous by de-registering SFTP, Db2 and OpenSearch and confirming it fails on exactly those three.Rollout / backward compatibility. No migration is needed: the stored JSON shape is unchanged (only Java/Python class generation changes), and
decryptPasswordFieldsalready passes a non-Fernet value through untouched, so existing services keep working and get encrypted on their next save. Operators should be aware that credentials saved on an affected connector before this fix are sitting unencrypted in the metadata DB and were never written to the configured secrets manager, so they need rotating and re-saving.Tests:
Use cases covered
type="password", nottype="text"(the exact assertion from the issue report).authType.passwordinstead of persisting it in clear text.GET /v1/services/driveServices/{fqn}returns*********forauthType.password/authType.privateKey, and a subsequentPUTcarrying the mask restores the original secret.oneOfwithout registering a converter fails the build.Unit tests
NestedSecretConverterCoverageTest.java,ServiceConnectionDetailsUtils.test.tsxPasswordEntityMaskerTest.java(mask/unmask round-trip + serialized-map variant),DBSecretsManagerTest.java(Fernet encryption of a nested secret),test_sftp.pyjacoco:report, secrets package): 90.3% lines aggregate over the changed classes —ClassConverterFactory100%,NestedConfigClassConverter100%, Tableau/Cassandra/Hive/Prefect converters 100%,OpenSearchConnectionClassConverter91%,ElasticSearchConnectionClassConverter86%,ClassConverter85%,PasswordEntityMasker80%.getSchemaProperties/resolveRefblock is fully covered;ServiceConnectionDetailsUtils.tsxas a whole is 69.4% lines, the remainder being pre-existing untested renderers.org.openmetadata.service.secrets.**, 18/18 new UI tests (136/136 across the service-utils suites), 37/37test_sftp.py, 24/24 search-connector tests. Each new test was confirmed to fail without its fix.Backend integration tests
Ingestion integration tests
BasicAuth->UsernamePasswordAuthentication,KeyAuth->PrivateKeyAuthentication). The existingtest_sftp.pyexercises both auth branches and was updated accordingly.Playwright (UI) tests
typeon the read-only Connection tab, asserted directly in Jest against the DOM. Happy to add a Playwright spec if reviewers prefer one.Manual testing performed
mvn install -pl openmetadata-specand confirmedSftpBasicAuth/SftpKeyAuthclasses are now generated, and thatSSLConfig.getCertificates()isObject.scripts/datamodel_generation.pyandyarn parse-schema, then confirmed the dereferenced UI schema still inlines both SFTPoneOfbranches withformat: passwordand unchanged branch titles.ClassCast class java.util.LinkedHashMap cannot be cast to ... SftpBasicAuth— i.e. the map the masker silently skips.type="text", matching the HTML in the issue.mvn spotless:check, the CI ESLint/Prettier/organize-imports sequence, andruffall clean;tscreports no new errors in the changed file (28 -> 26, all pre-existing).UI screen recording / screenshots:
TODO: attach recording. Before/after is the single attribute the issue quotes:
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.🤖 Generated with Claude Code
The functional secret-handling fix appears sound, but the PR is not ready to merge until the two outstanding explicit repository-convention findings are addressed.
Findings
Summary
The PR re-types secret-bearing connection properties generated as raw objects so nested credentials and TLS material participate in encryption, external secret storage, and response masking.
oneOfproperties.Reviews (7) · Last reviewed commit: "Merge branch 'main' into geneva"