Skip to content

ATLAS-5401: client configuration to support custom token supplier - #752

Merged
nixonrodrigues merged 2 commits into
apache:masterfrom
mneethiraj:ATLAS-5401
Sep 10, 2026
Merged

ATLAS-5401: client configuration to support custom token supplier#752
nixonrodrigues merged 2 commits into
apache:masterfrom
mneethiraj:ATLAS-5401

Conversation

@mneethiraj

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Updated Atlas client for applications to register a customer JWT token provider - using configuration atlas.rest.auth.token.supplier.

How was this patch tested?

  • added unit tests for the enhancement introduced in this PR
  • verified that all existing tests successfully complete

@mneethiraj
mneethiraj requested review from chaitalicod, nixonrodrigues and pinal-shah and a lite review from Copilot September 9, 2026 23:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Pull request overview

Adds support for configuring a custom JWT token supplier for Atlas clients via atlas.rest.auth.token.supplier, while keeping the default JWT sourcing behavior working.

Changes:

  • Replaces the internal TokenRetriever abstraction with Supplier<String> for JWT retrieval.
  • Adds reflective instantiation of a configured token supplier class (with optional Configuration constructor).
  • Adds unit tests covering default and custom supplier wiring.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
client/common/src/main/java/org/apache/atlas/token/retriever/TokenRetriever.java Removes the old token retriever interface in favor of Supplier.
client/common/src/main/java/org/apache/atlas/token/retriever/JwTokenRetrieverDefault.java Converts default JWT retriever to Supplier<String> and adapts retrieval flow.
client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java Adds config-driven token supplier loading and uses it for JWT header injection.
client/client-v2/src/test/java/org/apache/atlas/AtlasClientV2Test.java Adds tests for default/custom token supplier initialization.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java
Comment thread client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java
Comment thread client/common/src/main/java/org/apache/atlas/AtlasBaseClient.java

@nixonrodrigues nixonrodrigues left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Changes looks good. I tested the AtlasClient In IntegrationTest with all variants of JWT token inputs such as -
testBasicAuth

  • testJwtFromFile
  • testJwtFromEnv
  • testCustomTokenSupplier

it looks good.

@Test
    public void testCustomTokenSupplier() throws Exception {
        Configuration configuration = new BaseConfiguration();

        configuration.setProperty("atlas.rest.auth.token.supplier", StaticJwtSupplier.class.getName());

        StaticJwtSupplier.TOKEN = jwtToken;

        AtlasClientV2 client = new AtlasClientV2(configuration, new String[] {ATLAS_URL}, null);

        assertTrue(client.isServerReady(), "isServerReady() should succeed with custom token supplier");
    }

    public static class StaticJwtSupplier implements Supplier<String> {
        static String TOKEN;

        @Override
        public String get() {
            return TOKEN;
        }
    }

@nixonrodrigues
nixonrodrigues merged commit fb78b7d into apache:master Sep 10, 2026
2 checks passed
asf-gitbox-commits pushed a commit that referenced this pull request Sep 10, 2026
…er (#752)

* ATLAS-5401: Atlas client configuration to support custom token supplier
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.

3 participants