Module: HTTPX::Plugins::AwsSdkAuthentication::InstanceMethods

Defined in:
lib/httpx/plugins/aws_sdk_authentication.rb,
sig/plugins/aws_sdk_authentication.rbs

Instance Method Summary collapse

Instance Method Details

#aws_sdk_authentication(credentials: AwsSdkAuthentication.credentials(@options.aws_profile), region: AwsSdkAuthentication.region(@options.aws_profile), **options) ⇒ instance Also known as: aws_auth

returns a session which will use the AWS credentials provided by your AWS system configuration.

session = HTTPX.plugin(:aws_sdk_authentication)
auth_session = session.aws_authentication
# OR
auth_session = session.aws_authentication(credentials: Aws::Credentials.new('akid', 'secret'))
auth_session.get("http://...")

Parameters:

  • credentials: (Credentials) (defaults to: AwsSdkAuthentication.credentials(@options.aws_profile))
  • region: (String) (defaults to: AwsSdkAuthentication.region(@options.aws_profile))
  • (Object)

Returns:

  • (instance)


96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/httpx/plugins/aws_sdk_authentication.rb', line 96

def aws_sdk_authentication(
  credentials: AwsSdkAuthentication.credentials(@options.aws_profile),
  region: AwsSdkAuthentication.region(@options.aws_profile),
  **options
)
  aws_sigv4_authentication(
    credentials: credentials,
    region: region,
    provider_prefix: "aws",
    header_provider_field: "amz",
    **options
  )
end