Package ai.clarity.codeartifact
Class TokenFactory
java.lang.Object
ai.clarity.codeartifact.TokenFactory
Calls the CodeArtifact
GetAuthorizationToken API.
Every overload issues a request; the caching lives in CodeArtifactToken.
-
Method Summary
Modifier and TypeMethodDescriptionstatic software.amazon.awssdk.services.codeartifact.model.GetAuthorizationTokenResponsegetAuthorizationToken(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.GetAuthorizationTokenResponsegetAuthorizationToken(ai.clarity.codeartifact.CodeArtifactUrl codeArtifactUrl, String profileName) Requests the token with the given AWS profile, or with the default credentials provider chain whenprofileNameisnull.static software.amazon.awssdk.services.codeartifact.model.GetAuthorizationTokenResponsegetAuthorizationToken(String codeArtifactUrl, String profileName) Requests the token for a repository url with the given AWS profile.
-
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 urlprofileName- the AWS profile to authenticate with, ornullto use the default credentials provider chain- Returns:
- the API response carrying the authorization token and its expiration
- Throws:
MalformedURLException- whencodeArtifactUrlis 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 whenprofileNameisnull.- Parameters:
codeArtifactUrl- the parsed CodeArtifact repository url, which carries the region the client targetsprofileName- the AWS profile to authenticate with, ornullto 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 targetscredentials- the service account credentials to authenticate with- Returns:
- the API response carrying the authorization token and its expiration
-