sidekiq-encrypted_args 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGE_LOG.md +8 -1
- data/MIT_LICENSE.txt +1 -1
- data/VERSION +1 -1
- data/lib/sidekiq/encrypted_args/client_middleware.rb +15 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec62339d07cad8c5b54a916e1744619975e8e1386aafb2b61d32e2b2dbfa5aad
|
4
|
+
data.tar.gz: 66eeea7cc622fe664296e65e684180b5dead9f29c134c34bbf2cfe5eb520a335
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e5189778528498dfb701638d82bea3604cf77be45e4ec696462c8436f38a9ba09d52ab6765c40880cf5cf8db1d1c26b8eacb0fb0f3a33b6c565e6405b7baa8b
|
7
|
+
data.tar.gz: '0898913e5498b80f0e1911f512211bcbcad5217adaf5b10f2dd3d2e22750201f482278963c99a17a008e68884cc35f935ee9c469c86902dc42926afaa759c7d6'
|
data/CHANGE_LOG.md
CHANGED
data/MIT_LICENSE.txt
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License (MIT)
|
2
2
|
|
3
|
-
Copyright (c) 2020 Brian Durand
|
3
|
+
Copyright (c) 2020 Brian Durand, Winston Durand
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.1
|
@@ -5,7 +5,9 @@ module Sidekiq
|
|
5
5
|
# Sidekiq client middleware for encrypting arguments on jobs for workers
|
6
6
|
# with `encrypted_args` set in the `sidekiq_options`.
|
7
7
|
class ClientMiddleware
|
8
|
+
# @param [String, Class] worker_class class name or class of worker
|
8
9
|
def call(worker_class, job, queue, redis_pool = nil)
|
10
|
+
worker_class = constantize(worker_class) if worker_class.is_a?(String)
|
9
11
|
encrypted_args = EncryptedArgs.send(:encrypted_args_option, worker_class)
|
10
12
|
if encrypted_args
|
11
13
|
new_args = []
|
@@ -18,6 +20,19 @@ module Sidekiq
|
|
18
20
|
|
19
21
|
yield
|
20
22
|
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
# @param [String] class_name name of a class
|
27
|
+
# @return [Class] class that was referenced by name
|
28
|
+
def constantize(class_name)
|
29
|
+
names = class_name.split("::")
|
30
|
+
# Clear leading :: for root namespace since we're already calling from object
|
31
|
+
names.shift if names.empty? || names.first.empty?
|
32
|
+
# Map reduce to the constant. Use inherit=false to not accidentally search
|
33
|
+
# parent modules
|
34
|
+
names.inject(Object) { |constant, name| constant.const_get(name, false) }
|
35
|
+
end
|
21
36
|
end
|
22
37
|
end
|
23
38
|
end
|
metadata
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq-encrypted_args
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Durand
|
8
8
|
- Winston Durand
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
date: 2020-06-02 00:00:00.000000000 Z
|
@@ -53,7 +53,7 @@ dependencies:
|
|
53
53
|
- - "~>"
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '2.0'
|
56
|
-
description:
|
56
|
+
description:
|
57
57
|
email:
|
58
58
|
- bbdurand@gmail.com
|
59
59
|
- me@winstondurand.com
|
@@ -76,7 +76,7 @@ homepage: https://github.com/bdurand/sidekiq-encrypted_args
|
|
76
76
|
licenses:
|
77
77
|
- MIT
|
78
78
|
metadata: {}
|
79
|
-
post_install_message:
|
79
|
+
post_install_message:
|
80
80
|
rdoc_options: []
|
81
81
|
require_paths:
|
82
82
|
- lib
|
@@ -91,8 +91,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
91
91
|
- !ruby/object:Gem::Version
|
92
92
|
version: '0'
|
93
93
|
requirements: []
|
94
|
-
rubygems_version: 3.
|
95
|
-
signing_key:
|
94
|
+
rubygems_version: 3.1.2
|
95
|
+
signing_key:
|
96
96
|
specification_version: 4
|
97
97
|
summary: Support for encrypting arguments that contain sensitive information in sidekiq
|
98
98
|
jobs.
|