libZSservicesZSamazonka-codeartifactZSamazonka-codeartifact
Copyright(c) 2013-2021 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone

Amazonka.CodeArtifact.GetAuthorizationToken

Description

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

Creating a Request

data GetAuthorizationToken Source #

See: newGetAuthorizationToken smart constructor.

Constructors

GetAuthorizationToken' 

Fields

  • domainOwner :: Maybe Text

    The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.

  • durationSeconds :: Maybe Natural

    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.

  • domain :: Text

    The name of the domain that is in scope for the generated authorization token.

Instances

Instances details
Eq GetAuthorizationToken Source # 
Instance details

Defined in Amazonka.CodeArtifact.GetAuthorizationToken

Read GetAuthorizationToken Source # 
Instance details

Defined in Amazonka.CodeArtifact.GetAuthorizationToken

Show GetAuthorizationToken Source # 
Instance details

Defined in Amazonka.CodeArtifact.GetAuthorizationToken

Generic GetAuthorizationToken Source # 
Instance details

Defined in Amazonka.CodeArtifact.GetAuthorizationToken

Associated Types

type Rep GetAuthorizationToken :: Type -> Type #

NFData GetAuthorizationToken Source # 
Instance details

Defined in Amazonka.CodeArtifact.GetAuthorizationToken

Methods

rnf :: GetAuthorizationToken -> () #

Hashable GetAuthorizationToken Source # 
Instance details

Defined in Amazonka.CodeArtifact.GetAuthorizationToken

ToJSON GetAuthorizationToken Source # 
Instance details

Defined in Amazonka.CodeArtifact.GetAuthorizationToken

AWSRequest GetAuthorizationToken Source # 
Instance details

Defined in Amazonka.CodeArtifact.GetAuthorizationToken

Associated Types

type AWSResponse GetAuthorizationToken #

ToHeaders GetAuthorizationToken Source # 
Instance details

Defined in Amazonka.CodeArtifact.GetAuthorizationToken

ToPath GetAuthorizationToken Source # 
Instance details

Defined in Amazonka.CodeArtifact.GetAuthorizationToken

ToQuery GetAuthorizationToken Source # 
Instance details

Defined in Amazonka.CodeArtifact.GetAuthorizationToken

type Rep GetAuthorizationToken Source # 
Instance details

Defined in Amazonka.CodeArtifact.GetAuthorizationToken

type Rep GetAuthorizationToken = D1 ('MetaData "GetAuthorizationToken" "Amazonka.CodeArtifact.GetAuthorizationToken" "libZSservicesZSamazonka-codeartifactZSamazonka-codeartifact" 'False) (C1 ('MetaCons "GetAuthorizationToken'" 'PrefixI 'True) (S1 ('MetaSel ('Just "domainOwner") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "durationSeconds") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Natural)) :*: S1 ('MetaSel ('Just "domain") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text))))
type AWSResponse GetAuthorizationToken Source # 
Instance details

Defined in Amazonka.CodeArtifact.GetAuthorizationToken

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.

Constructors

GetAuthorizationTokenResponse' 

Fields

Instances

Instances details
Eq GetAuthorizationTokenResponse Source # 
Instance details

Defined in Amazonka.CodeArtifact.GetAuthorizationToken

Read GetAuthorizationTokenResponse Source # 
Instance details

Defined in Amazonka.CodeArtifact.GetAuthorizationToken

Show GetAuthorizationTokenResponse Source # 
Instance details

Defined in Amazonka.CodeArtifact.GetAuthorizationToken

Generic GetAuthorizationTokenResponse Source # 
Instance details

Defined in Amazonka.CodeArtifact.GetAuthorizationToken

Associated Types

type Rep GetAuthorizationTokenResponse :: Type -> Type #

NFData GetAuthorizationTokenResponse Source # 
Instance details

Defined in Amazonka.CodeArtifact.GetAuthorizationToken

type Rep GetAuthorizationTokenResponse Source # 
Instance details

Defined in Amazonka.CodeArtifact.GetAuthorizationToken

type Rep GetAuthorizationTokenResponse = D1 ('MetaData "GetAuthorizationTokenResponse" "Amazonka.CodeArtifact.GetAuthorizationToken" "libZSservicesZSamazonka-codeartifactZSamazonka-codeartifact" 'False) (C1 ('MetaCons "GetAuthorizationTokenResponse'" 'PrefixI 'True) (S1 ('MetaSel ('Just "expiration") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe POSIX)) :*: (S1 ('MetaSel ('Just "authorizationToken") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int))))

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.