Skip to content

[improvement](auth) Scope mysql.user rows to the caller and mask password columns - #67444

Merged
CalvinKirs merged 1 commit into
apache:masterfrom
CalvinKirs:mysql_pw
Sep 3, 2026
Merged

[improvement](auth) Scope mysql.user rows to the caller and mask password columns#67444
CalvinKirs merged 1 commit into
apache:masterfrom
CalvinKirs:mysql_pw

Conversation

@CalvinKirs

Copy link
Copy Markdown
Member

What this PR does

Adjusts what mysql.user returns so the visible rows follow the requesting user's privileges, and keeps password-derived columns out of the result entirely.

  • Rows are now scoped to the caller: role administrators (ADMIN_PRIV or GRANT_PRIV) still see every account; other users see only their own account.
  • The authentication_string and password_policy.history_passwords columns are always rendered as *** for every caller, including accounts with an empty password.

To make row scoping possible, the caller identity is threaded through TShowUserRequest (the same pattern already used by the sibling schema-table scanners such as user_privileges and processlist), so the FE can filter rows. A request without an identity returns no rows.

Compatibility

  • current_user_ident is an optional Thrift field, wire-compatible in both directions.
  • No metadata / editlog / storage-format change, so downgrade is clean.
  • During a rolling window where a new FE talks to an old BE that does not set the field, mysql.user returns no rows (fail-closed) until the BE is also upgraded; upgrading BE before FE avoids this.

Tests

  • FrontendServiceImplTest#testShowUser asserts the administrator, normal-user, and no-identity behaviors, including that the password columns are masked.
  • regression-test/suites/auth_p0/test_mysql_user_visibility.groovy covers the end-to-end admin-vs-normal-user visibility and masking.

@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?

@CalvinKirs

Copy link
Copy Markdown
Member Author

run buildall

@CalvinKirs

Copy link
Copy Markdown
Member Author

/review

@hello-stephen

Copy link
Copy Markdown
Contributor

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 77.71% (2053/2642)
Line Coverage 65.61% (37448/57080)
Region Coverage 52.82% (34893/66057)
Branch Coverage 56.29% (11226/19942)

@github-actions github-actions Bot 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.

Request changes. The password masking and optional Thrift plumbing are structurally consistent, but two authorization-boundary defects and one deterministic style-gate failure remain.

Critical checkpoint conclusions:

  • Goal, data correctness, and security: not yet achieved. A non-GRANT caller is matched by username instead of the exact authenticated user@host account, exposing another same-name account's host, privilege flags, and password-policy state. Separately, ADMIN/GRANT privileges supplied by authentication-integration session roles are lost across the BE callback, so a supported role administrator is incorrectly scoped as an ordinary user. The password-derived column indexes 23 and 27 are correct and always masked on the new/new path.
  • Scope and clarity: the six-file change is focused, and every changed path plus the relevant identity, role, scanner, and password-policy producers/consumers was traced.
  • Concurrency and lifecycle: no new shared mutable state, unsafe lock ordering, use-after-free path, or callback-lifetime issue was found; the existing Auth and password-policy locking remains intact.
  • Compatibility, configuration, persistence, and data writes: there is no configuration, edit-log, storage-format, transaction, or persistent-data change. The optional Thrift field is wire-compatible; the documented new-FE/old-BE fail-closed result and old-FE/new-BE legacy behavior are not separate defects in this patch.
  • Parallel paths and FE/BE propagation: the exact user identity reaches the callback, but the immutable session-mapped role set does not; that omission is called out inline. Native persisted and legacy LDAP role paths remain reconstructible.
  • Tests and checks: the new unit/regression coverage verifies root, a distinct normal username, missing identity, and both mask columns, but it does not cover the two failing authorization cases. On exact head aac29f0, FE UT and Clang Formatter pass; CheckStyle fails because TShowUserResult is now unused. Other CI jobs are still pending. No local build or test was run because this was a review-only workflow.
  • Performance and observability: no material regression or missing diagnostic was found for this small metadata scan.
  • Additional user focus: none was provided.

Two independent review rounds converged with no unresolved or undeduplicated candidates. The three blocking findings are attached inline.

// the identity subject, so a caller sees every same-named entry regardless of
// its host pattern. Password material is masked below, so nothing sensitive
// leaks even across host variants of the same name.
if (!canSeeAll && (currentUser == null || !userIdent.getQualifiedUser()

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.

[P1] Scope the self case to the exact authenticated account. Doris stores multiple User entries for one name when their hosts differ, and ConnectContext.currentUserIdentity is the exact user@host entry that matched login. With a restricted u@hostA and a separate privileged u@hostB, this username-only comparison admits both rows and exposes host, global privilege flags, and password-policy state from the other account. Please compare the complete UserIdentity here and add a same-name/different-host regression.

}

struct TShowUserRequest {
1: optional Types.TUserIdentity current_user_ident // to filter rows by the requesting user's privileges

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.

[P1] Preserve session-mapped roles across this callback. Authentication integrations keep their granted roles only in the originating ConnectContext, and Auth.getRolesByUserWithLdap consults that set only on the session thread. The BE callback reaches a Thrift worker with just this identity, so an OIDC/JIT user whose mapped role has global ADMIN_PRIV or GRANT_PRIV is evaluated as a normal user and cannot see all rows. Please carry the immutable authenticated-role set (or a trusted precomputed authorization decision) through the plan/request and cover a mapped-role administrator.


@Test
public void testShowUser() {
public void testShowUser() throws Exception {

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.

[P1] Remove the now-unused TShowUserResult import. This rewritten test no longer declares a TShowUserResult, and the CheckStyle job on this exact head fails at line 69 with UnusedImports. Please remove that import so the required FE style gate passes.

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 62.96% (29577/46980)
Line Coverage 48.02% (310290/646183)
Region Coverage 43.61% (250644/574709)
Branch Coverage 45.11% (116562/258380)

@CalvinKirs

Copy link
Copy Markdown
Member Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

Cloud UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 77.71% (2053/2642)
Line Coverage 65.65% (37473/57080)
Region Coverage 52.83% (34900/66057)
Branch Coverage 56.30% (11228/19942)

@hello-stephen

Copy link
Copy Markdown
Contributor

FE UT Coverage Report

Increment line coverage 100.00% (11/11) 🎉
Increment coverage report
Complete coverage report

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 62.95% (29573/46980)
Line Coverage 47.99% (310092/646183)
Region Coverage 43.57% (250428/574709)
Branch Coverage 45.10% (116525/258380)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100% (0/0) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 76.03% (34594/45503)
Line Coverage 61.07% (390101/638812)
Region Coverage 57.05% (326610/572518)
Branch Coverage 57.96% (149332/257641)

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17566	3039	3016	3016
q2	2086	248	227	227
q3	10259	895	500	500
q4	4675	249	205	205
q5	7675	562	396	396
q6	137	113	93	93
q7	525	523	390	390
q8	9230	890	926	890
q9	3426	2449	2384	2384
q10	6533	835	748	748
q11	388	196	183	183
q12	613	261	204	204
q13	18123	1520	1153	1153
q14	161	149	138	138
q15	q16	427	392	365	365
q17	1347	901	779	779
q18	3092	2266	2220	2220
q19	1146	912	804	804
q20	371	291	209	209
q21	5259	1697	1807	1697
q22	335	269	224	224
Total cold run time: 93374 ms
Total hot run time: 16825 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	3406	3329	3349	3329
q2	522	399	370	370
q3	2186	2406	2158	2158
q4	1188	1155	893	893
q5	2189	2113	2111	2111
q6	163	122	87	87
q7	1025	931	854	854
q8	1609	1407	1408	1407
q9	3127	3114	3096	3096
q10	1829	1812	1609	1609
q11	355	272	252	252
q12	454	433	346	346
q13	1483	1525	1152	1152
q14	179	172	162	162
q15	q16	397	389	351	351
q17	3646	3292	3206	3206
q18	4775	4375	4702	4375
q19	878	817	931	817
q20	1018	988	820	820
q21	3817	3081	3293	3081
q22	397	360	311	311
Total cold run time: 34643 ms
Total hot run time: 30787 ms

@hello-stephen

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

query5	4247	413	335	335
query6	384	136	126	126
query7	4955	426	244	244
query8	289	128	123	123
query9	8683	2898	2897	2897
query10	374	219	177	177
query11	5379	1035	902	902
query12	116	68	72	68
query13	1186	476	310	310
query14	6179	2185	2070	2070
query14_1	1988	1996	1949	1949
query15	177	122	117	117
query16	919	362	353	353
query17	809	465	372	372
query18	2344	325	260	260
query19	170	145	112	112
query20	71	72	73	72
query21	205	103	88	88
query22	5319	5486	5273	5273
query23	6697	6254	5919	5919
query23_1	6083	5986	5869	5869
query24	7337	1084	770	770
query24_1	766	746	773	746
query25	421	279	242	242
query26	1225	233	125	125
query27	2796	410	260	260
query28	4705	1496	1504	1496
query29	899	432	340	340
query30	240	157	130	130
query31	835	391	320	320
query32	125	70	76	70
query33	474	226	177	177
query34	1008	813	504	504
query35	401	403	335	335
query36	571	568	531	531
query37	120	84	74	74
query38	985	836	833	833
query39	495	471	473	471
query39_1	473	447	513	447
query40	209	90	74	74
query41	54	51	52	51
query42	75	77	71	71
query43	240	241	209	209
query44	1023	540	539	539
query45	108	109	102	102
query46	783	825	511	511
query47	770	764	695	695
query48	305	313	235	235
query49	531	237	189	189
query50	774	258	188	188
query51	8147	8194	8174	8174
query52	76	67	63	63
query53	197	204	151	151
query54	218	169	158	158
query55	85	60	58	58
query56	182	161	165	161
query57	668	721	652	652
query58	202	164	167	164
query59	1216	1199	1116	1116
query60	255	177	173	173
query61	137	164	121	121
query62	357	208	177	177
query63	170	140	138	138
query64	2706	686	656	656
query65	1631	1579	1624	1579
query66	1886	285	230	230
query67	10064	9929	9555	9555
query68	3064	1232	771	771
query69	352	230	200	200
query70	662	599	589	589
query71	250	176	161	161
query72	2326	1730	1581	1581
query73	648	579	341	341
query74	2009	1202	1163	1163
query75	1165	1113	956	956
query76	2380	735	533	533
query77	268	252	215	215
query78	4002	3663	3182	3182
query79	2734	810	602	602
query80	1554	322	280	280
query81	514	156	134	134
query82	654	125	100	100
query83	292	215	196	196
query84	311	112	91	91
query85	804	362	304	304
query86	468	172	174	172
query87	1038	965	900	900
query88	2821	2118	2097	2097
query89	286	196	176	176
query90	2020	128	131	128
query91	132	121	97	97
query92	89	62	72	62
query93	1609	1062	721	721
query94	621	245	229	229
query95	513	245	293	245
query96	828	599	255	255
query97	1109	1034	1043	1034
query98	157	138	131	131
query99	414	354	314	314
Total cold run time: 179042 ms
Total hot run time: 81853 ms

@hello-stephen

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

query1	0.01	0.01	0.00
query2	0.07	0.04	0.04
query3	0.25	0.10	0.10
query4	1.61	0.10	0.09
query5	0.17	0.15	0.16
query6	1.26	0.67	0.68
query7	0.03	0.01	0.00
query8	0.05	0.03	0.03
query9	0.28	0.22	0.21
query10	0.35	0.36	0.34
query11	0.16	0.11	0.11
query12	0.15	0.12	0.12
query13	0.32	0.32	0.30
query14	0.45	0.45	0.45
query15	0.36	0.34	0.36
query16	0.22	0.23	0.21
query17	0.73	0.67	0.67
query18	0.18	0.16	0.18
query19	1.21	1.20	1.07
query20	0.02	0.01	0.01
query21	15.46	0.16	0.12
query22	5.05	0.04	0.04
query23	16.17	0.24	0.09
query24	3.01	0.31	0.26
query25	0.11	0.04	0.04
query26	0.77	0.16	0.11
query27	0.04	0.03	0.03
query28	3.74	0.58	0.29
query29	12.48	3.18	2.56
query30	0.27	0.10	0.12
query31	2.76	0.37	0.17
query32	3.51	0.30	0.24
query33	1.53	1.46	1.52
query34	15.37	2.26	1.77
query35	1.78	1.72	1.72
query36	0.47	0.29	0.28
query37	0.07	0.04	0.04
query38	0.04	0.03	0.03
query39	0.03	0.03	0.02
query40	0.12	0.08	0.08
query41	0.08	0.03	0.02
query42	0.04	0.02	0.02
query43	0.04	0.02	0.03
Total cold run time: 90.82 s
Total hot run time: 14.58 s

…word columns

Return mysql.user rows according to the requesting user's privileges: role
administrators (ADMIN_PRIV or GRANT_PRIV) still see every account, while other
users see only their own account. The authentication_string and
password_policy.history_passwords columns are always rendered as *** for every
caller, including accounts with an empty password.

The caller identity is threaded through TShowUserRequest (mirroring the sibling
schema-table scanners) so the FE can filter rows; a request without an identity
returns no rows. Add coverage: FrontendServiceImplTest#testShowUser asserts the
admin, normal-user, and no-identity behaviors, and a new
test_mysql_user_visibility regression checks the end-to-end admin vs
normal-user visibility and masking.
@CalvinKirs

Copy link
Copy Markdown
Member Author

run buildall

@hello-stephen

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

------ Round 1 ----------------------------------
============================================
q1	17269	3078	3023	3023
q2	2092	256	213	213
q3	10157	873	530	530
q4	4673	253	209	209
q5	7718	558	392	392
q6	140	114	93	93
q7	533	504	381	381
q8	9294	853	915	853
q9	3443	2385	2378	2378
q10	6474	867	733	733
q11	408	200	188	188
q12	611	258	201	201
q13	18123	1522	1168	1168
q14	158	152	140	140
q15	q16	440	397	364	364
q17	1417	869	816	816
q18	3075	2246	2225	2225
q19	1207	941	670	670
q20	391	303	204	204
q21	5262	1709	1866	1709
q22	331	271	232	232
Total cold run time: 93216 ms
Total hot run time: 16722 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	3399	3333	3336	3333
q2	510	395	359	359
q3	2196	2270	2133	2133
q4	1190	1168	882	882
q5	2162	2110	2123	2110
q6	166	131	89	89
q7	1032	930	830	830
q8	1592	1408	1393	1393
q9	3124	3099	3086	3086
q10	1826	1805	1601	1601
q11	356	275	249	249
q12	454	427	333	333
q13	1472	1502	1148	1148
q14	168	178	154	154
q15	q16	399	394	361	361
q17	3575	3331	3171	3171
q18	4775	4403	4697	4403
q19	879	841	833	833
q20	1156	992	838	838
q21	3846	3088	3322	3088
q22	391	352	315	315
Total cold run time: 34668 ms
Total hot run time: 30709 ms

@hello-stephen

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

query5	4261	422	340	340
query6	406	139	127	127
query7	4905	404	254	254
query8	318	126	113	113
query9	8673	2878	2897	2878
query10	388	231	192	192
query11	5367	1034	933	933
query12	122	72	71	71
query13	1209	455	345	345
query14	6089	2195	2069	2069
query14_1	1979	1963	1947	1947
query15	176	119	117	117
query16	949	391	363	363
query17	973	461	370	370
query18	2380	333	242	242
query19	168	139	108	108
query20	85	69	75	69
query21	203	103	86	86
query22	5386	5338	5421	5338
query23	6701	6228	5803	5803
query23_1	6109	6025	6103	6025
query24	7234	1079	782	782
query24_1	825	801	801	801
query25	417	275	233	233
query26	1224	241	124	124
query27	2783	415	265	265
query28	4621	1491	1503	1491
query29	923	434	327	327
query30	241	155	127	127
query31	841	396	326	326
query32	125	71	71	71
query33	450	220	162	162
query34	1025	822	477	477
query35	392	395	335	335
query36	569	557	515	515
query37	118	78	70	70
query38	1013	836	807	807
query39	490	492	486	486
query39_1	466	457	469	457
query40	207	89	75	75
query41	54	55	52	52
query42	75	71	76	71
query43	234	237	208	208
query44	1061	550	564	550
query45	120	111	103	103
query46	754	840	529	529
query47	762	752	701	701
query48	325	314	222	222
query49	552	249	182	182
query50	698	265	189	189
query51	8137	8108	8247	8108
query52	68	73	59	59
query53	192	201	155	155
query54	234	171	185	171
query55	76	61	57	57
query56	209	192	169	169
query57	703	650	675	650
query58	225	177	166	166
query59	1206	1241	1108	1108
query60	249	185	177	177
query61	139	149	157	149
query62	359	210	184	184
query63	167	144	145	144
query64	2702	740	551	551
query65	1598	1619	1581	1581
query66	1825	254	204	204
query67	10006	9461	9585	9461
query68	3017	1127	754	754
query69	344	227	197	197
query70	681	624	646	624
query71	247	165	164	164
query72	2378	1712	1608	1608
query73	645	614	366	366
query74	2008	1260	1143	1143
query75	1185	1095	966	966
query76	2328	724	579	579
query77	250	245	209	209
query78	3921	3721	3200	3200
query79	2750	859	596	596
query80	1626	323	292	292
query81	495	153	142	142
query82	618	128	110	110
query83	286	207	189	189
query84	264	116	92	92
query85	865	357	305	305
query86	403	183	175	175
query87	1026	994	896	896
query88	2773	2115	2099	2099
query89	284	191	172	172
query90	1929	131	128	128
query91	134	125	99	99
query92	80	68	70	68
query93	1893	1088	671	671
query94	649	248	223	223
query95	510	344	229	229
query96	841	572	273	273
query97	1060	1023	995	995
query98	169	139	136	136
query99	439	337	309	309
Total cold run time: 179051 ms
Total hot run time: 81801 ms

@hello-stephen

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

query1	0.00	0.00	0.00
query2	0.08	0.04	0.04
query3	0.25	0.11	0.11
query4	1.60	0.10	0.09
query5	0.17	0.16	0.15
query6	1.25	0.67	0.68
query7	0.03	0.01	0.00
query8	0.05	0.03	0.02
query9	0.29	0.22	0.21
query10	0.36	0.35	0.34
query11	0.16	0.12	0.12
query12	0.14	0.12	0.12
query13	0.30	0.30	0.32
query14	0.44	0.45	0.44
query15	0.36	0.34	0.33
query16	0.21	0.22	0.24
query17	0.65	0.67	0.67
query18	0.19	0.18	0.17
query19	1.14	1.16	1.11
query20	0.01	0.02	0.02
query21	15.43	0.15	0.12
query22	5.10	0.05	0.04
query23	16.18	0.24	0.10
query24	2.98	0.31	0.30
query25	0.09	0.06	0.03
query26	0.79	0.17	0.12
query27	0.05	0.03	0.02
query28	3.67	0.57	0.27
query29	12.45	3.15	2.54
query30	0.25	0.12	0.13
query31	2.75	0.37	0.17
query32	3.52	0.32	0.23
query33	1.44	1.38	1.61
query34	15.39	2.16	1.75
query35	1.72	1.71	1.71
query36	0.45	0.30	0.28
query37	0.07	0.04	0.04
query38	0.05	0.04	0.04
query39	0.02	0.02	0.03
query40	0.12	0.08	0.07
query41	0.09	0.02	0.02
query42	0.04	0.02	0.02
query43	0.03	0.03	0.03
Total cold run time: 90.36 s
Total hot run time: 14.55 s

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 62.95% (29573/46980)
Line Coverage 47.99% (310090/646183)
Region Coverage 43.57% (250411/574709)
Branch Coverage 45.09% (116516/258380)

@CalvinKirs
CalvinKirs merged commit 38339c5 into apache:master Sep 3, 2026
30 of 33 checks passed
@CalvinKirs
CalvinKirs deleted the mysql_pw branch September 3, 2026 06:55
github-actions Bot pushed a commit that referenced this pull request Sep 3, 2026
…word columns (#67444)

### What this PR does

Adjusts what `mysql.user` returns so the visible rows follow the
requesting user's privileges, and keeps password-derived columns out of
the result entirely.

- Rows are now scoped to the caller: role administrators (`ADMIN_PRIV`
or `GRANT_PRIV`) still see every account; other users see only their own
account.
- The `authentication_string` and `password_policy.history_passwords`
columns are always rendered as `***` for every caller, including
accounts with an empty password.

To make row scoping possible, the caller identity is threaded through
`TShowUserRequest` (the same pattern already used by the sibling
schema-table scanners such as `user_privileges` and `processlist`), so
the FE can filter rows. A request without an identity returns no rows.

### Compatibility

- `current_user_ident` is an `optional` Thrift field, wire-compatible in
both directions.
- No metadata / editlog / storage-format change, so downgrade is clean.
- During a rolling window where a new FE talks to an old BE that does
not set the field, `mysql.user` returns no rows (fail-closed) until the
BE is also upgraded; upgrading BE before FE avoids this.

### Tests

- `FrontendServiceImplTest#testShowUser` asserts the administrator,
normal-user, and no-identity behaviors, including that the password
columns are masked.
- `regression-test/suites/auth_p0/test_mysql_user_visibility.groovy`
covers the end-to-end admin-vs-normal-user visibility and masking.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants