Sha256: 5165265999a7c13949faecf9e3ab27720822c05fc40a95801fb252c00693221c

Contents?: true

Size: 1.05 KB

Versions: 181

Compression:

Stored size: 1.05 KB

Contents

# frozen_string_literal: true

module Aws
  class Credentials

    # @param [String] access_key_id
    # @param [String] secret_access_key
    # @param [String] session_token (nil)
    def initialize(access_key_id, secret_access_key, session_token = nil)
      @access_key_id = access_key_id
      @secret_access_key = secret_access_key
      @session_token = session_token
    end

    # @return [String, nil]
    attr_reader :access_key_id

    # @return [String, nil]
    attr_reader :secret_access_key

    # @return [String, nil]
    attr_reader :session_token

    # @return [Credentials]
    def credentials
      self
    end

    # @return [Boolean] Returns `true` if the access key id and secret
    #   access key are both set.
    def set?
      !access_key_id.nil? &&
      !access_key_id.empty? &&
      !secret_access_key.nil? &&
      !secret_access_key.empty?
    end

    # Removing the secret access key from the default inspect string.
    # @api private
    def inspect
      "#<#{self.class.name} access_key_id=#{access_key_id.inspect}>"
    end

  end
end

Version data entries

181 entries across 181 versions & 1 rubygems

Version Path
aws-sdk-core-3.206.0 lib/aws-sdk-core/credentials.rb
aws-sdk-core-3.205.0 lib/aws-sdk-core/credentials.rb
aws-sdk-core-3.204.0 lib/aws-sdk-core/credentials.rb
aws-sdk-core-3.203.0 lib/aws-sdk-core/credentials.rb
aws-sdk-core-3.202.2 lib/aws-sdk-core/credentials.rb
aws-sdk-core-3.202.1 lib/aws-sdk-core/credentials.rb
aws-sdk-core-3.202.0 lib/aws-sdk-core/credentials.rb
aws-sdk-core-3.201.5 lib/aws-sdk-core/credentials.rb
aws-sdk-core-3.201.4 lib/aws-sdk-core/credentials.rb
aws-sdk-core-3.201.3 lib/aws-sdk-core/credentials.rb
aws-sdk-core-3.201.2 lib/aws-sdk-core/credentials.rb
aws-sdk-core-3.201.1 lib/aws-sdk-core/credentials.rb
aws-sdk-core-3.201.0 lib/aws-sdk-core/credentials.rb
aws-sdk-core-3.200.0 lib/aws-sdk-core/credentials.rb
aws-sdk-core-3.199.0 lib/aws-sdk-core/credentials.rb
aws-sdk-core-3.198.0 lib/aws-sdk-core/credentials.rb
aws-sdk-core-3.197.2 lib/aws-sdk-core/credentials.rb
aws-sdk-core-3.197.1 lib/aws-sdk-core/credentials.rb
aws-sdk-core-3.197.0 lib/aws-sdk-core/credentials.rb
aws-sdk-core-3.194.1 lib/aws-sdk-core/credentials.rb