Sha256: 5adb05a3dd596b36a253713789b8cee5f9c0947cc4449b91c27dac5703d64376

Contents?: true

Size: 618 Bytes

Versions: 10

Compression:

Stored size: 618 Bytes

Contents

# frozen_string_literal: true

module Aws
  module S3
    # @api private
    class ExpressCredentialsCache
      def initialize
        @credentials = {}
        @mutex = Mutex.new
      end

      def [](bucket_name)
        @mutex.synchronize { @credentials[bucket_name] }
      end

      def []=(bucket_name, credential_provider)
        @mutex.synchronize do
          @credentials[bucket_name] = credential_provider
        end
      end

      def clear
        @mutex.synchronize { @credentials = {} }
      end
    end

    # @api private
    EXPRESS_CREDENTIALS_CACHE = ExpressCredentialsCache.new
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
aws-sdk-s3-1.148.0 lib/aws-sdk-s3/express_credentials_cache.rb
aws-sdk-s3-1.147.0 lib/aws-sdk-s3/express_credentials_cache.rb
aws-sdk-s3-1.146.1 lib/aws-sdk-s3/express_credentials_cache.rb
aws-sdk-s3-1.146.0 lib/aws-sdk-s3/express_credentials_cache.rb
aws-sdk-s3-1.145.0 lib/aws-sdk-s3/express_credentials_cache.rb
aws-sdk-s3-1.144.0 lib/aws-sdk-s3/express_credentials_cache.rb
aws-sdk-s3-1.143.1 lib/aws-sdk-s3/express_credentials_cache.rb
aws-sdk-s3-1.143.0 lib/aws-sdk-s3/express_credentials_cache.rb
aws-sdk-s3-1.142.0 lib/aws-sdk-s3/express_credentials_cache.rb
aws-sdk-s3-1.141.0 lib/aws-sdk-s3/express_credentials_cache.rb