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.101.0 lib/aws-sdk-core/credentials.rb