class Fog::AWS::Federation::Real

Public Class Methods

new(options={}) click to toggle source
# File lib/fog/aws/federation.rb, line 36
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

Public Instance Methods

get_signin_token(session) click to toggle source
# File lib/fog/aws/requests/federation/get_signin_token.rb, line 5
def get_signin_token(session)

  request('getSigninToken', CGI.escape(Fog::JSON.encode(session)))
end
request(action, session) click to toggle source
# File lib/fog/aws/federation.rb, line 46
def request(action, session)
  response = @connection.get(
    :query   => "Action=#{action}&SessionType=json&Session=#{session}",
    :expects => 200
  ).body
  Fog::JSON.decode(response)
end