signpost-signer 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/signpost/signer.rb +8 -1
- data/lib/signpost/signer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d03b335d61247a0f3ad4f6db0a89af892878757
|
4
|
+
data.tar.gz: dbb0fb42b9ef5d2c7abf4a2da18b4923a2d650f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7fb649e8d0d3d580275a79310d161967a1662130313516c0d406b4b5ee20233914589d09a0c5a7dd4d3611407e38ebc3b5dff2e8b50d8521390f57c235b578e7
|
7
|
+
data.tar.gz: c8ed30e20e72306a022fac3ff8298ac92963552e943b389bab32019830dbf3923fdfe09b2821bc46ebe84c940732ee754ecf56e635a4080138f32f5698ae1eb2
|
data/lib/signpost/signer.rb
CHANGED
@@ -15,7 +15,10 @@ module Signpost # :nodoc:
|
|
15
15
|
BIN_SIGNER = File.expand_path('bin/signpost-sign-linux', ROOT)
|
16
16
|
end
|
17
17
|
|
18
|
+
SSH_ADD_FAILED = 2
|
19
|
+
|
18
20
|
SignatureFailed = Class.new(Signpost::SignpostError)
|
21
|
+
SSHAddFailed = Class.new(Signpost::SignpostError)
|
19
22
|
|
20
23
|
def self.sign_request(request)
|
21
24
|
request['Date'] = Time.now.httpdate unless request['Date']
|
@@ -36,7 +39,11 @@ module Signpost # :nodoc:
|
|
36
39
|
def self.sign(message)
|
37
40
|
out, err, stat = Open3.capture3(BIN_SIGNER, stdin_data: message)
|
38
41
|
return out.strip if stat.success?
|
39
|
-
|
42
|
+
if stat.exitstatus == SSH_ADD_FAILED
|
43
|
+
raise(SSHAddFailed, err.strip)
|
44
|
+
else
|
45
|
+
raise(SignatureFailed, "signpost-sign failed: #{err.strip}")
|
46
|
+
end
|
40
47
|
end
|
41
48
|
end
|
42
49
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: signpost-signer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Burke Libbey
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|