Class: Aws::Sigv4::Credentials Private

Inherits:
Object
  • Object
show all
Defined in:
lib/aws-sigv4/credentials.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Users that wish to configure static credentials can use the ‘:access_key_id` and `:secret_access_key` constructor options.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Credentials

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Credentials.

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :access_key_id (required, String)
  • :secret_access_key (required, String)
  • :session_token (String, nil) — default: nil


11
12
13
14
15
16
17
18
19
20
# File 'lib/aws-sigv4/credentials.rb', line 11

def initialize(options = {})
  if options[:access_key_id] && options[:secret_access_key]
    @access_key_id = options[:access_key_id]
    @secret_access_key = options[:secret_access_key]
    @session_token = options[:session_token]
  else
    msg = "expected both :access_key_id and :secret_access_key options"
    raise ArgumentError, msg
  end
end

Instance Attribute Details

#access_key_idString (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (String)


23
24
25
# File 'lib/aws-sigv4/credentials.rb', line 23

def access_key_id
  @access_key_id
end

#secret_access_keyString (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (String)


26
27
28
# File 'lib/aws-sigv4/credentials.rb', line 26

def secret_access_key
  @secret_access_key
end

#session_tokenString? (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (String, nil)


29
30
31
# File 'lib/aws-sigv4/credentials.rb', line 29

def session_token
  @session_token
end

Instance Method Details

#set?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


32
33
34
# File 'lib/aws-sigv4/credentials.rb', line 32

def set?
  !!(access_key_id && secret_access_key)
end