Class DefaultTokenPlatformClientFactory
java.lang.Object
io.confluent.kafka.odyssey.auth.DefaultTokenPlatformClientFactory
- All Implemented Interfaces:
TokenPlatformClientFactory
Default implementation of
TokenPlatformClientFactory.
This factory creates the appropriate TokenPlatformClient based on the endpoint configuration:
- If endpoint starts with "local://", creates
NoAuthTokenPlatformClientfor local development - Otherwise, creates DefaultTokenPlatformClient with SPIRE mTLS authentication
DefaultTokenPlatformClient is loaded via reflection to avoid a compile-time dependency on
io.confluent.srj:grpc, which transitively pulls in io.confluent.srj:spire.
This keeps the CP build free of CC-only dependencies. The implementation class is provided
at runtime via the ce-odyssey-tp-impl Bazel target.
- See Also:
-
Field Summary
Fields inherited from interface TokenPlatformClientFactory
LOCAL_DEV_SENTINEL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a TokenPlatformClient based on the provided configuration.
-
Constructor Details
-
DefaultTokenPlatformClientFactory
public DefaultTokenPlatformClientFactory()
-
-
Method Details
-
create
public TokenPlatformClient create(String endpoint, String spireAgentUrl) throws TokenPlatformException Description copied from interface:TokenPlatformClientFactoryCreates a TokenPlatformClient based on the provided configuration.If the endpoint starts with
TokenPlatformClientFactory.LOCAL_DEV_SENTINEL, aNoAuthTokenPlatformClientis returned for local development. Otherwise, ais created with SPIRE mTLS authentication.invalid reference
DefaultTokenPlatformClient- Specified by:
createin interfaceTokenPlatformClientFactory- Parameters:
endpoint- Token Platform endpoint URL, or "local://noauth" for local dev modespireAgentUrl- SPIRE agent socket URL (ignored in local dev mode)- Returns:
- Configured TokenPlatformClient instance
- Throws:
TokenPlatformException- if client creation fails (e.g., invalid config)
-