Class: Fog::AWS::Federation::Real
Instance Method Summary
collapse
#refresh_credentials_if_expired
Constructor Details
#initialize(options = {}) ⇒ Real
36
37
38
39
40
41
42
43
44
|
# 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
|
Instance Method Details
#get_signin_token(session) ⇒ Object
5
6
7
8
|
# 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) ⇒ Object
46
47
48
49
50
51
52
|
# 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
|