Class TokenFactory

java.lang.Object
ai.clarity.codeartifact.TokenFactory

public class TokenFactory extends Object
Calls the CodeArtifact GetAuthorizationToken API.

Every overload issues a request; the caching lives in CodeArtifactToken.

  • Method Summary

    Modifier and Type
    Method
    Description
    static software.amazon.awssdk.services.codeartifact.model.GetAuthorizationTokenResponse
    getAuthorizationToken(ai.clarity.codeartifact.CodeArtifactUrl codeArtifactUrl, CodeArtifactCredentials credentials)
    Requests the token with the static credentials of a service account, bypassing the local AWS profiles.
    static software.amazon.awssdk.services.codeartifact.model.GetAuthorizationTokenResponse
    getAuthorizationToken(ai.clarity.codeartifact.CodeArtifactUrl codeArtifactUrl, String profileName)
    Requests the token with the given AWS profile, or with the default credentials provider chain when profileName is null.
    static software.amazon.awssdk.services.codeartifact.model.GetAuthorizationTokenResponse
    getAuthorizationToken(String codeArtifactUrl, String profileName)
    Requests the token for a repository url with the given AWS profile.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getAuthorizationToken

      public static software.amazon.awssdk.services.codeartifact.model.GetAuthorizationTokenResponse getAuthorizationToken(String codeArtifactUrl, String profileName) throws MalformedURLException
      Requests the token for a repository url with the given AWS profile.
      Parameters:
      codeArtifactUrl - the CodeArtifact repository url
      profileName - the AWS profile to authenticate with, or null to use the default credentials provider chain
      Returns:
      the API response carrying the authorization token and its expiration
      Throws:
      MalformedURLException - when codeArtifactUrl is not a valid CodeArtifact repository url
    • getAuthorizationToken

      public static software.amazon.awssdk.services.codeartifact.model.GetAuthorizationTokenResponse getAuthorizationToken(ai.clarity.codeartifact.CodeArtifactUrl codeArtifactUrl, String profileName)
      Requests the token with the given AWS profile, or with the default credentials provider chain when profileName is null.
      Parameters:
      codeArtifactUrl - the parsed CodeArtifact repository url, which carries the region the client targets
      profileName - the AWS profile to authenticate with, or null to use the default credentials provider chain
      Returns:
      the API response carrying the authorization token and its expiration
    • getAuthorizationToken

      public static software.amazon.awssdk.services.codeartifact.model.GetAuthorizationTokenResponse getAuthorizationToken(ai.clarity.codeartifact.CodeArtifactUrl codeArtifactUrl, CodeArtifactCredentials credentials)
      Requests the token with the static credentials of a service account, bypassing the local AWS profiles.
      Parameters:
      codeArtifactUrl - the parsed CodeArtifact repository url, which carries the region the client targets
      credentials - the service account credentials to authenticate with
      Returns:
      the API response carrying the authorization token and its expiration