Interface SubjectTokenProvider

  • All Implemented Interfaces:

    
    public interface SubjectTokenProvider
    
                        

    Provides a subject token for use in workload identity federation.

    Implementations are responsible for obtaining a short-lived credential from the local environment (e.g. a cloud metadata server or a mounted Kubernetes secret) and returning it as a plain string.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

    • Method Detail

      • getToken

         abstract String getToken(HttpClient httpClient, JsonMapper jsonMapper)

        Synchronously fetches a subject token.

        Parameters:
        httpClient - the HTTP client to use for any network requests
        jsonMapper - the JSON mapper to use for deserializing responses
        Returns:

        the raw token string

      • getTokenAsync

         abstract CompletableFuture<String> getTokenAsync(HttpClient httpClient, JsonMapper jsonMapper)

        Asynchronously fetches a subject token.

        Parameters:
        httpClient - the HTTP client to use for any network requests
        jsonMapper - the JSON mapper to use for deserializing responses
        Returns:

        a CompletableFuture that completes with the raw token string