Class: Wurk::Encryption::ClientMiddleware

Inherits:
Object
  • Object
show all
Includes:
Middleware::ClientMiddleware
Defined in:
lib/wurk/encryption.rb

Overview

Client middleware — envelopes the last positional argument when the job opts in via sidekiq_options encrypt: true. Skips silently when crypto is disabled, the job didn't opt in, or args is empty (per §4.3, an opt-in worker with empty args is a user bug, but we don't enqueue garbage — let perform raise ArgumentError if it cares).

Instance Method Summary collapse

Instance Method Details

#call(_worker, job, _queue, _redis_pool) ⇒ Object



319
320
321
322
# File 'lib/wurk/encryption.rb', line 319

def call(_worker, job, _queue, _redis_pool)
  job['args'] = Wurk::Encryption.seal_args(job['args']) if Wurk::Encryption.enabled? && job['encrypt']
  yield
end