Skip to content

Add config for USER query history visibility#940

Open
koszti wants to merge 1 commit into
trinodb:mainfrom
koszti:user-query-history-visibility-toggle
Open

Add config for USER query history visibility#940
koszti wants to merge 1 commit into
trinodb:mainfrom
koszti:user-query-history-visibility-toggle

Conversation

@koszti
Copy link
Copy Markdown
Member

@koszti koszti commented Feb 24, 2026

Description

Add a new optional config under uiConfiguration:

  • allowUserRoleToViewAllQueryHistory (default: false)

Behavior:

  • false: keep existing behavior, USER role can only see own query history.
  • true: allow USER role to view query history across users.

ADMIN role behavior is unchanged.

Motivation: some deployments need non-admin operators/support users to have full query visibility without granting full admin access.

Additional context and related issues

Changes included:

  • backend config + query history authorization logic update
  • webapp history filter behavior aligned with the config
  • safer UI config handling when disablePages is missing
  • docs update for the new setting
  • tests covering behavior and config exposure

Release notes

( ) This is not user-visible or is docs only, and no release notes are required.
(x) Release notes are required, with the following suggested text:

* Add `uiConfiguration.allowUserRoleToViewAllQueryHistory` to optionally allow `USER` role to view query history across all users

@cla-bot cla-bot Bot added the cla-signed label Feb 24, 2026
@koszti koszti changed the title Add config for USER query history visibilit Add config for USER query history visibility Feb 24, 2026
@koszti koszti force-pushed the user-query-history-visibility-toggle branch from 82a8e65 to c4d5fdb Compare February 24, 2026 08:14
Comment thread gateway-ha/src/main/java/io/trino/gateway/ha/config/UIConfiguration.java Outdated
Comment thread gateway-ha/src/main/java/io/trino/gateway/ha/config/UIConfiguration.java Outdated
@koszti koszti force-pushed the user-query-history-visibility-toggle branch from 025c4b1 to e787749 Compare February 26, 2026 10:53
@koszti
Copy link
Copy Markdown
Member Author

koszti commented Feb 26, 2026

@Chaho12 thanks for the feedback, I think I addressed all comments.

Comment thread docs/installation.md Outdated
@koszti koszti force-pushed the user-query-history-visibility-toggle branch from e787749 to de2a97c Compare March 2, 2026 15:52
@koszti koszti requested a review from ebyhr March 9, 2026 07:04
@ebyhr ebyhr removed their request for review March 18, 2026 04:58
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 8, 2026

This pull request has gone a while without any activity. Ask for help on #trino-gateway-dev on Trino slack.

@github-actions github-actions Bot added the stale label Apr 8, 2026
@github-actions
Copy link
Copy Markdown

Closing this pull request, as it has been stale for six weeks. Feel free to re-open at any time.

@github-actions github-actions Bot closed this Apr 29, 2026
@mosabua
Copy link
Copy Markdown
Member

mosabua commented Apr 29, 2026

We still want to continue on this. I am reopening for @koszti .. are there outstanding comments to address @ebyhr or @Chaho12 or can we merge this?

@mosabua mosabua reopened this Apr 29, 2026
@github-actions github-actions Bot removed the stale label Apr 30, 2026
}

@JsonProperty
public boolean isUserRoleAllowedToViewAllQueryHistory()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Have you tested this value with non-default value, true?
@JsonProperty on isUserRoleAllowedToViewAllQueryHistory() strips the is prefix → JSON key becomes userRoleAllowedToViewAllQueryHistory, which is different than config (allowUserRoleToViewAllQueryHistory: false) mentioned in installation.md

public class UIConfiguration
{
private List<String> disablePages;
private boolean isUserRoleAllowedToViewAllQueryHistory;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This prefix is is repeated; and the setter parameter isUserRoleAllowedToViewAllQueryHistory
reuses it. Java/Jackson convention is to name the field without is-prefix and only use it on the getter

private boolean xxx;

public boolean isXxx();
public void setXxx(boolean xxx);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How about a test for admin + flag enabled, similar to testUseProvidedUserFilterWhenUserIsAdmin

}, []);

useEffect(() => {
getUIConfiguration()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Btw, duplicate fetch (layout.tsx also calls it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

4 participants