Class AuthConfig
- java.lang.Object
-
- com.codedstream.otterstream.inference.config.AuthConfig
-
public class AuthConfig extends Object
Configuration for authentication with remote ML inference endpoints.Supports various authentication methods including API keys, bearer tokens, and custom headers. Use this when connecting to remote inference services like AWS SageMaker, Google Vertex AI, or custom REST APIs.
Usage Example:
// API Key authentication AuthConfig auth = AuthConfig.builder() .apiKey("your-api-key-here") .build(); // Bearer token authentication AuthConfig auth = AuthConfig.builder() .token("Bearer eyJhbGc...") .build(); // Custom headers AuthConfig auth = AuthConfig.builder() .headers(Map.of( "X-API-Key", "key123", "X-Client-ID", "client456" )) .build();- Since:
- 1.0.0
- Author:
- Nestor Martourez, Sr Software and Data Streaming Engineer @ CodedStreams
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAuthConfig.BuilderBuilder for creating AuthConfig instances.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AuthConfig.Builderbuilder()Creates a new builder for AuthConfig.StringgetApiKey()Gets the API key.Map<String,String>getHeaders()Gets custom authentication headers.StringgetToken()Gets the bearer token.
-
-
-
Method Detail
-
getApiKey
public String getApiKey()
Gets the API key.- Returns:
- API key, or null if not configured
-
getToken
public String getToken()
Gets the bearer token.- Returns:
- bearer token, or null if not configured
-
getHeaders
public Map<String,String> getHeaders()
Gets custom authentication headers.- Returns:
- immutable map of header name-value pairs
-
builder
public static AuthConfig.Builder builder()
Creates a new builder for AuthConfig.- Returns:
- a new builder instance
-
-