Class: Aws::Sigv2::Credentials

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Credentials

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


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

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)

Returns:

  • (String)


22
23
24
# File 'gems/aws-sigv2/lib/aws-sigv2/credentials.rb', line 22

def access_key_id
  @access_key_id
end

#secret_access_keyString (readonly)

Returns:

  • (String)


25
26
27
# File 'gems/aws-sigv2/lib/aws-sigv2/credentials.rb', line 25

def secret_access_key
  @secret_access_key
end

#session_tokenString? (readonly)

Returns:

  • (String, nil)


28
29
30
# File 'gems/aws-sigv2/lib/aws-sigv2/credentials.rb', line 28

def session_token
  @session_token
end