Record Class TokenPlatformClientConfig
- Record Components:
tokenPlatformUrl- the Token Platform gRPC endpoint URL (always required)authMode- the SPIRE authentication mode (always required)spireAgentUrl- the SPIRE agent socket URL — used iffauthMode == SPIRE_AGENTnamespace- the Kubernetes namespace for the SVID secret — used iffauthMode == SPIRE_K8S_SECRETserviceAcct- the Kubernetes service account name for the SVID secret — used iffauthMode == SPIRE_K8S_SECRETpodLabel- the optional pod label for the SVID secret — null is the convention for K1 brokers (mirrorsSpireX509ClientK8sSupplierandSpireClientFactory). Only consulted whenauthMode == SPIRE_K8S_SECRET.requestTimeoutMs- gRPC request timeout in millisecondsmaxRetries- maximum number of retry attempts for transient failures
TokenPlatformClient.
This record holds all configuration needed to connect to the Token Platform service using SPIRE mTLS authentication. Two SPIRE auth modes are supported:
TokenPlatformClientConfig.AuthMode.SPIRE_AGENT: SVID is fetched from a SPIRE Workload API socket atspireAgentUrl. Used by K2 broker pods, which mount the agent socket.TokenPlatformClientConfig.AuthMode.SPIRE_K8S_SECRET: SVID is read from a Kubernetes secret keyed offnamespace+serviceAcct+ optionalpodLabel, via the Kubernetes API. Used by K1 broker pods, which do not mount a SPIRE agent.
Use the create(String, String) factory for SPIRE_AGENT mode and the
createWithK8sSecret(String, String, String, String) factory for SPIRE_K8S_SECRET
mode. Field-level validation (which credentials are required for which mode, timeout/retry
ranges) lives upstream in OdysseyIntegrationManager.Builder.build(); the compact
constructor only enforces null safety on the always-required fields to avoid duplicating
the same checks at multiple layers.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumSPIRE authentication mode for the gRPC channel to Token Platform. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault max retries: 3 attemptsstatic final intDefault request timeout: 5 seconds -
Constructor Summary
ConstructorsConstructorDescriptionTokenPlatformClientConfig(String tokenPlatformUrl, TokenPlatformClientConfig.AuthMode authMode, String spireAgentUrl, String namespace, String serviceAcct, String podLabel, int requestTimeoutMs, int maxRetries) Compact constructor — null safety only. -
Method Summary
Modifier and TypeMethodDescriptionauthMode()Returns the value of theauthModerecord component.static TokenPlatformClientConfigCreates a configuration for SPIRE agent mode with default timeout and retry settings.static TokenPlatformClientConfigcreateWithK8sSecret(String tokenPlatformUrl, String namespace, String serviceAcct, String podLabel) Creates a configuration for SPIRE K8s-secret mode with default timeout and retry settings.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of themaxRetriesrecord component.Returns the value of thenamespacerecord component.podLabel()Returns the value of thepodLabelrecord component.intReturns the value of therequestTimeoutMsrecord component.Returns the value of theserviceAcctrecord component.Returns the value of thespireAgentUrlrecord component.Returns the value of thetokenPlatformUrlrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
DEFAULT_REQUEST_TIMEOUT_MS
public static final int DEFAULT_REQUEST_TIMEOUT_MSDefault request timeout: 5 seconds- See Also:
-
DEFAULT_MAX_RETRIES
public static final int DEFAULT_MAX_RETRIESDefault max retries: 3 attempts- See Also:
-
-
Constructor Details
-
TokenPlatformClientConfig
public TokenPlatformClientConfig(String tokenPlatformUrl, TokenPlatformClientConfig.AuthMode authMode, String spireAgentUrl, String namespace, String serviceAcct, String podLabel, int requestTimeoutMs, int maxRetries) Compact constructor — null safety only. All other validation (mode-specific credential presence, timeout/retry ranges) is handled upstream inOdysseyIntegrationManager.Builder.build()ahead of construction.
-
-
Method Details
-
create
Creates a configuration for SPIRE agent mode with default timeout and retry settings.- Parameters:
tokenPlatformUrl- the Token Platform gRPC endpoint URLspireAgentUrl- the SPIRE agent socket URL- Returns:
- a new configuration instance with
TokenPlatformClientConfig.AuthMode.SPIRE_AGENT
-
createWithK8sSecret
public static TokenPlatformClientConfig createWithK8sSecret(String tokenPlatformUrl, String namespace, String serviceAcct, String podLabel) Creates a configuration for SPIRE K8s-secret mode with default timeout and retry settings.Used by K1 broker pods, which do not have a SPIRE Workload API socket mounted but do have a SPIRE-issued SVID provisioned as a Kubernetes secret. The SVID is read via the Kubernetes API at runtime.
- Parameters:
tokenPlatformUrl- the Token Platform gRPC endpoint URLnamespace- the Kubernetes namespace for the SVID secretserviceAcct- the Kubernetes service account namepodLabel- optional pod label; passnullfor the K1 broker convention- Returns:
- a new configuration instance with
TokenPlatformClientConfig.AuthMode.SPIRE_K8S_SECRET
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
tokenPlatformUrl
Returns the value of thetokenPlatformUrlrecord component.- Returns:
- the value of the
tokenPlatformUrlrecord component
-
authMode
-
spireAgentUrl
Returns the value of thespireAgentUrlrecord component.- Returns:
- the value of the
spireAgentUrlrecord component
-
namespace
-
serviceAcct
Returns the value of theserviceAcctrecord component.- Returns:
- the value of the
serviceAcctrecord component
-
podLabel
-
requestTimeoutMs
public int requestTimeoutMs()Returns the value of therequestTimeoutMsrecord component.- Returns:
- the value of the
requestTimeoutMsrecord component
-
maxRetries
public int maxRetries()Returns the value of themaxRetriesrecord component.- Returns:
- the value of the
maxRetriesrecord component
-