EnvironmentInterceptor

class EnvironmentInterceptor(environment: String) : <ERROR CLASS> ERROR CLASS: Symbol not found for Interceptor

Interceptor that attaches the X-Target-Environment header to every request, sourced once from configuration (io.rekast.sdk.utils.ApiConfig.environment) rather than being threaded through every service method as a parameter.

The header is required by all product endpoints and by the OAuth2 (oauth2/token, bc-authorize) endpoints, but not by the API-user provisioning and access-token bootstrap endpoints (createApiUser, getApiUser, createApiKey, getAccessToken), which are therefore skipped:

  • any path containing an apiuser segment (create/get API user, create API key), and

  • the plain access-token endpoint /{productType}/token/ (identified by a final token segment with no oauth2 segment — the OAuth2 token endpoint /{productType}/oauth2/token/ still receives it).

Parameters

environment

The target environment (e.g., "sandbox" or "production").

Constructors

Link copied to clipboard
constructor(environment: String)

Functions

Link copied to clipboard
open override fun intercept(chain: ERROR CLASS: Symbol not found for Interceptor.Chain): ERROR CLASS: Symbol not found for Response

Adds the X-Target-Environment header unless the request targets an auth-bootstrap endpoint that does not accept it.