lib/oci/base_signer.rb
def compute_signature(headers, method, path, operation_signing_strategy)
      header_mapping = fetch_header_mapping(method, operation_signing_strategy)
      return if header_mapping.empty?

      signing_string = header_mapping.map do |header|
        if header == :'(request-target)'
          "#{header}: #{method.downcase} #{path}"
        else
          "#{header}: #{headers[header]}"
        end
      end.join("\n")

      signature = private_key.sign(OpenSSL::Digest::SHA256.new, signing_string.encode('ascii'))
      Base64.strict_encode64(signature)
    end
# enum to define the signing strategy
enum to define the signing strategy
enum to define the signing strategy
def compute_signature(headers, method, path, operation_signing_strategy)
      header_mapping = fetch_header_mapping(method, operation_signing_strategy)
      return if header_mapping.empty?
      signing_string = header_mapping.map do |header|
        if header == :'(request-target)'
          "#{header}: #{method.downcase} #{path}"
        else
          "#{header}: #{headers[header]}"
        end
      end.join("\n")
      signature = private_key.sign(OpenSSL::Digest::SHA256.new, signing_string.encode('ascii'))
      Base64.strict_encode64(signature)
    end
def compute_signature ( headers , method , path , operation_signing_strategy ) header_mapping = fetch_header_mapping ( method , operation_signing_strategy ) return if header_mapping . empty? signing_string = header_mapping . map do | header | if header == :' (request-target) ' "#{header}: #{method.downcase} #{path}" else "#{header}: #{headers[header]}" end end . join ( "\n" ) signature = private_key . sign ( OpenSSL :: Digest :: SHA256 . new , signing_string . encode ( 'ascii' ) ) Base64 . strict_encode64 ( signature ) end
enum to define the signing strategy
enum to define the signing strategy
headers
method
path
operation_signing_strategy