ironclad 0.2.0 → 0.3.0
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 +4 -4
- data/lib/ironclad/cache/keyctl.rb +6 -0
- data/lib/ironclad/cache.rb +6 -5
- data/lib/ironclad/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1e2b08a6c0985159ff7be4790655703218e7eef6428416a68eba9fe8d039d16b
|
|
4
|
+
data.tar.gz: 0d14ea6406e375cad4f6045ab1e1bf0bcfa6a85deb9a3c995b745d786ef5f823
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2c5bee8e2a72bb805d56c58884d951008a02408e3d99ddfeef8ec4723af1a619b130c5a36f0e668de0f5ddad720116cb50ed3319f8994970e7f65fb01de501a5
|
|
7
|
+
data.tar.gz: 3bc45b204cb6f95ebe763000b13d388c5c737602b273f16380bf2e6dc1f1d4260f896e73b5e855465245ca2bd39e9c9dfc221471109d06bd8b5d2de94af3a0ba
|
|
@@ -8,6 +8,12 @@ module Ironclad
|
|
|
8
8
|
# persists across this user's sessions and clears on reboot, at which point
|
|
9
9
|
# a miss simply re-seeds from the source.
|
|
10
10
|
class Keyctl
|
|
11
|
+
def self.available?
|
|
12
|
+
ENV['PATH'].to_s.split(File::PATH_SEPARATOR).any? do |dir|
|
|
13
|
+
File.executable?(File.join(dir, 'keyctl'))
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
11
17
|
def read(name)
|
|
12
18
|
id, status = Open3.capture2('keyctl', 'search', '@u', 'user', name)
|
|
13
19
|
return unless status.success?
|
data/lib/ironclad/cache.rb
CHANGED
|
@@ -15,14 +15,15 @@ module Ironclad
|
|
|
15
15
|
when /darwin/
|
|
16
16
|
Keychain.new(account)
|
|
17
17
|
when /linux/
|
|
18
|
-
|
|
18
|
+
return Keyctl.new if Keyctl.available?
|
|
19
|
+
|
|
20
|
+
warn 'ironclad: keyctl not found, so key caching is disabled and keys ' \
|
|
21
|
+
'are fetched from the source every time. Install keyutils to ' \
|
|
22
|
+
'enable the kernel keyring cache.'
|
|
23
|
+
Null.new
|
|
19
24
|
else
|
|
20
25
|
Null.new
|
|
21
26
|
end
|
|
22
27
|
end
|
|
23
|
-
|
|
24
|
-
def keyctl_available?
|
|
25
|
-
system('command -v keyctl', out: File::NULL, err: File::NULL)
|
|
26
|
-
end
|
|
27
28
|
end
|
|
28
29
|
end
|
data/lib/ironclad/version.rb
CHANGED