Struct: aws.Credentials

import "../ibm-cos-sdk-go-v2/aws"

Overview

A Credentials is the AWS credentials value for individual credential fields.

Implemented Interfaces

types.AnalyticsFilter, v4.HTTPPresigner, s3.HTTPPresignerV4, types.MetricsFilter, s3.PresignPost, arn.S3ObjectLambdaARN, types.SelectObjectContentEventStream

Structure Field Summary collapse

Method Summary collapse

Structure Field Details

AccessKeyID string

AWS Access key ID

AccountID string

The ID of the account for the credentials.

CanExpire bool

States if the credentials can ex pire or not.

Expires time.Time

The time the credentials will expire at. Should be ignored if CanExpire is false.

SecretAccessKey string

AWS Secret Access Key

ServiceInstanceID string

Service Instance ID

SessionToken string

AWS Session Token

Source string

Source of the credentials

Method Details

func (v Credentials) Expired() bool

Expired returns if the credentials have expired.



159
160
161
162
163
164
165
166
167
// File 'aws/credentials.go', line 159

func (v Credentials) Expired() bool { if v.CanExpire { // Calling Round(0) on the current time will truncate the monotonic // reading only. Ensures credential expiry time is always based on // reported wall-clock time. return !v.Expires.After(sdk.NowTime().Round(0)) } return false }

func (v Credentials) HasKeys() bool

HasKeys returns if the credentials keys are set.



170
171
172
// File 'aws/credentials.go', line 170

func (v Credentials) HasKeys() bool { return len(v.AccessKeyID) > 0 && len(v.SecretAccessKey) > 0 }