Interface TokenPlatformClientFactory
- All Known Implementing Classes:
DefaultTokenPlatformClientFactory
public interface TokenPlatformClientFactory
Factory interface for creating
TokenPlatformClient instances.
This factory abstracts the instantiation of Token Platform clients, allowing different implementations to be used based on configuration. The factory enables:
- Production mode: Creates
with SPIRE mTLS
invalid reference
DefaultTokenPlatformClient - Local dev mode: Creates
NoAuthTokenPlatformClientwhen endpoint starts with "local://"
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringSentinel prefix for local development mode endpoints. -
Method Summary
Modifier and TypeMethodDescriptionCreates a TokenPlatformClient based on the provided configuration.static TokenPlatformClientFactoryReturns the default factory implementation.
-
Field Details
-
LOCAL_DEV_SENTINEL
Sentinel prefix for local development mode endpoints. When the endpoint starts with this prefix, a no-auth client is created.- See Also:
-
-
Method Details
-
create
Creates a TokenPlatformClient based on the provided configuration.If the endpoint starts with
LOCAL_DEV_SENTINEL, aNoAuthTokenPlatformClientis returned for local development. Otherwise, ais created with SPIRE mTLS authentication.invalid reference
DefaultTokenPlatformClient- 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)
-
getDefault
Returns the default factory implementation.- Returns:
- A new instance of
DefaultTokenPlatformClientFactory
-