Sha256: fa28c3b0ff6a48938ee2b377538a160bbca104675e90f09e7aa59dfc1ee4a0ea

Contents?: true

Size: 1.89 KB

Versions: 44

Compression:

Stored size: 1.89 KB

Contents

module Fog
  module AWS
    class STS
      class Real

        require 'fog/aws/parsers/sts/assume_role'
        
        # Assume Role
        #
        # ==== Parameters
        # * role_session_name<~String> - An identifier for the assumed role.
        # * role_arn<~String> - The ARN of the role the caller is assuming.
        # * external_id<~String> - An optional unique identifier required by the assuming role's trust identity.
        # * policy<~String> - An optional JSON policy document
        # * duration<~Integer> - Duration (of seconds) for the assumed role credentials to be valid (default 3600)
        #
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        #     * 'Arn'<~String>: The ARN of the assumed role/user
        #     * 'AccessKeyId'<~String>: The AWS access key of the temporary credentials for the assumed role
        #     * 'SecretAccessKey'<~String>: The AWS secret key of the temporary credentials for the assumed role
        #     * 'SessionToken'<~String>: The AWS session token of the temporary credentials for the assumed role
        #     * 'Expiration'<~Time>: The expiration time of the temporary credentials for the assumed role
        #
        # ==== See Also
        # http://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html
        #

        def assume_role(role_session_name, role_arn, external_id=nil, policy=nil, duration=3600)
          request({
            'Action'          => 'AssumeRole',
            'RoleSessionName' => role_session_name,
            'RoleArn'         => role_arn,
            'Policy'          => policy && Fog::JSON.encode(policy),
            'DurationSeconds' => duration,
            'ExternalId'      => external_id,
            :idempotent       => true,
            :parser           => Fog::Parsers::AWS::STS::AssumeRole.new
          })
        end
        
      end
    end
  end
end

Version data entries

44 entries across 44 versions & 3 rubygems

Version Path
fog-maestrodev-1.20.0.20140305101839 lib/fog/aws/requests/sts/assume_role.rb
fog-maestrodev-1.20.0.20140305101305 lib/fog/aws/requests/sts/assume_role.rb
fog-maestrodev-1.19.0.20140212012611 lib/fog/aws/requests/sts/assume_role.rb
fog-1.20.0 lib/fog/aws/requests/sts/assume_role.rb
fog-maestrodev-1.19.0.20140110004459 lib/fog/aws/requests/sts/assume_role.rb
fog-maestrodev-1.19.0.20140110003812 lib/fog/aws/requests/sts/assume_role.rb
fog-maestrodev-1.19.0.20140109202555 lib/fog/aws/requests/sts/assume_role.rb
fog-maestrodev-1.19.0.20140107192102 lib/fog/aws/requests/sts/assume_role.rb
fog-maestrodev-1.19.0.20140107142106 lib/fog/aws/requests/sts/assume_role.rb
fog-maestrodev-1.19.0.20131219203941 lib/fog/aws/requests/sts/assume_role.rb
fog-maestrodev-1.18.0.20131219193542 lib/fog/aws/requests/sts/assume_role.rb
fog-1.19.0 lib/fog/aws/requests/sts/assume_role.rb
fog-maestrodev-1.18.0.20131219033443 lib/fog/aws/requests/sts/assume_role.rb
fog-maestrodev-1.18.0.20131219032002 lib/fog/aws/requests/sts/assume_role.rb
fog-maestrodev-1.18.0.20131219030716 lib/fog/aws/requests/sts/assume_role.rb
fog-maestrodev-1.18.0.20131219022322 lib/fog/aws/requests/sts/assume_role.rb
fog-maestrodev-1.18.0.20131218202447 lib/fog/aws/requests/sts/assume_role.rb
fog-maestrodev-1.18.0.20131209091424 lib/fog/aws/requests/sts/assume_role.rb
fog-maestrodev-1.18.0.20131209090811 lib/fog/aws/requests/sts/assume_role.rb
fog-maestrodev-1.18.0.20131206115947 lib/fog/aws/requests/sts/assume_role.rb