← Back to Pull requests

feat: add LOOKUP authorization for lookup endpoints #20687

Closed
unknown closed this pull request without merging on Nov 09, 2026 19:18 UTC
View on GitHub
unknown unknown commented on Oct 22, 2026 10:37 UTC
Author

Description

Lookup HTTP endpoints currently use CONFIG:CONFIG, which also grants access to cluster configuration endpoints. This PR adds the LOOKUP resource type and the default-false druid.auth.enableLookupAuthorization setting. With the setting disabled, lookup endpoints retain their existing authorization behavior.

When enabled, requests for a named lookup check LOOKUP:tier/lookup_name. Bulk GET responses omit lookups without READ authorization. Bulk writes check WRITE on every affected lookup before making changes. Deleting an empty tier checks its tier name. An empty write checks LOOKUP:LOOKUP.

The resource filter handles names present in the route. For bulk requests, resource methods pass parsed request bodies or fetched results to the filter once the lookup names are available. Other CONFIG endpoints and lookup use during query execution are unchanged.

Release note

Administrators can enable lookup-specific HTTP permissions with druid.auth.enableLookupAuthorization. The setting is disabled by default, preserving existing authorization behavior on upgrade. Enabling it changes lookup API authorization from CONFIG permissions to LOOKUP permissions.

Upgrade: First upgrade all nodes with the flag disabled and add the required LOOKUP grants. Then enable druid.auth.enableLookupAuthorization through a rolling restart. Wait until every relevant node uses the enabled flag before removing CONFIG grants that are no longer needed.

Downgrade: Review current users and restore required CONFIG grants, including for users added since migration. CONFIG grants provide broader access, so do not blindly restore historical grants or permissions for removed users. Disable the flag through a rolling restart and wait until all relevant nodes use the disabled flag before downgrading.

##### Key changed/added classes in this PR

LookupResourceFilter
ResourceType
AuthConfig
LookupCoordinatorResource
LookupIntrospectionResource
LookupListeningResource

This PR has:

  • been self-reviewed.

  • added documentation for new or modified features or behaviors.

  • a release note entry in the PR description.

  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.

  • added or updated version, license, or notice information in licenses.yaml

  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.

  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.

  • added integration tests.

  • been tested in a test Druid cluster.
  • Diff: 358 lines (+268 / -90) across 4 files Reviewer: maytasm Review duration: 26440m
    All Vouch review confidence checks passed
    Residual risk 0.26 = Change Risk (0.66) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.66 · 358 lines diff across 4 files
    0.66
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.352
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.066
    Real PR Conversation Timeline
    1 comments
    "Review active on #20687"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 65.8% (HIGH) · Higher = larger blast radius
    65.8%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 26.0% · Safe to merge
    26.0%
    Repository