service_skeleton 0.0.0.41.g9507cda → 0.0.0.43.g678698a

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e4ef4c44c6af279c8870e58b4bf078424a30c87b6d979d2513fe093c15926287
4
- data.tar.gz: 5a9d7d4fc51bae03eac369f6f902dabcfea925d3fd175b69e7888d4368fe87f0
3
+ metadata.gz: b149de67b978a61b485db23c5c35adb077212835af64a44c6ea1a883501bfa40
4
+ data.tar.gz: 77bd9a46e93fb02b46bbe7c84b2664226fc06ca99a5266a228359ba83d7ea79e
5
5
  SHA512:
6
- metadata.gz: 353f92e555ba95c3e5776a0acb10119500671182a0efc082ff0d9e91a247f14209ff23dbc0f64cec73df445daba2435acac7104f18bef0e6cccd01a48e6b4954
7
- data.tar.gz: c0c3341e8ab56f4cfed5809a94b6a9b8295e30b59a04977e1b45a24c1d64b3a5ad8f14927e0453145a4bcf93d94579b08d1e432bee49d0e8ac5352f88da6f3f9
6
+ metadata.gz: 1135ca4d0b40e80230fb11af004ccc0bd985ec7a032d9371f0bd7e356466c1ed720f696d202fb976a85b1353fecf7cb721fb704be65c7fd6f06cdd40cca7f62c
7
+ data.tar.gz: 3ae9fdb382bf5861743ff895ff4965401d98b9318234d4cdc5ed82410d315e5edd9d6cd2b53f22985b781646753192906735e71d13b81f3e10e18125f06907aa
data/README.md CHANGED
@@ -533,7 +533,7 @@ signals will be hooked with the following behaviour:
533
533
  * **`SIGHUP`** -- close and reopen the log file, if logging to a file on disk.
534
534
  Because of the `ServiceSkeleton`'s default log rotation policy, this shouldn't
535
535
  ordinarily be required, but if you've turned off the default log rotation,
536
- you may need tis.
536
+ you may need this.
537
537
 
538
538
  * **`SIGQUIT`** -- dump a *whooooooole* lot of debugging information to
539
539
  standard error, including memory allocation summaries and stack traces of all
@@ -45,9 +45,13 @@ class ServiceSkeleton
45
45
  val = new_value
46
46
  end
47
47
  end.each do |var|
48
- if var.redact!(env) && env.object_id != ENV.object_id
49
- raise ServiceSkeleton::Error::CannotSanitizeEnvironmentError,
50
- "Attempted to sanitize sensitive variable #{var.name}, but we're not operating on the process' environment"
48
+ if var.redact?(env)
49
+ if env.object_id != ENV.object_id
50
+ raise ServiceSkeleton::Error::CannotSanitizeEnvironmentError,
51
+ "Attempted to sanitize sensitive variable #{var.name}, but we're not operating on the process' environment"
52
+ else
53
+ var.redact!(env)
54
+ end
51
55
  end
52
56
  end
53
57
  end
@@ -16,6 +16,10 @@ class ServiceSkeleton
16
16
  @name.to_s.gsub(/\A#{Regexp.quote(svc_name)}_/i, '').downcase
17
17
  end
18
18
 
19
+ def redact?(env)
20
+ @opts[:sensitive]
21
+ end
22
+
19
23
  def redact!(env)
20
24
  if @opts[:sensitive]
21
25
  env[@name.to_s] = "*SENSITIVE*" if env.has_key?(@name.to_s)
@@ -3,6 +3,10 @@
3
3
  require "service_skeleton/config_variable"
4
4
 
5
5
  class ServiceSkeleton::ConfigVariable::URL < ServiceSkeleton::ConfigVariable
6
+ def redact?(env)
7
+ !!(env.has_key?(@name.to_s) && (@opts[:sensitive] || URI(env[@name.to_s] || "").password))
8
+ end
9
+
6
10
  def redact!(env)
7
11
  if env.has_key?(@name.to_s)
8
12
  super
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: service_skeleton
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0.41.g9507cda
4
+ version: 0.0.0.43.g678698a
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Palmer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-23 00:00:00.000000000 Z
11
+ date: 2019-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: frankenstein
@@ -307,8 +307,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
307
307
  - !ruby/object:Gem::Version
308
308
  version: 1.3.1
309
309
  requirements: []
310
- rubyforge_project:
311
- rubygems_version: 2.7.6
310
+ rubygems_version: 3.0.1
312
311
  signing_key:
313
312
  specification_version: 4
314
313
  summary: The bare bones of a service