Sha256: 06e10606f6a61c360d0ba958fc27a254d008693cecdedaf6e2ee3511bf1c17b0

Contents?: true

Size: 1.36 KB

Versions: 76

Compression:

Stored size: 1.36 KB

Contents

module Fog
  module AWS
    class Federation < Fog::Service
      extend Fog::AWS::CredentialFetcher::ServiceMethods

      recognizes :instrumentor, :instrumentor_name

      request_path 'fog/aws/requests/federation'

      request 'get_signin_token'

      class Mock
        def self.data
          @data ||= {}
        end

        def self.reset
          @data = nil
        end

        def initialize(options={})
        end

        def data
          self.class.data
        end

        def reset_data
          self.class.reset
        end
      end

      class Real
        include Fog::AWS::CredentialFetcher::ConnectionMethods

        def initialize(options={})
          @instrumentor       = options[:instrumentor]
          @instrumentor_name  = options[:instrumentor_name]  || 'fog.aws.federation'
          @connection_options = options[:connection_options] || {}
          @host               = 'signin.aws.amazon.com'
          @path               = '/federation'
          @scheme             = 'https'
          @connection         = Excon.new("#{@scheme}://#{@host}#{@path}")
        end

        def request(action, session)
          response = @connection.get(
            :query   => "Action=#{action}&SessionType=json&Session=#{session}",
            :expects => 200
          ).body
          Fog::JSON.decode(response)
        end
      end
    end
  end
end

Version data entries

76 entries across 74 versions & 3 rubygems

Version Path
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-aws-2.0.1/lib/fog/aws/federation.rb
fog-aws-3.0.0 lib/fog/aws/federation.rb
fog-aws-2.0.1 lib/fog/aws/federation.rb
fog-aws-2.0.0 lib/fog/aws/federation.rb
fog-aws-1.4.1 lib/fog/aws/federation.rb
fog-aws-1.4.0 lib/fog/aws/federation.rb
fog-aws-1.3.0 lib/fog/aws/federation.rb
fog-aws-1.2.1 lib/fog/aws/federation.rb
fog-aws-1.2.0 lib/fog/aws/federation.rb
fog-aws-1.1.0 lib/fog/aws/federation.rb
fog-aws-1.0.0 lib/fog/aws/federation.rb
fog-aws-0.13.0 lib/fog/aws/federation.rb
fog-aws-0.12.0 lib/fog/aws/federation.rb
fog-aws-0.11.0 lib/fog/aws/federation.rb
fog-aws-0.10.0 lib/fog/aws/federation.rb
fog-aws-0.9.4 lib/fog/aws/federation.rb
fog-aws-0.9.3 lib/fog/aws/federation.rb
fog-aws-0.9.2 lib/fog/aws/federation.rb
fog-aws-0.9.1 lib/fog/aws/federation.rb
fog-aws-0.9.0 lib/fog/aws/federation.rb