Skip to content

[feat](vault) Support keyless GCS storage vaults via Application Default Credentials#65433

Open
cyriltovena wants to merge 4 commits into
apache:masterfrom
cyriltovena:gcs-adc-storage-vault
Open

[feat](vault) Support keyless GCS storage vaults via Application Default Credentials#65433
cyriltovena wants to merge 4 commits into
apache:masterfrom
cyriltovena:gcs-adc-storage-vault

Conversation

@cyriltovena

@cyriltovena cyriltovena commented Jul 9, 2026

Copy link
Copy Markdown

What problem does this PR solve?

Issue Number: close #65432

Related PR: #62788, #64766 (the vault credentials-provider plumbing this builds on), #62987 (Google auth for Iceberg REST catalogs, FE-side)

Problem Summary:

Storage vaults with provider = GCP can only authenticate with static HMAC keys today — the existing keyless mechanisms (s3.role_arn, the s3.credentials_provider_type values) are all AWS-semantic. On GKE, where workloads authenticate via Workload Identity / Application Default Credentials, this forces users to mint and distribute long-lived HMAC key pairs.

This PR adds a GCP_ADC credentials provider type for GCP vaults. The GCS XML API accepts Authorization: Bearer <oauth2-token> as an alternative to HMAC signatures, so no new SDK dependency is introduced:

CREATE STORAGE VAULT gcs_vault PROPERTIES (
    "type" = "S3",
    "s3.endpoint" = "storage.googleapis.com",
    "s3.region" = "us-central1",
    "s3.bucket" = "my-bucket",
    "s3.root.path" = "doris",
    "provider" = "GCP",
    "s3.credentials_provider_type" = "gcp_adc"
);

Design (following the seams introduced by #64766 as closely as I could):

  • Proto/Thrift: new CredProviderTypePB::GCP_ADC = 9 / TCredProviderType::GCP_ADC.
  • common/cpp: a shared GcpAdcTokenProvider resolves OAuth2 tokens in ADC order — GOOGLE_APPLICATION_CREDENTIALS service account json (RS256 JWT assertion via OpenSSL, exchanged at the token endpoint), else the GCE/GKE metadata server (Workload Identity). Tokens are cached and refreshed ahead of expiry; built on the AWS SDK's own HTTP/JSON utilities so both BE and the meta-service recycler can use it.
  • BE / recycler: for GCP_ADC the S3 client is created with AnonymousAWSCredentialsProvider (SigV4 signing is skipped on empty credentials) and S3ObjStorageClient / S3ObjClient attach the bearer token per request via SetAdditionalCustomHeaderValue. Re-applied per page in paginated listings so token rotation mid-listing is safe.
  • FE: s3.credentials_provider_type = "gcp_adc" is validated (provider GCP only; mutually exclusive with ak/sk and role_arn) and mapped in S3Properties.getObjStoreInfoPB. The FE connectivity probe is skipped for this mode (its Java client signs with static credentials); the BE probes the vault at startup instead, same as assumed-role vaults.
  • Meta-service: ADD_S3_VAULT accepts keyless GCP vaults with GCP_ADC; ALTER_S3_VAULT supports switching an HMAC vault to GCP_ADC (clearing stored keys) and back, symmetric with the existing ak/sk ⇄ role_arn switches.

Known limitation: presigned URLs are not supported in this mode (a short-lived bearer token cannot be embedded in a URL); generate_presigned_url logs a warning and returns an empty string.

This is my first contribution to Doris, so I fully expect there are conventions I've missed — very happy to rework any part of the approach (naming, where the token provider lives, whether a native GCS client would be preferred longer-term) based on your feedback.

Release note

Support keyless GCS authentication for storage vaults via Google Application Default Credentials / Workload Identity ("s3.credentials_provider_type" = "gcp_adc").

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
      • End-to-end validation on a GKE cluster with Workload Identity (vault create, load/query/compaction, recycler GC, ALTER between HMAC and gcp_adc) is planned on our side; I will report the results in this PR. Unit tests cover the FE property validation/proto mapping, the meta-service ADD/ALTER paths, and the BE credentials-provider selection.
    • No need to test or manual test.
  • Behavior changed:

    • No.
  • Does this need documentation?

    • Yes. I will open a doris-website PR documenting the new gcp_adc value on the CREATE/ALTER STORAGE VAULT pages once the property surface is settled in review.

Check List (For Reviewer who merge this PR)

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

…ult Credentials

Storage vaults on GCS currently require static HMAC keys: the only
credential fields an S3-type vault accepts for provider GCP are
s3.access_key/s3.secret_key. Every other credential mode
(role_arn, s3.credentials_provider_type) is AWS-only, so clusters
running on GKE cannot use Workload Identity and must mint and
distribute long-lived HMAC key pairs.

This adds a new credentials provider type, GCP_ADC, valid only for
provider GCP vaults:

    CREATE STORAGE VAULT gcs_vault PROPERTIES (
        "type" = "S3",
        "s3.endpoint" = "storage.googleapis.com",
        "s3.region" = "us-central1",
        "s3.bucket" = "my-bucket",
        "s3.root.path" = "doris",
        "provider" = "GCP",
        "s3.credentials_provider_type" = "gcp_adc"
    );

The GCS XML API accepts OAuth2 bearer tokens as an alternative to
HMAC signatures, so no new SDK dependency is needed:

- A shared GcpAdcTokenProvider (common/cpp) resolves tokens following
  the Application Default Credentials order: a service account json
  pointed to by GOOGLE_APPLICATION_CREDENTIALS (JWT assertion signed
  with OpenSSL, exchanged at the OAuth2 token endpoint), else the
  GCE/GKE metadata server (i.e. Workload Identity). Tokens are cached
  and refreshed ahead of expiry. Built on the AWS SDK's own HTTP/JSON
  utilities.
- BE S3ObjStorageClient and recycler S3ObjClient attach the token as
  an Authorization: Bearer header per request; the S3 client is
  created with anonymous credentials so SigV4 signing is skipped
  (mirroring how the existing keyless credential providers reuse the
  provider seam added for vaults without role ARN).
- FE validates the property combination (provider GCP only, mutually
  exclusive with ak/sk and role_arn) and skips its static-credential
  connectivity probe; the BE probes the vault at startup instead,
  like assumed-role vaults.
- Meta-service accepts keyless GCP vaults on ADD_S3_VAULT and
  ALTER_S3_VAULT (switching an existing HMAC vault to GCP_ADC clears
  the stored keys, symmetric with the ak/sk <-> role_arn switches).

Presigned URLs are not supported in this mode (a bearer token cannot
be embedded in a URL) and return an empty string with a warning.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@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?

@cyriltovena

Copy link
Copy Markdown
Author

/review

@cyriltovena

Copy link
Copy Markdown
Author

run buildall

cyriltovena and others added 2 commits July 10, 2026 03:57
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cyriltovena

Copy link
Copy Markdown
Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 61.54% (8/13) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17634	4021	4035	4021
q2	2028	346	199	199
q3	10800	1477	830	830
q4	4804	471	339	339
q5	8474	885	573	573
q6	342	167	138	138
q7	863	850	617	617
q8	10613	1507	1474	1474
q9	5880	4401	4383	4383
q10	6811	1802	1540	1540
q11	502	346	314	314
q12	727	555	454	454
q13	18095	3469	2774	2774
q14	264	265	238	238
q15	q16	784	782	713	713
q17	993	1014	962	962
q18	6833	5724	5487	5487
q19	1162	1324	1074	1074
q20	766	630	597	597
q21	5445	2593	2296	2296
q22	435	357	301	301
Total cold run time: 104255 ms
Total hot run time: 29324 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4363	4290	4290	4290
q2	295	321	210	210
q3	4569	4960	4444	4444
q4	2051	2137	1373	1373
q5	4442	4303	4332	4303
q6	231	178	125	125
q7	2157	1878	1579	1579
q8	2545	2110	2122	2110
q9	7786	7685	7848	7685
q10	4699	4732	4262	4262
q11	770	420	383	383
q12	747	743	563	563
q13	3254	3553	2962	2962
q14	305	310	273	273
q15	q16	693	739	654	654
q17	1357	1307	1332	1307
q18	7946	7375	6808	6808
q19	1091	1062	1092	1062
q20	2217	2212	1927	1927
q21	5209	4506	4414	4414
q22	504	444	420	420
Total cold run time: 57231 ms
Total hot run time: 51154 ms

@cyriltovena

Copy link
Copy Markdown
Author

run feut

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 180486 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 f523a9f95412088d8ff8554b125ddd64017966a5, data reload: false

query5	4362	679	500	500
query6	472	233	213	213
query7	4855	604	354	354
query8	337	193	172	172
query9	8787	4034	4068	4034
query10	488	345	325	325
query11	5955	2398	2125	2125
query12	167	110	105	105
query13	1262	566	474	474
query14	6891	5351	4942	4942
query14_1	4286	4298	4280	4280
query15	207	213	185	185
query16	1065	469	478	469
query17	1172	773	605	605
query18	2770	482	361	361
query19	221	200	153	153
query20	121	112	112	112
query21	238	168	130	130
query22	13658	13757	13357	13357
query23	17563	16601	16344	16344
query23_1	16256	16298	16198	16198
query24	7563	1779	1291	1291
query24_1	1337	1288	1341	1288
query25	573	479	399	399
query26	1338	361	210	210
query27	2518	582	378	378
query28	4407	2067	2017	2017
query29	1065	619	464	464
query30	344	259	224	224
query31	1114	1100	979	979
query32	110	62	62	62
query33	524	317	243	243
query34	1194	1151	652	652
query35	769	790	659	659
query36	1412	1436	1213	1213
query37	154	112	102	102
query38	1886	1705	1639	1639
query39	922	922	891	891
query39_1	881	881	886	881
query40	243	164	140	140
query41	66	64	63	63
query42	91	91	89	89
query43	325	322	281	281
query44	1407	800	779	779
query45	195	197	178	178
query46	1081	1208	757	757
query47	2393	2337	2226	2226
query48	389	432	293	293
query49	581	434	317	317
query50	1067	436	358	358
query51	10723	10700	10576	10576
query52	87	86	83	83
query53	254	278	202	202
query54	284	241	234	234
query55	77	71	66	66
query56	289	301	294	294
query57	1448	1422	1333	1333
query58	273	260	239	239
query59	1598	1655	1510	1510
query60	313	269	253	253
query61	153	157	146	146
query62	689	651	585	585
query63	242	206	198	198
query64	2778	1061	842	842
query65	4869	4788	4781	4781
query66	1780	514	379	379
query67	29474	29440	29316	29316
query68	3202	1700	1001	1001
query69	408	305	274	274
query70	1073	948	984	948
query71	349	320	304	304
query72	3080	2692	2391	2391
query73	829	719	407	407
query74	5100	4930	4788	4788
query75	2596	2608	2210	2210
query76	2325	1184	800	800
query77	357	388	291	291
query78	12354	12309	11657	11657
query79	1455	1173	749	749
query80	1301	551	459	459
query81	529	314	280	280
query82	621	156	125	125
query83	361	320	295	295
query84	280	163	131	131
query85	975	605	493	493
query86	433	306	281	281
query87	1835	1831	1744	1744
query88	3696	2799	2817	2799
query89	451	410	355	355
query90	1970	200	194	194
query91	206	194	162	162
query92	64	64	57	57
query93	1638	1526	1008	1008
query94	728	376	347	347
query95	785	584	458	458
query96	1077	791	359	359
query97	2695	2699	2572	2572
query98	215	204	201	201
query99	1151	1182	1046	1046
Total cold run time: 266661 ms
Total hot run time: 180486 ms

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 53.12% (17/32) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 56.57% (23238/41079)
Line Coverage 40.13% (225582/562178)
Region Coverage 36.06% (178177/494097)
Branch Coverage 37.11% (79144/213291)

@hello-stephen

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

query1	0.01	0.01	0.01
query2	0.14	0.09	0.08
query3	0.39	0.24	0.24
query4	1.64	0.26	0.25
query5	0.33	0.33	0.31
query6	1.16	0.68	0.68
query7	0.04	0.01	0.01
query8	0.09	0.07	0.07
query9	0.51	0.39	0.39
query10	0.58	0.57	0.58
query11	0.31	0.18	0.18
query12	0.33	0.20	0.19
query13	0.53	0.52	0.53
query14	0.93	0.91	0.92
query15	0.67	0.59	0.59
query16	0.38	0.39	0.39
query17	1.00	1.03	1.01
query18	0.31	0.30	0.29
query19	1.90	1.80	1.78
query20	0.02	0.02	0.01
query21	15.40	0.36	0.30
query22	4.95	0.14	0.13
query23	15.79	0.50	0.29
query24	2.48	0.60	0.43
query25	0.15	0.12	0.11
query26	0.74	0.28	0.22
query27	0.10	0.10	0.10
query28	3.41	0.93	0.53
query29	12.48	4.25	3.27
query30	0.38	0.27	0.26
query31	2.76	0.60	0.33
query32	3.22	0.61	0.47
query33	2.94	2.97	3.03
query34	15.75	4.06	3.34
query35	3.31	3.28	3.29
query36	0.64	0.53	0.50
query37	0.13	0.10	0.10
query38	0.08	0.06	0.06
query39	0.07	0.06	0.06
query40	0.20	0.19	0.17
query41	0.13	0.09	0.08
query42	0.09	0.06	0.06
query43	0.07	0.07	0.07
Total cold run time: 96.54 s
Total hot run time: 25.61 s

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 65.62% (21/32) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 74.79% (29984/40093)
Line Coverage 58.84% (328879/558943)
Region Coverage 55.68% (276286/496173)
Branch Coverage 56.97% (121645/213526)

@hello-stephen

Copy link
Copy Markdown
Contributor

FE Regression Coverage Report

Increment line coverage 2.61% (3/115) 🎉
Increment coverage report
Complete coverage report

@cyriltovena

Copy link
Copy Markdown
Author

run buildall

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17683	4100	4029	4029
q2	2038	323	213	213
q3	10263	1405	862	862
q4	4683	478	341	341
q5	7517	867	569	569
q6	178	167	139	139
q7	761	821	619	619
q8	9312	1557	1524	1524
q9	5834	4386	4379	4379
q10	6793	1813	1535	1535
q11	513	345	309	309
q12	728	562	421	421
q13	18114	3367	2747	2747
q14	267	267	246	246
q15	q16	791	790	711	711
q17	1033	901	951	901
q18	7088	5907	5557	5557
q19	1334	1186	1066	1066
q20	799	642	538	538
q21	6137	2655	2447	2447
q22	438	356	301	301
Total cold run time: 102304 ms
Total hot run time: 29454 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4357	4267	4283	4267
q2	321	324	225	225
q3	4570	5030	4413	4413
q4	2048	2160	1381	1381
q5	4464	4376	4337	4337
q6	232	173	125	125
q7	1782	1662	1479	1479
q8	2289	2003	1975	1975
q9	7323	7255	7258	7255
q10	4704	4636	4189	4189
q11	548	398	361	361
q12	753	750	532	532
q13	3063	3376	2798	2798
q14	297	287	267	267
q15	q16	691	706	614	614
q17	1297	1258	1253	1253
q18	7201	7059	6812	6812
q19	1126	1072	1049	1049
q20	2222	2235	1957	1957
q21	5264	4561	4451	4451
q22	527	465	408	408
Total cold run time: 55079 ms
Total hot run time: 50148 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 180054 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 8085692a1cad0d91971622a8999779e1041a6d6a, data reload: false

query5	4338	634	473	473
query6	470	221	214	214
query7	4854	606	361	361
query8	338	187	170	170
query9	8789	4099	4103	4099
query10	486	354	315	315
query11	5862	2381	2164	2164
query12	166	109	104	104
query13	1307	622	441	441
query14	6245	5356	4998	4998
query14_1	4321	4343	4285	4285
query15	210	204	184	184
query16	1064	484	460	460
query17	1133	715	621	621
query18	2743	484	362	362
query19	223	201	158	158
query20	116	111	110	110
query21	240	160	136	136
query22	13606	13704	13388	13388
query23	17457	16582	16208	16208
query23_1	16287	16262	16297	16262
query24	7592	1750	1334	1334
query24_1	1316	1297	1322	1297
query25	577	456	401	401
query26	1327	368	211	211
query27	2625	573	394	394
query28	4471	2018	2022	2018
query29	1086	637	510	510
query30	336	270	230	230
query31	1109	1098	985	985
query32	108	65	60	60
query33	532	338	269	269
query34	1155	1159	651	651
query35	772	787	694	694
query36	1393	1422	1184	1184
query37	154	111	97	97
query38	1883	1700	1654	1654
query39	926	919	889	889
query39_1	890	868	885	868
query40	244	163	138	138
query41	65	61	63	61
query42	94	94	93	93
query43	319	327	282	282
query44	1415	783	769	769
query45	197	191	184	184
query46	1060	1188	774	774
query47	2359	2328	2216	2216
query48	395	429	296	296
query49	576	422	309	309
query50	1085	423	347	347
query51	10934	10852	10803	10803
query52	92	84	72	72
query53	269	273	200	200
query54	290	230	213	213
query55	76	72	64	64
query56	298	304	296	296
query57	1429	1393	1294	1294
query58	260	262	257	257
query59	1574	1601	1424	1424
query60	304	281	255	255
query61	149	153	157	153
query62	695	647	586	586
query63	247	205	201	201
query64	2818	1070	845	845
query65	4847	4852	4784	4784
query66	1769	492	384	384
query67	29502	28898	29297	28898
query68	3035	1534	973	973
query69	408	304	279	279
query70	1080	964	937	937
query71	364	323	312	312
query72	3073	2738	2432	2432
query73	848	746	430	430
query74	5105	4964	4783	4783
query75	2619	2599	2229	2229
query76	2365	1188	781	781
query77	355	379	279	279
query78	12132	12232	11863	11863
query79	1498	1206	729	729
query80	1306	550	460	460
query81	527	315	274	274
query82	606	164	128	128
query83	362	317	296	296
query84	287	160	132	132
query85	969	603	511	511
query86	444	301	260	260
query87	1834	1830	1729	1729
query88	3740	2826	2796	2796
query89	464	416	356	356
query90	1917	207	190	190
query91	200	187	168	168
query92	61	60	57	57
query93	1773	1553	966	966
query94	726	351	350	350
query95	811	573	457	457
query96	1034	793	357	357
query97	2695	2691	2579	2579
query98	226	204	199	199
query99	1140	1179	1041	1041
Total cold run time: 266274 ms
Total hot run time: 180054 ms

@hello-stephen

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

query1	0.01	0.01	0.01
query2	0.09	0.05	0.05
query3	0.26	0.13	0.13
query4	1.61	0.15	0.14
query5	0.24	0.24	0.22
query6	1.25	1.08	1.07
query7	0.04	0.01	0.01
query8	0.06	0.04	0.04
query9	0.39	0.31	0.32
query10	0.57	0.56	0.56
query11	0.20	0.14	0.15
query12	0.19	0.15	0.14
query13	0.48	0.46	0.48
query14	1.03	1.00	1.00
query15	0.62	0.60	0.60
query16	0.30	0.31	0.33
query17	1.14	1.12	1.12
query18	0.24	0.21	0.20
query19	2.04	1.89	1.96
query20	0.01	0.01	0.02
query21	15.47	0.21	0.13
query22	4.96	0.05	0.06
query23	16.14	0.32	0.11
query24	2.98	0.40	0.32
query25	0.10	0.05	0.05
query26	0.72	0.20	0.14
query27	0.05	0.04	0.03
query28	3.58	0.91	0.55
query29	12.49	4.20	3.21
query30	0.30	0.16	0.15
query31	2.77	0.62	0.30
query32	3.23	0.59	0.48
query33	3.25	3.25	3.25
query34	15.67	4.23	3.52
query35	3.54	3.52	3.57
query36	0.58	0.44	0.43
query37	0.09	0.06	0.06
query38	0.05	0.04	0.04
query39	0.04	0.02	0.03
query40	0.18	0.16	0.16
query41	0.08	0.03	0.03
query42	0.04	0.03	0.03
query43	0.05	0.04	0.03
Total cold run time: 97.13 s
Total hot run time: 25.02 s

@cyriltovena

Copy link
Copy Markdown
Author

run p0

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.

[Feature] Support keyless GCS authentication (Application Default Credentials / Workload Identity) for storage vaults

2 participants