Skip to content

Excessive LDAP lookups on each UI API call due to repeated memberOf resolution #715

@vishnu-lab

Description

@vishnu-lab

Currently, when navigating between pages in the Trino-gateway UI, each page transition triggers API calls to the gateway. For every API call, a new LbPrincipal is generated by decoding the JWT and fetching the memberOf attribute from LDAP. This causes unnecessary and excessive LDAP queries on every API request, even within the same authenticated session.

Proposed improvements to reduce redundant LDAP calls:

  1. Add an evictable cache: Maintain a cache mapping users to their memberOf attribute values, reducing repeated lookups for the same user within a reasonable TTL (time-to-live).
  2. Include roles in JWT claims: Encode the user’s roles (e.g., memberOf information) directly into the JWT at login time. This would avoid the need for repeated LDAP calls during subsequent API requests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions