Class: Wurk::Encryption::ServerMiddleware

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

Overview

Server middleware — peels the envelope before perform runs. A decrypt failure (missing/rotated key, bad tag) is terminal and non-retryable, so rather than let it bubble into the 25× retry pipeline we route the job straight to the dead set tagged ‘encryption_error` and ACK it via JobRetry::Skip — see Wurk::Encryption.route_to_dead. Plaintext args remain visible for triage per §4.6.

Instance Attribute Summary

Attributes included from Middleware::ServerMiddleware

#config

Instance Method Summary collapse

Methods included from Middleware::ServerMiddleware

#logger, #redis, #redis_pool

Instance Method Details

#call(_worker, job, _queue) ⇒ Object



246
247
248
249
250
251
# File 'lib/wurk/encryption.rb', line 246

def call(_worker, job, _queue)
  return yield unless Wurk::Encryption.enabled? && job['encrypt']

  decrypt_last_arg!(job)
  yield
end