Skip to content

[feat](paimon) support paimon dlf rest catalog - #54523

Merged
morningman merged 10 commits into
apache:masterfrom
morningman:dlf25
Aug 12, 2025
Merged

morningman merged 10 commits into
apache:masterfrom
morningman:dlf25

Conversation

@morningman

@morningman morningman commented Aug 10, 2025 •

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

This PR adds support for Paimon DLF REST catalog integration, enabling Doris to connect to Alibaba Cloud's Data Lake Formation (DLF) service through REST API with proper credential management.

Key changes include:

  • Implementation of PaimonRestMetaStoreProperties for REST catalog configuration with DLF token provider support
  • Addition of vended credentials provider for dynamic credential extraction from REST tokens
  • Integration of REST catalog type into the existing Paimon external catalog framework
CREATE CATALOG paimon_dlf_test PROPERTIES (
    'type' = 'paimon',
    'paimon.catalog.type' = 'rest',
    'uri' = 'http://cn-beijing-vpc.dlf.aliyuncs.com',
    'warehouse' = 'new_dfl_paimon_catalog',
    'paimon.rest.token.provider' = 'dlf',
    'paimon.rest.dlf.access-key-id' = 'ak',
    'paimon.rest.dlf.access-key-secret' = 'sk'
);

Release note

None

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

add dlf rest

add uri

do not set endpoint

do not check region

backend hadoop conf
@morningman
morningman requested a review from CalvinKirs as a code owner August 10, 2025 03:17
@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@morningman
morningman requested a review from Copilot August 10, 2025 04:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for Paimon DLF REST catalog integration, enabling Doris to connect to Alibaba Cloud's Data Lake Formation (DLF) service through REST API with proper credential management.

Key changes include:

  • Implementation of PaimonRestMetaStoreProperties for REST catalog configuration with DLF token provider support
  • Addition of vended credentials provider for dynamic credential extraction from REST tokens
  • Integration of REST catalog type into the existing Paimon external catalog framework

Reviewed Changes

Copilot reviewed 32 out of 32 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
fe/fe-core/src/main/java/org/apache/doris/datasource/property/metastore/PaimonRestMetaStoreProperties.java Core implementation of REST metastore properties with DLF token provider validation
fe/fe-core/src/main/java/org/apache/doris/datasource/paimon/PaimonVendedCredentialsProvider.java Provider for extracting and managing vended credentials from REST tokens
fe/fe-core/src/main/java/org/apache/doris/datasource/paimon/PaimonOssCredentialExtractor.java OSS credential extractor for DLF token conversion to backend properties
regression-test/suites/external_table_p2/paimon/test_paimon_dlf_rest_catalog.groovy Integration test for DLF REST catalog functionality
fe/fe-core/src/main/java/org/apache/doris/datasource/paimon/source/PaimonScanNode.java Updated to use vended credentials provider for dynamic credential management
Comments suppressed due to low confidence (1)

fe/fe-core/src/test/java/org/apache/doris/datasource/property/metastore/PaimonRestMetaStorePropertiesTest.java:101

  • The buildRules() method in PaimonRestMetaStoreProperties is not tested. Consider adding a test to verify the rules validation logic for different token provider scenarios.
    }

@morningman

Copy link
Copy Markdown
Contributor Author

run buildall

@doris-robot

Copy link
Copy Markdown
TPC-H: Total hot run time: 34244 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 988301736c7650ca3cfa9f8482e3ca67108fc30f, data reload: false

------ Round 1 ----------------------------------
q1	17592	5301	5166	5166
q2	1931	320	185	185
q3	10292	1449	714	714
q4	10254	1082	528	528
q5	7549	2326	2317	2317
q6	180	171	136	136
q7	936	748	645	645
q8	9306	1280	1043	1043
q9	6699	5038	5008	5008
q10	6914	2365	1976	1976
q11	446	284	260	260
q12	352	360	227	227
q13	17796	3456	2938	2938
q14	231	241	222	222
q15	538	488	458	458
q16	418	414	383	383
q17	571	811	372	372
q18	7450	6993	7125	6993
q19	3323	986	559	559
q20	328	306	213	213
q21	2750	2963	2939	2939
q22	1061	1008	962	962
Total cold run time: 106917 ms
Total hot run time: 34244 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5535	5402	5341	5341
q2	233	311	211	211
q3	2046	2547	2189	2189
q4	1357	1705	1299	1299
q5	4101	4497	4495	4495
q6	229	181	135	135
q7	1940	1944	1715	1715
q8	2481	2606	2562	2562
q9	7403	7564	7589	7564
q10	3151	3370	2860	2860
q11	547	505	485	485
q12	1045	779	618	618
q13	3409	3726	3187	3187
q14	304	326	301	301
q15	508	473	462	462
q16	451	523	434	434
q17	1173	1479	1357	1357
q18	7992	7818	8072	7818
q19	6593	839	837	837
q20	2596	1947	1725	1725
q21	9434	4299	4293	4293
q22	1109	1046	967	967
Total cold run time: 63637 ms
Total hot run time: 50855 ms

@doris-robot

Copy link
Copy Markdown
TPC-DS: Total hot run time: 170683 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 988301736c7650ca3cfa9f8482e3ca67108fc30f, data reload: false

============================================
query1	990	395	427	395
query2	6544	1882	1714	1714
query3	6737	220	226	220
query4	26829	23825	23621	23621
query5	4344	629	529	529
query6	337	242	246	242
query7	4642	520	295	295
query8	282	237	222	222
query9	8598	2944	2958	2944
query10	456	335	275	275
query11	15376	14974	15159	14974
query12	185	133	130	130
query13	1676	551	429	429
query14	8602	5859	5822	5822
query15	224	205	163	163
query16	7130	663	442	442
query17	977	773	640	640
query18	2004	462	327	327
query19	217	232	183	183
query20	146	149	138	138
query21	217	128	111	111
query22	4091	4164	3968	3968
query23	34573	34251	34084	34084
query24	5263	2437	2479	2437
query25	534	585	450	450
query26	699	289	167	167
query27	2259	498	352	352
query28	3096	2345	2334	2334
query29	617	589	481	481
query30	290	231	203	203
query31	822	806	679	679
query32	90	81	80	80
query33	438	417	360	360
query34	856	856	517	517
query35	793	830	752	752
query36	1031	1060	917	917
query37	137	125	98	98
query38	3930	3930	3877	3877
query39	1443	1375	1370	1370
query40	233	140	130	130
query41	61	57	54	54
query42	141	126	122	122
query43	517	525	478	478
query44	1372	887	864	864
query45	196	194	179	179
query46	945	1053	669	669
query47	1814	1820	1728	1728
query48	398	423	314	314
query49	681	506	407	407
query50	650	688	402	402
query51	4235	4212	4208	4208
query52	126	127	124	124
query53	253	289	216	216
query54	650	643	554	554
query55	94	89	97	89
query56	351	356	361	356
query57	1201	1236	1149	1149
query58	330	332	330	330
query59	2655	2645	2575	2575
query60	395	391	376	376
query61	125	121	121	121
query62	751	743	668	668
query63	257	223	215	215
query64	2325	1091	795	795
query65	4203	4080	4192	4080
query66	1060	461	383	383
query67	query68	16391	860	974	860
query69	1026	274	287	274
query70	1350	1168	1116	1116
query71	721	315	316	315
query72	9159	2267	2150	2150
query73	3373	689	353	353
query74	9012	8897	8774	8774
query75	7539	3123	2696	2696
query76	8877	1223	805	805
query77	1217	414	327	327
query78	9607	10836	9517	9517
query79	15559	592	578	578
query80	2478	596	490	490
query81	531	255	236	236
query82	519	152	125	125
query83	345	336	269	269
query84	289	94	79	79
query85	957	393	334	334
query86	375	344	287	287
query87	4291	4182	4018	4018
query88	5451	2268	2235	2235
query89	492	367	312	312
query90	2508	227	231	227
query91	139	134	114	114
query92	88	79	67	67
query93	6480	1018	647	647
query94	1144	409	279	279
query95	422	332	320	320
query96	499	592	283	283
query97	2700	2693	2574	2574
query98	263	232	226	226
query99	1467	1440	1268	1268
Total cold run time: 298763 ms
Total hot run time: 170683 ms

@doris-robot

Copy link
Copy Markdown
ClickBench: Total hot run time: 32.76 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 988301736c7650ca3cfa9f8482e3ca67108fc30f, data reload: false

query1	0.04	0.04	0.04
query2	0.08	0.05	0.04
query3	0.24	0.06	0.07
query4	1.62	0.10	0.11
query5	0.41	0.42	0.42
query6	1.16	0.67	0.68
query7	0.02	0.02	0.01
query8	0.04	0.03	0.04
query9	0.55	0.48	0.46
query10	0.52	0.52	0.54
query11	0.16	0.10	0.11
query12	0.15	0.11	0.12
query13	0.65	0.64	0.64
query14	0.90	1.19	0.99
query15	0.94	0.87	0.88
query16	0.39	0.40	0.37
query17	1.06	1.06	1.08
query18	0.21	0.21	0.20
query19	1.96	1.88	1.88
query20	0.01	0.01	0.01
query21	15.39	0.86	0.57
query22	0.76	1.07	0.64
query23	15.04	1.17	0.63
query24	7.02	1.33	0.57
query25	0.52	0.13	0.17
query26	0.60	0.16	0.14
query27	0.05	0.06	0.05
query28	9.73	0.87	0.44
query29	12.62	3.78	3.26
query30	3.03	3.04	2.98
query31	2.81	0.57	0.40
query32	3.24	0.57	0.49
query33	2.97	3.08	3.20
query34	16.05	5.33	4.94
query35	4.90	5.03	4.95
query36	0.70	0.52	0.51
query37	0.10	0.08	0.08
query38	0.06	0.05	0.05
query39	0.03	0.03	0.03
query40	0.18	0.14	0.14
query41	0.08	0.03	0.03
query42	0.04	0.03	0.03
query43	0.04	0.04	0.04
Total cold run time: 107.07 s
Total hot run time: 32.76 s

@morningman

Copy link
Copy Markdown
Contributor Author

run buildall

@doris-robot

Copy link
Copy Markdown
TPC-H: Total hot run time: 33528 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit e0c70731ec75ae67280eef89e4be2f2602054a5f, data reload: false

------ Round 1 ----------------------------------
q1	17569	5327	5195	5195
q2	1928	288	182	182
q3	10295	1478	704	704
q4	10244	1031	519	519
q5	7460	2286	2367	2286
q6	173	171	136	136
q7	891	762	596	596
q8	9296	1291	1043	1043
q9	6677	5043	4986	4986
q10	6882	2361	1964	1964
q11	474	277	260	260
q12	344	363	225	225
q13	17777	3477	2974	2974
q14	222	238	213	213
q15	537	474	457	457
q16	424	415	368	368
q17	569	815	349	349
q18	7475	7050	7091	7050
q19	3645	985	542	542
q20	323	299	211	211
q21	2773	2425	2299	2299
q22	1072	1034	969	969
Total cold run time: 107050 ms
Total hot run time: 33528 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5491	5314	5293	5293
q2	239	308	219	219
q3	2049	2580	2187	2187
q4	1293	1706	1300	1300
q5	4090	4291	4476	4291
q6	224	204	140	140
q7	1984	1820	1827	1820
q8	2765	2492	2484	2484
q9	7337	7579	7322	7322
q10	3340	3204	2998	2998
q11	564	536	550	536
q12	979	781	694	694
q13	3389	3718	3258	3258
q14	306	304	291	291
q15	491	445	440	440
q16	428	468	452	452
q17	1200	1441	1412	1412
q18	7714	7897	8012	7897
q19	6647	851	778	778
q20	2761	2066	1878	1878
q21	9779	4429	4357	4357
q22	1108	979	979	979
Total cold run time: 64178 ms
Total hot run time: 51026 ms

@doris-robot

Copy link
Copy Markdown
TPC-DS: Total hot run time: 170333 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit e0c70731ec75ae67280eef89e4be2f2602054a5f, data reload: false

============================================
query1	1007	383	447	383
query2	6544	2065	1735	1735
query3	6743	225	222	222
query4	26872	23261	23229	23229
query5	4363	642	502	502
query6	328	246	225	225
query7	4646	516	310	310
query8	283	224	215	215
query9	8592	2896	2891	2891
query10	474	334	287	287
query11	15664	14896	14955	14896
query12	178	131	129	129
query13	1663	552	429	429
query14	8537	5821	5813	5813
query15	211	194	170	170
query16	7128	669	488	488
query17	978	769	645	645
query18	2013	444	330	330
query19	237	209	183	183
query20	144	142	142	142
query21	216	131	108	108
query22	3875	3857	3835	3835
query23	34525	34275	34315	34275
query24	5238	2394	2445	2394
query25	516	579	450	450
query26	705	286	172	172
query27	2269	531	349	349
query28	2995	2322	2308	2308
query29	602	601	488	488
query30	288	229	203	203
query31	828	798	689	689
query32	92	80	77	77
query33	509	467	364	364
query34	799	851	522	522
query35	830	850	772	772
query36	1024	1036	929	929
query37	141	112	95	95
query38	3891	3946	3925	3925
query39	1449	1385	1380	1380
query40	231	148	129	129
query41	67	60	56	56
query42	141	122	125	122
query43	513	514	473	473
query44	1370	867	855	855
query45	198	188	177	177
query46	952	1061	669	669
query47	1769	1852	1724	1724
query48	396	423	317	317
query49	659	502	418	418
query50	649	671	414	414
query51	4396	4212	4189	4189
query52	125	136	121	121
query53	253	280	210	210
query54	661	650	564	564
query55	89	85	90	85
query56	355	362	351	351
query57	1182	1219	1138	1138
query58	330	333	328	328
query59	2614	2690	2530	2530
query60	401	398	376	376
query61	138	138	124	124
query62	769	729	656	656
query63	250	210	222	210
query64	2350	1177	818	818
query65	4258	4161	4147	4147
query66	1068	444	343	343
query67	query68	17989	984	1216	984
query69	1026	287	282	282
query70	1392	1126	1078	1078
query71	720	334	320	320
query72	9164	2321	2387	2321
query73	3581	629	353	353
query74	9101	8916	8799	8799
query75	7650	3168	2689	2689
query76	8814	1207	779	779
query77	1159	407	337	337
query78	9503	10901	9135	9135
query79	14574	604	574	574
query80	2117	553	510	510
query81	575	258	227	227
query82	407	163	120	120
query83	425	286	272	272
query84	302	98	79	79
query85	925	379	360	360
query86	364	314	318	314
query87	4176	4144	4106	4106
query88	4530	2221	2216	2216
query89	489	361	315	315
query90	2716	223	227	223
query91	160	139	113	113
query92	88	70	66	66
query93	5104	968	648	648
query94	1028	392	279	279
query95	397	330	322	322
query96	520	591	279	279
query97	2688	2731	2613	2613
query98	251	232	224	224
query99	1481	1421	1293	1293
Total cold run time: 296997 ms
Total hot run time: 170333 ms

@doris-robot

Copy link
Copy Markdown
ClickBench: Total hot run time: 32.65 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit e0c70731ec75ae67280eef89e4be2f2602054a5f, data reload: false

query1	0.04	0.04	0.04
query2	0.08	0.04	0.04
query3	0.25	0.07	0.07
query4	1.61	0.10	0.10
query5	0.42	0.44	0.45
query6	1.16	0.67	0.67
query7	0.03	0.01	0.02
query8	0.05	0.04	0.04
query9	0.56	0.49	0.48
query10	0.54	0.54	0.53
query11	0.16	0.10	0.10
query12	0.14	0.10	0.11
query13	0.65	0.65	0.64
query14	0.92	1.07	1.08
query15	0.93	0.88	0.86
query16	0.38	0.38	0.40
query17	1.06	1.02	1.06
query18	0.22	0.21	0.20
query19	1.91	1.89	1.79
query20	0.01	0.00	0.01
query21	15.39	0.86	0.54
query22	0.74	1.16	0.62
query23	15.04	1.16	0.66
query24	7.10	1.64	0.43
query25	0.53	0.34	0.08
query26	0.52	0.16	0.14
query27	0.05	0.05	0.06
query28	10.23	0.82	0.44
query29	12.55	3.80	3.31
query30	3.02	3.09	3.02
query31	2.81	0.56	0.39
query32	3.24	0.55	0.49
query33	3.04	3.18	3.18
query34	15.87	5.35	4.97
query35	4.86	4.89	5.02
query36	0.70	0.51	0.50
query37	0.10	0.08	0.07
query38	0.05	0.04	0.04
query39	0.03	0.02	0.03
query40	0.16	0.14	0.14
query41	0.08	0.03	0.03
query42	0.03	0.03	0.03
query43	0.04	0.03	0.03
Total cold run time: 107.3 s
Total hot run time: 32.65 s

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 70.37% (114/162) 🎉
Increment coverage report
Complete coverage report

@morningman

Copy link
Copy Markdown
Contributor Author

run buildall

@morningman

Copy link
Copy Markdown
Contributor Author

run buildall

@doris-robot

Copy link
Copy Markdown
TPC-H: Total hot run time: 33577 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit bb717ad701ee6067f85b4688d5f2fd9ecb674c90, data reload: false

------ Round 1 ----------------------------------
q1	17612	5109	5147	5109
q2	1932	280	180	180
q3	10325	1276	688	688
q4	10238	957	509	509
q5	7509	2352	2250	2250
q6	176	163	130	130
q7	915	748	612	612
q8	9287	1293	1063	1063
q9	6713	5035	4990	4990
q10	6887	2358	1995	1995
q11	454	298	271	271
q12	357	360	221	221
q13	17796	3430	2988	2988
q14	226	245	221	221
q15	528	463	469	463
q16	426	415	383	383
q17	571	832	370	370
q18	7144	7003	7024	7003
q19	2179	999	569	569
q20	332	320	215	215
q21	2751	2989	2346	2346
q22	1032	1013	1001	1001
Total cold run time: 105390 ms
Total hot run time: 33577 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5440	5342	5391	5342
q2	242	308	218	218
q3	2054	2575	2174	2174
q4	1282	1693	1324	1324
q5	4103	4224	4352	4224
q6	238	189	169	169
q7	2142	1904	1764	1764
q8	2534	2531	2530	2530
q9	7233	7210	7217	7210
q10	3400	3404	2879	2879
q11	540	490	490	490
q12	748	773	667	667
q13	3399	3677	3393	3393
q14	280	304	299	299
q15	499	450	447	447
q16	466	515	479	479
q17	1301	1612	1370	1370
q18	7973	7615	7793	7615
q19	11186	918	1167	918
q20	1936	1963	1875	1875
q21	14930	4238	4226	4226
q22	1052	1032	981	981
Total cold run time: 72978 ms
Total hot run time: 50594 ms

@doris-robot

Copy link
Copy Markdown
TPC-DS: Total hot run time: 170075 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit bb717ad701ee6067f85b4688d5f2fd9ecb674c90, data reload: false

============================================
query1	1043	453	412	412
query2	6526	1773	1691	1691
query3	6738	225	218	218
query4	26793	23130	22980	22980
query5	4322	615	549	549
query6	321	227	222	222
query7	4654	530	296	296
query8	277	236	227	227
query9	8584	3008	2931	2931
query10	501	352	295	295
query11	15979	15557	14797	14797
query12	187	135	136	135
query13	1663	549	429	429
query14	8679	5813	5842	5813
query15	236	201	172	172
query16	7728	659	454	454
query17	1343	764	655	655
query18	2070	458	330	330
query19	250	217	201	201
query20	156	148	141	141
query21	218	126	115	115
query22	3872	3980	3938	3938
query23	34475	34423	34309	34309
query24	7470	2431	2463	2431
query25	540	501	439	439
query26	723	290	160	160
query27	2492	503	348	348
query28	3193	2334	2367	2334
query29	700	602	487	487
query30	291	237	194	194
query31	868	791	702	702
query32	91	83	75	75
query33	561	431	405	405
query34	795	830	527	527
query35	819	825	757	757
query36	1016	1044	928	928
query37	136	116	93	93
query38	3989	3917	3903	3903
query39	1429	1411	1368	1368
query40	231	142	128	128
query41	63	67	54	54
query42	141	123	131	123
query43	525	503	479	479
query44	1441	885	872	872
query45	199	191	191	191
query46	943	1057	673	673
query47	1786	1863	1756	1756
query48	422	441	313	313
query49	677	502	415	415
query50	672	694	431	431
query51	4227	4237	4129	4129
query52	125	131	119	119
query53	260	292	210	210
query54	668	645	555	555
query55	90	88	89	88
query56	350	357	353	353
query57	1197	1218	1125	1125
query58	348	330	322	322
query59	2644	2575	2537	2537
query60	413	405	409	405
query61	125	124	121	121
query62	836	734	637	637
query63	263	224	217	217
query64	2769	1114	797	797
query65	4236	4110	4069	4069
query66	889	457	326	326
query67	query68	17458	626	596	596
query69	1023	317	288	288
query70	1446	1148	1126	1126
query71	713	359	333	333
query72	9144	2312	2347	2312
query73	3674	699	359	359
query74	9027	8982	8758	8758
query75	7613	3120	2664	2664
query76	8873	1214	814	814
query77	1155	412	336	336
query78	9535	10610	9515	9515
query79	15370	583	580	580
query80	2692	611	478	478
query81	531	264	221	221
query82	527	154	115	115
query83	364	284	266	266
query84	341	94	78	78
query85	914	394	334	334
query86	360	319	299	299
query87	4256	4194	4077	4077
query88	5562	2218	2247	2218
query89	509	383	314	314
query90	2496	233	240	233
query91	146	138	111	111
query92	88	72	66	66
query93	6609	1019	666	666
query94	1103	385	290	290
query95	424	344	329	329
query96	506	582	280	280
query97	2696	2707	2613	2613
query98	247	231	224	224
query99	1445	1371	1276	1276
Total cold run time: 305115 ms
Total hot run time: 170075 ms

@doris-robot

Copy link
Copy Markdown
ClickBench: Total hot run time: 32.56 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit bb717ad701ee6067f85b4688d5f2fd9ecb674c90, data reload: false

query1	0.04	0.03	0.04
query2	0.09	0.04	0.04
query3	0.25	0.07	0.07
query4	1.60	0.10	0.11
query5	0.41	0.43	0.43
query6	1.15	0.67	0.68
query7	0.03	0.02	0.02
query8	0.04	0.03	0.04
query9	0.55	0.47	0.49
query10	0.52	0.53	0.52
query11	0.15	0.10	0.11
query12	0.15	0.11	0.11
query13	0.65	0.67	0.65
query14	0.93	1.06	1.09
query15	0.97	0.88	0.88
query16	0.38	0.39	0.38
query17	1.04	1.02	1.09
query18	0.22	0.20	0.21
query19	1.96	1.84	1.94
query20	0.02	0.01	0.02
query21	15.36	0.85	0.55
query22	0.76	1.22	0.70
query23	14.85	1.21	0.61
query24	6.87	1.26	0.31
query25	0.40	0.08	0.16
query26	0.58	0.15	0.14
query27	0.05	0.06	0.05
query28	9.96	0.81	0.45
query29	12.58	3.82	3.31
query30	3.02	2.95	2.95
query31	2.82	0.57	0.40
query32	3.24	0.56	0.49
query33	3.05	3.18	3.22
query34	16.12	5.37	4.87
query35	4.86	4.98	5.04
query36	0.68	0.51	0.50
query37	0.10	0.07	0.07
query38	0.06	0.05	0.05
query39	0.04	0.03	0.03
query40	0.18	0.13	0.13
query41	0.09	0.03	0.03
query42	0.04	0.03	0.02
query43	0.04	0.04	0.03
Total cold run time: 106.9 s
Total hot run time: 32.56 s

@morningman

Copy link
Copy Markdown
Contributor Author

run buildall

@doris-robot

Copy link
Copy Markdown
TPC-H: Total hot run time: 33835 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit a9a0b59b8565863d4cf0c1573f1272aeb53fdf91, data reload: false

------ Round 1 ----------------------------------
q1	17595	5249	5128	5128
q2	1922	289	188	188
q3	10297	1249	702	702
q4	10229	986	530	530
q5	7479	2357	2345	2345
q6	174	167	130	130
q7	889	736	607	607
q8	9319	1274	1106	1106
q9	6918	5147	5086	5086
q10	6873	2370	1978	1978
q11	469	290	265	265
q12	340	350	223	223
q13	17778	3634	3022	3022
q14	226	241	211	211
q15	545	474	488	474
q16	419	434	380	380
q17	588	850	357	357
q18	7343	7033	6951	6951
q19	1097	936	572	572
q20	345	340	221	221
q21	4152	2586	2376	2376
q22	1067	1043	983	983
Total cold run time: 106064 ms
Total hot run time: 33835 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5208	5121	5129	5121
q2	246	321	227	227
q3	2191	2736	2325	2325
q4	1320	1734	1334	1334
q5	4223	4275	4502	4275
q6	219	171	131	131
q7	2015	2003	1798	1798
q8	2687	2535	2624	2535
q9	7322	7310	7378	7310
q10	3125	3264	2851	2851
q11	589	536	525	525
q12	722	747	604	604
q13	3566	3875	3213	3213
q14	265	315	281	281
q15	524	484	487	484
q16	455	492	458	458
q17	1193	1555	1386	1386
q18	7777	7800	7436	7436
q19	882	808	902	808
q20	2043	2110	2172	2110
q21	5006	4332	4257	4257
q22	1071	1090	993	993
Total cold run time: 52649 ms
Total hot run time: 50462 ms

@doris-robot

Copy link
Copy Markdown
TPC-DS: Total hot run time: 185770 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit a9a0b59b8565863d4cf0c1573f1272aeb53fdf91, data reload: false

query1	993	391	412	391
query2	6548	1775	1712	1712
query3	6740	231	221	221
query4	26943	23930	23686	23686
query5	4333	605	488	488
query6	290	206	206	206
query7	4622	505	282	282
query8	271	228	229	228
query9	8607	2875	2871	2871
query10	488	352	276	276
query11	15903	15173	14820	14820
query12	162	113	113	113
query13	1661	533	423	423
query14	8663	5720	5703	5703
query15	214	182	176	176
query16	7299	638	490	490
query17	1222	726	587	587
query18	1993	414	312	312
query19	196	189	171	171
query20	126	126	116	116
query21	218	135	109	109
query22	4094	4057	4062	4057
query23	34332	33389	33358	33358
query24	8119	2346	2349	2346
query25	535	467	410	410
query26	1231	271	162	162
query27	2744	500	346	346
query28	4326	2242	2187	2187
query29	808	556	455	455
query30	287	213	186	186
query31	910	803	721	721
query32	88	81	69	69
query33	556	377	345	345
query34	782	851	503	503
query35	800	833	728	728
query36	959	996	908	908
query37	127	109	83	83
query38	4034	4049	3944	3944
query39	1452	1413	1474	1413
query40	221	125	117	117
query41	63	53	52	52
query42	115	109	110	109
query43	503	490	479	479
query44	1320	839	854	839
query45	188	177	181	177
query46	842	995	630	630
query47	1767	1782	1721	1721
query48	380	410	308	308
query49	745	483	397	397
query50	626	678	391	391
query51	4081	4154	4180	4154
query52	110	112	104	104
query53	233	259	208	208
query54	595	582	520	520
query55	85	82	87	82
query56	325	298	298	298
query57	1212	1194	1111	1111
query58	273	269	262	262
query59	2635	2874	2611	2611
query60	341	324	312	312
query61	130	123	131	123
query62	791	697	687	687
query63	227	188	190	188
query64	4387	1056	752	752
query65	4345	4202	4198	4198
query66	1172	421	312	312
query67	15328	15239	14934	14934
query68	8182	912	577	577
query69	476	335	274	274
query70	1220	1125	1072	1072
query71	457	320	327	320
query72	5328	4863	4945	4863
query73	755	658	354	354
query74	9028	9220	9082	9082
query75	3725	3082	2584	2584
query76	3609	1136	732	732
query77	792	410	390	390
query78	9396	9748	8937	8937
query79	2096	805	587	587
query80	596	543	463	463
query81	471	257	227	227
query82	424	141	104	104
query83	253	249	228	228
query84	246	96	88	88
query85	806	407	337	337
query86	376	318	289	289
query87	4282	4312	4161	4161
query88	3131	2149	2149	2149
query89	377	316	286	286
query90	1913	215	209	209
query91	138	137	113	113
query92	85	68	69	68
query93	1367	973	634	634
query94	674	395	304	304
query95	389	308	315	308
query96	490	576	269	269
query97	2660	2710	2600	2600
query98	247	214	211	211
query99	1441	1405	1272	1272
Total cold run time: 272146 ms
Total hot run time: 185770 ms

@doris-robot

Copy link
Copy Markdown
ClickBench: Total hot run time: 32.69 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit a9a0b59b8565863d4cf0c1573f1272aeb53fdf91, data reload: false

query1	0.04	0.03	0.03
query2	0.09	0.04	0.04
query3	0.25	0.07	0.07
query4	1.63	0.11	0.12
query5	0.42	0.41	0.40
query6	1.20	0.65	0.65
query7	0.03	0.02	0.02
query8	0.05	0.04	0.03
query9	0.59	0.53	0.53
query10	0.57	0.57	0.58
query11	0.16	0.11	0.12
query12	0.14	0.11	0.12
query13	0.62	0.60	0.60
query14	0.82	0.82	0.82
query15	0.89	0.87	0.87
query16	0.39	0.39	0.41
query17	1.08	1.03	1.05
query18	0.21	0.19	0.20
query19	1.92	1.78	1.85
query20	0.01	0.01	0.01
query21	15.38	0.92	0.55
query22	0.79	1.18	0.68
query23	14.92	1.35	0.64
query24	6.62	1.57	0.85
query25	0.51	0.31	0.12
query26	0.61	0.16	0.12
query27	0.05	0.05	0.06
query28	9.92	0.95	0.43
query29	12.55	3.92	3.27
query30	3.05	3.07	3.01
query31	2.82	0.58	0.37
query32	3.23	0.55	0.48
query33	3.10	3.14	3.22
query34	16.17	5.43	4.83
query35	4.92	4.96	4.96
query36	0.69	0.52	0.49
query37	0.10	0.07	0.07
query38	0.05	0.05	0.04
query39	0.03	0.02	0.03
query40	0.17	0.15	0.14
query41	0.08	0.02	0.02
query42	0.03	0.02	0.03
query43	0.04	0.03	0.03
Total cold run time: 106.94 s
Total hot run time: 32.69 s

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 70.37% (114/162) 🎉
Increment coverage report
Complete coverage report

@github-actions github-actions Bot added the approved Indicates a PR has been approved by one committer. label Aug 12, 2025
@github-actions

Copy link
Copy Markdown
Contributor

PR approved by at least one committer and no changes requested.

@github-actions

Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

@morningman
morningman merged commit 8f19170 into apache:master Aug 12, 2025
morningman added a commit to morningman/doris that referenced this pull request Aug 15, 2025
### What problem does this PR solve?


This PR adds support for Paimon DLF REST catalog integration, enabling
Doris to connect to Alibaba Cloud's Data Lake Formation (DLF) service
through REST API with proper credential management.

Key changes include:
- Implementation of PaimonRestMetaStoreProperties for REST catalog
configuration with DLF token provider support
- Addition of vended credentials provider for dynamic credential
extraction from REST tokens
- Integration of REST catalog type into the existing Paimon external
catalog framework

```
CREATE CATALOG paimon_dlf_test PROPERTIES (
    'type' = 'paimon',
    'paimon.catalog.type' = 'rest',
    'uri' = 'http://cn-beijing-vpc.dlf.aliyuncs.com',
    'warehouse' = 'new_dfl_paimon_catalog',
    'paimon.rest.token.provider' = 'dlf',
    'paimon.rest.dlf.access-key-id' = 'ak',
    'paimon.rest.dlf.access-key-secret' = 'sk'
);
```
morningman added a commit to morningman/doris that referenced this pull request Nov 6, 2026
…udit text

### Background

SHOW CREATE CATALOG, SHOW CATALOG, the `catalogs()` table function and the audit text of CREATE CATALOG replace a property value with `*XXX` when `DatasourcePrintableMap.isSensitiveKey` matches its key. Until now the keys came from a list in fe-core and from the keys filesystem plugins report at startup. A connector plugin marks its secret properties `sensitive = true`, but that mark only masks the connector's own log lines. A connector tells the engine about its security-relevant properties through `ConnectorProvider#securitySurface()`.

### What problem does this PR solve?

Issue Number: None
Related PR: apache#69588 (added the connector security surface this extends), apache#45164 (introduced the unmasked ALTER CATALOG audit text), apache#27115 (masked it for the statement apache#45164 replaced), apache#59502 (added `iceberg.jdbc.password`), apache#54523 (added the Paimon REST DLF keys), apache#65730 (branch-4.1's Lance catalog, whose REST secrets the Lance port will declare on this surface)
PR Type: Bugfix

Problem Summary:

Catalog secrets that only a connector knows are on no masking list, so SHOW CREATE CATALOG and the other renderings print them in clear: `iceberg.jdbc.password`, `paimon.jdbc.password`, the Paimon REST DLF key pair, `mc.access_key`, and credentials passed through under `trino.` or `adbc.`. Separately, `ALTER CATALOG ... SET PROPERTIES` is written to the audit log unmasked, whatever the key. Each connector now declares its secrets on its security surface, taken from its `sensitive` marks, and the surface can also declare a namespace of secret keys for options passed through unread; Fluss's lake options were hard-coded in fe-core for that reason. The engine masks the union, with fe-core's own list kept as the floor. ALTER CATALOG is masked like CREATE CATALOG.

### Details

- **Change map:** 42 files, +1035 −76 over two commits: production code +376 −48, tests +645 −24, the connector README +13 −3, the plugin API version in `fe/fe-connector/pom.xml`. The first commit adds secret keys to the surface (reviewed alone before). The second does the rest:
  1. Key namespaces on the SPI: `withSensitiveKeyPrefix` and `SensitiveKeyPrefix.covers`, which holds the matching rule; a collection form of `withSensitiveKeys` (`ConnectorSecuritySurface`, +130).
  2. Engine: `isSensitiveKey` matches registered namespaces, the Fluss rule becomes one of them; `ConnectorPluginManager` registers them and reads every surface before it publishes a provider (+70).
  3. Connectors: every provider declares its secrets; `MetaStoreProviders.sensitivePropertyKeys()` gives the union of a plugin's metastore backends; `IcebergJdbcMetaStoreProvider` reports its keys like its siblings; the keytab paths lose their `sensitive` mark (+140).
  4. ALTER CATALOG audit masking (+16).
- **Frequency:** Always. Create or alter a catalog that sets one of the keys above, then run SHOW CREATE CATALOG, SHOW CATALOG `<name>` or `select * from catalogs()`, or read the audit log after an ALTER CATALOG ... SET PROPERTIES.
- **Root cause:** `isSensitiveKey` consulted only fe-core's list and the filesystem providers' keys. A connector's `sensitive` marks fed only `toMaskedString`; `MetaStoreProvider.sensitivePropertyKeys()` existed for this, but nothing called it, and the Iceberg JDBC backend did not implement it. For ALTER CATALOG, `AlterCatalogPropertiesCommand` does not implement `NeedAuditEncryption` and `LogicalPlanBuilderForEncryption` has no `visitAlterCatalogProperties`, so `AuditLogHelper` records the original text; the statement it replaced in apache#45164 was masked by apache#27115.
- **Why existing tests missed it:** Unit tests: `DatasourcePrintableMapTest` checks fe-core's own keys, the provider surface tests checked only the SSRF and driver_url keys, and `EncryptSQLTest` and `RepositoryAuditEncryptionTest` cover CREATE CATALOG, repositories and resources but not ALTER CATALOG. Regression: `audit/test_external_catalog_credential_masking` creates only Iceberg REST catalogs, whose keys are on fe-core's list, and never alters one.
- **Fix:** The engine must not name a connector's properties, so the connectors declare their secrets, from the same `sensitive` marks that mask their logs; jdbc and es declare both spellings their legacy prefix allows, and trino and adbc declare the namespace they pass through, a key there being a secret when its rest names `key`, `secret`, `password`, `token` or `credential` (also `authorization` for ADBC). fe-core keeps the connector keys it lists, so a catalog whose plugin is not loaded masks what it masked before. A provider whose `securitySurface()` throws at startup is skipped, as a filesystem provider is, instead of stopping FE.
- **Other paths and branches:** Fixed here: every rendering above and FE's statement logging, which share `isSensitiveKey` and `NeedAuditEncryption`. Not covered, since a key name cannot express them safely: raw Iceberg SDK keys copied through (`token`, `credential`), Paimon options re-keyed from `paimon.*`, Hadoop `fs.*` keys, and secrets inside a URL. The ALTER CATALOG gap is on branch-4.0, 4.1 and 4.2 (from apache#45164); branch-3.1 still uses the masked statement. branch-4.1 and 4.2 also print the connector keys above in clear; without the connector SPI their fix differs and is tracked separately.
- **Behavior change:** The namespaces also mask non-secrets whose names carry those words, such as `trino.hive.s3.aws-access-key` or a keystore path. Keytab paths, which no release masks, are no longer masked in connector log lines: marked `sensitive`, `hadoop.kerberos.keytab` would be masked in every storage vault and resource.

### Testing

All runs were local (macOS), on master `f5c993f2c94` plus this change:

- Regression `audit/test_external_catalog_credential_masking`, extended with an Iceberg JDBC catalog: SHOW CREATE CATALOG masks `iceberg.jdbc.password`, and the audit texts of its CREATE CATALOG and of an ALTER CATALOG that sets the password and `s3.secret_key` hold only `*XXX`. Against the local cluster's FE without this change it fails at the first new check, SHOW CREATE CATALOG printing the password; with a FE built from this change it passes.
- fe-connector-spi: all 160 tests, with the refreshed surface baseline (+4 lines); the metastore modules: all tests; ten connector modules: 29 classes, 511 tests, including each connector's surface test, which checks real key names.
- fe-core: 26 classes, 341 tests, including `ConnectorPluginManagerTest`, `DatasourcePrintableMapTest`, `EncryptSQLTest` and the audit and plugin gate tests; 14 of them again after the last change to registration.
- Twenty mutations, each caught by its test: for example, reverting either half of the ALTER CATALOG fix (`EncryptSQLTest` sees the statement in clear), matching a marker anywhere in the key, an empty metastore union, or re-marking a keytab.

### Notes for Reviewers

- `SensitiveKeyPrefix.covers` lives on the SPI so that a connector's test can check its declaration against real key names and the engine applies the same rule; the Fluss floor in fe-core uses it too.
- The entries both fe-core and a connector declare are deliberate: the floor is frozen, as the comment in `DatasourcePrintableMap` says.
- The plugin API stays at 31.0, the first commit's bump. Hudi declares nothing: it owns no catalog properties.

### Release note

SHOW CREATE CATALOG, SHOW CATALOG, the `catalogs()` table function and the audit log now mask `iceberg.jdbc.password`, `paimon.jdbc.password`, `paimon.rest.dlf.access-key-id`, `paimon.rest.dlf.access-key-secret`, `mc.access_key`, and the `trino.*` and `adbc.*` properties whose names carry `key`, `secret`, `password`, `token` or `credential` (`authorization` too for `adbc.*`). ALTER CATALOG ... SET PROPERTIES statements are masked in the audit log like CREATE CATALOG.

### Check List (For Author)

- Behavior changed: Yes (see Details)
- Does this need documentation: No
- Pre-submission status: Ready

### AI Disclosure

- Tool: Claude Code (Claude Opus 5.5)
- Generated: the code, the tests, and this description
- Human review: not stated
- Prompts: The author first asked for a generic connector SPI to mask a connector's secret catalog properties instead of adding the Lance keys to fe-core's list. Then, in this PR: let the surface express prefix rules such as Fluss's, mask the union of the engine's and the connectors' keys, wire every connector, keep fe-core's existing entries as the floor, mask whatever is marked `sensitive` but stop marking keytab paths, and fix the unmasked ALTER CATALOG audit text on master only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
morningman added a commit to morningman/doris that referenced this pull request Nov 13, 2026
…udit text

### Background

SHOW CREATE CATALOG, SHOW CATALOG, the `catalogs()` table function and the audit text of CREATE CATALOG replace a property value with `*XXX` when `DatasourcePrintableMap.isSensitiveKey` matches its key. Until now the keys came from a list in fe-core and from the keys filesystem plugins report at startup. A connector plugin marks its secret properties `sensitive = true`, but that mark only masks the connector's own log lines. A connector tells the engine about its security-relevant properties through `ConnectorProvider#securitySurface()`.

### What problem does this PR solve?

Issue Number: None
Related PR: apache#69588 (added the connector security surface this extends), apache#45164 (introduced the unmasked ALTER CATALOG audit text), apache#27115 (masked it for the statement apache#45164 replaced), apache#59502 (added `iceberg.jdbc.password`), apache#54523 (added the Paimon REST DLF keys), apache#65730 (branch-4.1's Lance catalog, whose REST secrets the Lance port will declare on this surface)
PR Type: Bugfix

Problem Summary:

Catalog secrets that only a connector knows are on no masking list, so SHOW CREATE CATALOG and the other renderings print them in clear: `iceberg.jdbc.password`, `paimon.jdbc.password`, the Paimon REST DLF key pair, `mc.access_key`, and credentials passed through under `trino.` or `adbc.`. Separately, `ALTER CATALOG ... SET PROPERTIES` is written to the audit log unmasked, whatever the key. Each connector now declares its secrets on its security surface, taken from its `sensitive` marks, and the surface can also declare a namespace of secret keys for options passed through unread; Fluss's lake options were hard-coded in fe-core for that reason. The engine masks the union, with fe-core's own list kept as the floor. ALTER CATALOG is masked like CREATE CATALOG.

### Details

- **Change map:** 42 files, +1035 −76 over two commits: production code +376 −48, tests +645 −24, the connector README +13 −3, the plugin API version in `fe/fe-connector/pom.xml`. The first commit adds secret keys to the surface (reviewed alone before). The second does the rest:
  1. Key namespaces on the SPI: `withSensitiveKeyPrefix` and `SensitiveKeyPrefix.covers`, which holds the matching rule; a collection form of `withSensitiveKeys` (`ConnectorSecuritySurface`, +130).
  2. Engine: `isSensitiveKey` matches registered namespaces, the Fluss rule becomes one of them; `ConnectorPluginManager` registers them and reads every surface before it publishes a provider (+70).
  3. Connectors: every provider declares its secrets; `MetaStoreProviders.sensitivePropertyKeys()` gives the union of a plugin's metastore backends; `IcebergJdbcMetaStoreProvider` reports its keys like its siblings; the keytab paths lose their `sensitive` mark (+140).
  4. ALTER CATALOG audit masking (+16).
- **Frequency:** Always. Create or alter a catalog that sets one of the keys above, then run SHOW CREATE CATALOG, SHOW CATALOG `<name>` or `select * from catalogs()`, or read the audit log after an ALTER CATALOG ... SET PROPERTIES.
- **Root cause:** `isSensitiveKey` consulted only fe-core's list and the filesystem providers' keys. A connector's `sensitive` marks fed only `toMaskedString`; `MetaStoreProvider.sensitivePropertyKeys()` existed for this, but nothing called it, and the Iceberg JDBC backend did not implement it. For ALTER CATALOG, `AlterCatalogPropertiesCommand` does not implement `NeedAuditEncryption` and `LogicalPlanBuilderForEncryption` has no `visitAlterCatalogProperties`, so `AuditLogHelper` records the original text; the statement it replaced in apache#45164 was masked by apache#27115.
- **Why existing tests missed it:** Unit tests: `DatasourcePrintableMapTest` checks fe-core's own keys, the provider surface tests checked only the SSRF and driver_url keys, and `EncryptSQLTest` and `RepositoryAuditEncryptionTest` cover CREATE CATALOG, repositories and resources but not ALTER CATALOG. Regression: `audit/test_external_catalog_credential_masking` creates only Iceberg REST catalogs, whose keys are on fe-core's list, and never alters one.
- **Fix:** The engine must not name a connector's properties, so the connectors declare their secrets, from the same `sensitive` marks that mask their logs; jdbc and es declare both spellings their legacy prefix allows, and trino and adbc declare the namespace they pass through, a key there being a secret when its rest names `key`, `secret`, `password`, `token` or `credential` (also `authorization` for ADBC). fe-core keeps the connector keys it lists, so a catalog whose plugin is not loaded masks what it masked before. A provider whose `securitySurface()` throws at startup is skipped, as a filesystem provider is, instead of stopping FE.
- **Other paths and branches:** Fixed here: every rendering above and FE's statement logging, which share `isSensitiveKey` and `NeedAuditEncryption`. Not covered, since a key name cannot express them safely: raw Iceberg SDK keys copied through (`token`, `credential`), Paimon options re-keyed from `paimon.*`, Hadoop `fs.*` keys, and secrets inside a URL. The ALTER CATALOG gap is on branch-4.0, 4.1 and 4.2 (from apache#45164); branch-3.1 still uses the masked statement. branch-4.1 and 4.2 also print the connector keys above in clear; without the connector SPI their fix differs and is tracked separately.
- **Behavior change:** The namespaces also mask non-secrets whose names carry those words, such as `trino.hive.s3.aws-access-key` or a keystore path. Keytab paths, which no release masks, are no longer masked in connector log lines: marked `sensitive`, `hadoop.kerberos.keytab` would be masked in every storage vault and resource.

### Testing

All runs were local (macOS), on master `f5c993f2c94` plus this change:

- Regression `audit/test_external_catalog_credential_masking`, extended with an Iceberg JDBC catalog: SHOW CREATE CATALOG masks `iceberg.jdbc.password`, and the audit texts of its CREATE CATALOG and of an ALTER CATALOG that sets the password and `s3.secret_key` hold only `*XXX`. Against the local cluster's FE without this change it fails at the first new check, SHOW CREATE CATALOG printing the password; with a FE built from this change it passes.
- fe-connector-spi: all 160 tests, with the refreshed surface baseline (+4 lines); the metastore modules: all tests; ten connector modules: 29 classes, 511 tests, including each connector's surface test, which checks real key names.
- fe-core: 26 classes, 341 tests, including `ConnectorPluginManagerTest`, `DatasourcePrintableMapTest`, `EncryptSQLTest` and the audit and plugin gate tests; 14 of them again after the last change to registration.
- Twenty mutations, each caught by its test: for example, reverting either half of the ALTER CATALOG fix (`EncryptSQLTest` sees the statement in clear), matching a marker anywhere in the key, an empty metastore union, or re-marking a keytab.

### Notes for Reviewers

- `SensitiveKeyPrefix.covers` lives on the SPI so that a connector's test can check its declaration against real key names and the engine applies the same rule; the Fluss floor in fe-core uses it too.
- The entries both fe-core and a connector declare are deliberate: the floor is frozen, as the comment in `DatasourcePrintableMap` says.
- The plugin API stays at 31.0, the first commit's bump. Hudi declares nothing: it owns no catalog properties.

### Release note

SHOW CREATE CATALOG, SHOW CATALOG, the `catalogs()` table function and the audit log now mask `iceberg.jdbc.password`, `paimon.jdbc.password`, `paimon.rest.dlf.access-key-id`, `paimon.rest.dlf.access-key-secret`, `mc.access_key`, and the `trino.*` and `adbc.*` properties whose names carry `key`, `secret`, `password`, `token` or `credential` (`authorization` too for `adbc.*`). ALTER CATALOG ... SET PROPERTIES statements are masked in the audit log like CREATE CATALOG.

### Check List (For Author)

- Behavior changed: Yes (see Details)
- Does this need documentation: No
- Pre-submission status: Ready

### AI Disclosure

- Tool: Claude Code (Claude Opus 5.5)
- Generated: the code, the tests, and this description
- Human review: not stated
- Prompts: The author first asked for a generic connector SPI to mask a connector's secret catalog properties instead of adding the Lance keys to fe-core's list. Then, in this PR: let the surface express prefix rules such as Fluss's, mask the union of the engine's and the connectors' keys, wire every connector, keep fe-core's existing entries as the floor, mask whatever is marked `sensitive` but stop marking keytab paths, and fix the unmasked ALTER CATALOG audit text on master only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. dev/3.1.0-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants