module Shrine::Plugins::Lambda::AttacherClassMethods
Public Instance Methods
lambda_process(data)
click to toggle source
Loads the attacher from the data, and triggers its instance AWS Lambda
processing method. Intended to be used in a background job.
# File lib/shrine/plugins/shrine-lambda.rb, line 58 def lambda_process(data) attacher = load(data) attacher.lambda_process(data) attacher end
Private Instance Methods
auth_header_hash(header)
click to toggle source
@param [String] header is the `Authorization` header string @return [Hash] the `Authorization` header string transformed into a Hash
# File lib/shrine/plugins/shrine-lambda.rb, line 118 def auth_header_hash(header) auth_header = header.split(/ |, |=/) auth_header.shift Hash[*auth_header] end
build_signer(headers, secret_access_key, security_token = nil)
click to toggle source
# File lib/shrine/plugins/shrine-lambda.rb, line 104 def build_signer(headers, secret_access_key, security_token = nil) Aws::Sigv4::Signer.new( service: headers[3], region: headers[2], access_key_id: headers[0], secret_access_key: secret_access_key, session_token: security_token, apply_checksum_header: false, unsigned_headers: %w[content-length user-agent x-amzn-trace-id] ) end