foreman-tasks-core 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3d379bbd4b42c3f19df598700caa7d9422a02d08
4
- data.tar.gz: 10f0ab00bfcd18dbc8ea70c8611de636fb294115
3
+ metadata.gz: e4b67548426398091cbb39ff9623d99d06428dc9
4
+ data.tar.gz: b38377bc6d0141e75b5a62e313705dcc457a2388
5
5
  SHA512:
6
- metadata.gz: 6892cf7b68616b44ce3fc6c888acd03b8f4e4c28da276ec31a4cf5204469219b64a68637e6b411c09575304bb220ec8b80a7d21221761da971877d698f35dd1f
7
- data.tar.gz: 030c20e3aefbdfb774da37e4a6207fcf509fde61e49d48507a5f746f2938174b56dade4d65ed4ac5f1bbd94b8d704519c3cbce3f35c8c6506a43bd47997db1e9
6
+ metadata.gz: c3f4ab872e17f93690727d675037bf5b4517bd040e29bb81f1aebe0d4faccf88172851fee61556e7963e4207d0b6cb1cb21e5aab416791955dec4c93f91fdf93
7
+ data.tar.gz: d35c6d473f2f6bde0395f91494557b4cdc60241d126bc8587a8221ddad5f731cb0a1bb489d0eeead39ae4f96628c3859a7ab23a77dea661ddf3d0cd3a2bdaded
@@ -6,12 +6,15 @@ module ForemanTasksCore
6
6
  class << self
7
7
  def generate_otp(username)
8
8
  otp = SecureRandom.hex
9
- @passwords ||= {}
10
- @passwords[username] = otp.to_s
9
+ passwords[username] = otp.to_s
11
10
  end
12
11
 
13
12
  def drop_otp(username, password)
14
- @passwords.delete(username) if @passwords[username] == password
13
+ passwords.delete(username) if passwords[username] == password
14
+ end
15
+
16
+ def passwords
17
+ @password ||= {}
15
18
  end
16
19
 
17
20
  def authenticate(hash)
@@ -1,3 +1,3 @@
1
1
  module ForemanTasksCore
2
- VERSION = '0.2.1'.freeze
2
+ VERSION = '0.2.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,18 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman-tasks-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Nečas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-27 00:00:00.000000000 Z
11
+ date: 2017-09-12 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: 'Common code used both at Forman and Foreman proxy regarding tasks
14
-
15
- '
13
+ description: |
14
+ Common code used both at Forman and Foreman proxy regarding tasks
16
15
  email:
17
16
  - inecas@redhat.com
18
17
  executables: []
@@ -52,7 +51,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
52
51
  version: '0'
53
52
  requirements: []
54
53
  rubyforge_project:
55
- rubygems_version: 2.6.11
54
+ rubygems_version: 2.6.12
56
55
  signing_key:
57
56
  specification_version: 4
58
57
  summary: Common code used both at Forman and Foreman proxy regarding tasks