Class: Mongo::Auth::Aws::Credentials Private

Inherits:
Struct
  • Object
show all
Defined in:
lib/mongo/auth/aws/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.

The AWS credential set.

Since:

  • 2.0.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#access_key_idObject

Returns the value of attribute access_key_id

Returns:

  • (Object)

    the current value of access_key_id



24
25
26
# File 'lib/mongo/auth/aws/credentials.rb', line 24

def access_key_id
  @access_key_id
end

#expirationObject

Returns the value of attribute expiration

Returns:

  • (Object)

    the current value of expiration



24
25
26
# File 'lib/mongo/auth/aws/credentials.rb', line 24

def expiration
  @expiration
end

#secret_access_keyObject

Returns the value of attribute secret_access_key

Returns:

  • (Object)

    the current value of secret_access_key



24
25
26
# File 'lib/mongo/auth/aws/credentials.rb', line 24

def secret_access_key
  @secret_access_key
end

#session_tokenObject

Returns the value of attribute session_token

Returns:

  • (Object)

    the current value of session_token



24
25
26
# File 'lib/mongo/auth/aws/credentials.rb', line 24

def session_token
  @session_token
end

Instance Method Details

#expired?true | false

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 Whether the credentials have expired.

Returns:

  • (true | false)

    Whether the credentials have expired.

Since:

  • 2.0.0



26
27
28
29
30
31
32
33
34
# File 'lib/mongo/auth/aws/credentials.rb', line 26

def expired?
  if expiration.nil?
    false
  else
    # According to the spec, Credentials are considered
    # valid if they are more than five minutes away from expiring.
    Time.now.utc >= expiration - 300
  end
end