Copyright | (c) 2013-2021 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Generates a temporary authorization token for accessing repositories in
the domain. This API requires the codeartifact:GetAuthorizationToken
and sts:GetServiceBearerToken
permissions. For more information about
authorization tokens, see
AWS CodeArtifact authentication and tokens.
CodeArtifact authorization tokens are valid for a period of 12 hours
when created with the login
command. You can call login
periodically
to refresh the token. When you create an authorization token with the
GetAuthorizationToken
API, you can set a custom authorization period,
up to a maximum of 12 hours, with the durationSeconds
parameter.
The authorization period begins after login
or GetAuthorizationToken
is called. If login
or GetAuthorizationToken
is called while
assuming a role, the token lifetime is independent of the maximum
session duration of the role. For example, if you call sts assume-role
and specify a session duration of 15 minutes, then generate a
CodeArtifact authorization token, the token will be valid for the full
authorization period even though this is longer than the 15-minute
session duration.
See Using IAM Roles for more information on controlling session duration.
Synopsis
- data GetAuthorizationToken = GetAuthorizationToken' {}
- newGetAuthorizationToken :: Text -> GetAuthorizationToken
- getAuthorizationToken_domainOwner :: Lens' GetAuthorizationToken (Maybe Text)
- getAuthorizationToken_durationSeconds :: Lens' GetAuthorizationToken (Maybe Natural)
- getAuthorizationToken_domain :: Lens' GetAuthorizationToken Text
- data GetAuthorizationTokenResponse = GetAuthorizationTokenResponse' {}
- newGetAuthorizationTokenResponse :: Int -> GetAuthorizationTokenResponse
- getAuthorizationTokenResponse_expiration :: Lens' GetAuthorizationTokenResponse (Maybe UTCTime)
- getAuthorizationTokenResponse_authorizationToken :: Lens' GetAuthorizationTokenResponse (Maybe Text)
- getAuthorizationTokenResponse_httpStatus :: Lens' GetAuthorizationTokenResponse Int
Creating a Request
data GetAuthorizationToken Source #
See: newGetAuthorizationToken
smart constructor.
GetAuthorizationToken' | |
|
Instances
newGetAuthorizationToken Source #
Create a value of GetAuthorizationToken
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:domainOwner:GetAuthorizationToken'
, getAuthorizationToken_domainOwner
- The 12-digit account number of the AWS account that owns the domain. It
does not include dashes or spaces.
$sel:durationSeconds:GetAuthorizationToken'
, getAuthorizationToken_durationSeconds
- The time, in seconds, that the generated authorization token is valid.
Valid values are 0
and any number between 900
(15 minutes) and
43200
(12 hours). A value of 0
will set the expiration of the
authorization token to the same expiration of the user's role's
temporary credentials.
$sel:domain:GetAuthorizationToken'
, getAuthorizationToken_domain
- The name of the domain that is in scope for the generated authorization
token.
Request Lenses
getAuthorizationToken_domainOwner :: Lens' GetAuthorizationToken (Maybe Text) Source #
The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.
getAuthorizationToken_durationSeconds :: Lens' GetAuthorizationToken (Maybe Natural) Source #
The time, in seconds, that the generated authorization token is valid.
Valid values are 0
and any number between 900
(15 minutes) and
43200
(12 hours). A value of 0
will set the expiration of the
authorization token to the same expiration of the user's role's
temporary credentials.
getAuthorizationToken_domain :: Lens' GetAuthorizationToken Text Source #
The name of the domain that is in scope for the generated authorization token.
Destructuring the Response
data GetAuthorizationTokenResponse Source #
See: newGetAuthorizationTokenResponse
smart constructor.
GetAuthorizationTokenResponse' | |
|
Instances
newGetAuthorizationTokenResponse Source #
Create a value of GetAuthorizationTokenResponse
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.
The following record fields are available, with the corresponding lenses provided for backwards compatibility:
$sel:expiration:GetAuthorizationTokenResponse'
, getAuthorizationTokenResponse_expiration
- A timestamp that specifies the date and time the authorization token
expires.
$sel:authorizationToken:GetAuthorizationTokenResponse'
, getAuthorizationTokenResponse_authorizationToken
- The returned authentication token.
$sel:httpStatus:GetAuthorizationTokenResponse'
, getAuthorizationTokenResponse_httpStatus
- The response's http status code.
Response Lenses
getAuthorizationTokenResponse_expiration :: Lens' GetAuthorizationTokenResponse (Maybe UTCTime) Source #
A timestamp that specifies the date and time the authorization token expires.
getAuthorizationTokenResponse_authorizationToken :: Lens' GetAuthorizationTokenResponse (Maybe Text) Source #
The returned authentication token.
getAuthorizationTokenResponse_httpStatus :: Lens' GetAuthorizationTokenResponse Int Source #
The response's http status code.