OIiveirra opened a new pull request, #70696:
URL: https://github.com/apache/doris/pull/70696

   ### Background
   
   Catalogs store JDBC and REST connection URIs, which can include credentials 
without a separate password property. Connector providers export sensitive 
property names and aliases at FE startup; catalog displays use the shared 
registry to mask their values.
   
   ### What problem does this PR solve?
   
   Issue Number: None
   Related PR: #70338 (added connector-declared masking and metastore 
registration)
   PR Type: Bugfix
   
   Problem Summary:
   
   Catalog readers with SELECT can still see credentials embedded in JDBC and 
REST URI properties because those properties are not declared sensitive. Mark 
the five URI fields sensitive so the existing registration chain covers their 
aliases, including the legacy JDBC prefix. Most of the change adds checks for 
aliases, preserved connection values, and SELECT-only display access.
   
   ### Details
   
   - **Frequency:** Always when an affected URI contains credentials and a 
catalog reader displays its properties.
   - **Root cause:** The JDBC and Iceberg/Paimon JDBC/REST URI annotations omit 
`sensitive=true`, so their names never reach the provider's masking surface.
   - **Why existing tests missed it:** Property tests covered binding and 
standalone passwords; provider tests omitted URI keys, and the Iceberg dispatch 
test explicitly expected `uri` to remain unmasked. The existing audit 
regression checks standalone passwords and audit text, without SELECT-only URI 
alias checks.
   - **Fix:** Declare URI sensitivity in the property holders and reuse the 
existing alias expansion, metastore union, and provider registration. Mask 
complete URI values because JDBC and REST support different credential 
encodings.
   - **Other paths and branches:** Covers `SHOW CREATE CATALOG`, `SHOW CATALOG 
<name>`, and `catalogs()`, plus annotation-based property masking. Both 
`jdbc_url` and `jdbc.jdbc_url` are covered. Only master was verified; 
release-branch applicability and the earliest introducing changes remain 
unconfirmed.
   - **Behavior change:** These URI values are masked even without embedded 
credentials. The shared `uri` alias is masked wherever the common registry is 
used. Stored connection values and ordinary properties retain their behavior; 
keytab paths follow the upstream visibility policy.
   
   ### Testing
   
   - 
`IcebergJdbcMetaStorePropertiesTest#uriAliasesAreMaskedWithoutChangingConnectionValues`:
 fails its credential-rendering assertion before the URI fix and passes 
afterward.
   - Local targeted FE/connector tests: 277 passed, zero failures, errors, or 
skips; all 50 required XML reports were fresh. Includes the full connector SPI 
suite and the affected properties, provider surfaces, metastore dispatch, 
registration, display, and audit tests.
   - Local isolated 1 FE + 3 BE, ASAN: 
`query_p0/show/test_catalog_credential_masking.groovy` passed CREATE/ALTER 
checks across four metastore configurations: 24 display checks and nine 
unauthorized checks. Callback-external SQL counters confirmed execution; the 
runner's verdict remains `PASS_WITH_COVERAGE_CAVEATS`.
   - Ordinary JDBC SQL probe: 12 display checks passed for `jdbc_url` and 
`jdbc.jdbc_url` after CREATE and ALTER, including an address without 
credentials, using local MySQL Connector/J 8.0.33.
   - Fake credentials and `test_connection=false` avoid external services. 
These are targeted local runs, without external metastore I/O, real Kerberos 
authentication, full P0, or community CI.
   
   ### Notes for Reviewers
   
   The plugin SPI and API 32.0 remain unchanged. The committed regression 
requires no external driver fixture; ordinary JDBC SQL verification used a 
locally supplied driver.
   
   ### Release note
   
   Catalog displays mask full JDBC/REST URI values and their aliases, including 
addresses without embedded credentials. Connections continue to receive the 
original URI values.
   
   ### Check List (For Author)
   
   - Behavior changed: Yes (see Details)
   - Does this need documentation: No
   - Pre-submission status: Ready
   
   ### AI Disclosure
   
   - Tool: Codex (GPT-6)
   - Generated: implementation, tests, verification scripts, and this 
description
   - Human review: not stated
   - Prompts: Asked to reuse upstream masking registration, keep keytab paths 
visible, and fix URI omissions with unit tests and SELECT-only checks through 
all three display paths in an isolated FE/BE cluster.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to