Class: Aws::Crt::Auth::SigningConfig
- Inherits:
-
Object
- Object
- Aws::Crt::Auth::SigningConfig
- Includes:
- ManagedNative
- Defined in:
- lib/aws-crt/auth/signing_config.rb
Overview
Signing Config
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ SigningConfig
constructor
A new instance of SigningConfig.
Methods included from ManagedNative
included, #manage_native, #native, #native_set?, #release
Constructor Details
#initialize(options = {}) ⇒ SigningConfig
Returns a new instance of SigningConfig.
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/aws-crt/auth/signing_config.rb', line 48 def initialize( = {}) # validation of parameters is handled in signing_config_new # create a callback function for aws_should_sign_header_fn @sign_header_fn = extract_unsigned_header_fn( [:unsigned_headers] ) signed_body_header_type = .fetch( :signed_body_header_type, :sbht_content_sha256 ) # ensure we retain a reference to the credentials to avoid GC @credentials = [:credentials] manage_native do Aws::Crt::Native.signing_config_aws_new end Aws::Crt::Native.signing_config_aws_set_algorithm(native, [:algorithm]) Aws::Crt::Native.signing_config_aws_set_signature_type(native, [:signature_type]) Aws::Crt::Native.signing_config_aws_set_region(native, [:region], [:region].length) Aws::Crt::Native.signing_config_aws_set_service(native, [:service], [:service].length) Aws::Crt::Native.signing_config_aws_set_date(native, extract_date()) Aws::Crt::Native.signing_config_aws_set_credentials_provider(native, @credentials&.native) Aws::Crt::Native.signing_config_aws_set_signed_body_header_type(native, signed_body_header_type) if @sign_header_fn Aws::Crt::Native.signing_config_aws_set_should_sign_header_fn(native, @sign_header_fn) end assign_body_value() assign_flags() validate_config! end |