Class: Aws::S3::ExpressCredentialsProvider

Inherits:
Object
  • Object
show all
Defined in:
gems/aws-sdk-s3/lib/aws-sdk-s3/express_credentials_provider.rb

Overview

Returns Credentials class for S3 Express. Accepts CreateSession params as options. See Client#create_session for details.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ ExpressCredentialsProvider

Returns a new instance of ExpressCredentialsProvider.

Parameters:

  • options (Hash) (defaults to: {})

Options Hash (options):

  • :client (Client)

    The S3 client used to create the session.

  • :session_mode (String) — default: see: {Client#create_session}
  • :before_refresh (Callable)

    Proc called before credentials are refreshed.



13
14
15
16
17
# File 'gems/aws-sdk-s3/lib/aws-sdk-s3/express_credentials_provider.rb', line 13

def initialize(options = {})
  @client = options.delete(:client)
  @options = options
  @cache = EXPRESS_CREDENTIALS_CACHE
end

Instance Attribute Details

#clientObject

Returns the value of attribute client.



23
24
25
# File 'gems/aws-sdk-s3/lib/aws-sdk-s3/express_credentials_provider.rb', line 23

def client
  @client
end

Instance Method Details

#express_credentials_for(bucket) ⇒ Object



19
20
21
# File 'gems/aws-sdk-s3/lib/aws-sdk-s3/express_credentials_provider.rb', line 19

def express_credentials_for(bucket)
  @cache[bucket] || new_credentials_for(bucket)
end