Class: Fog::AWS::Federation::Real
- Inherits:
-
Object
- Object
- Fog::AWS::Federation::Real
- Includes:
- CredentialFetcher::ConnectionMethods
- Defined in:
- lib/fog/aws/federation.rb,
lib/fog/aws/requests/federation/get_signin_token.rb
Instance Method Summary collapse
- #get_signin_token(session) ⇒ Object
-
#initialize(options = {}) ⇒ Real
constructor
A new instance of Real.
- #request(action, session) ⇒ Object
Methods included from CredentialFetcher::ConnectionMethods
#refresh_credentials_if_expired
Constructor Details
#initialize(options = {}) ⇒ Real
Returns a new instance of Real.
36 37 38 39 40 41 42 43 44 |
# File 'lib/fog/aws/federation.rb', line 36 def initialize(={}) @instrumentor = [:instrumentor] @instrumentor_name = [:instrumentor_name] || 'fog.aws.federation' @connection_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 |