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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 56ebc583666ccaab5ff91eebcebdcfd2e045c01a
4
- data.tar.gz: a57bbb4d8d6a022c3e2f1417354be0a34e8387ff
3
+ metadata.gz: 9d03b335d61247a0f3ad4f6db0a89af892878757
4
+ data.tar.gz: dbb0fb42b9ef5d2c7abf4a2da18b4923a2d650f0
5
5
  SHA512:
6
- metadata.gz: 73a7ba5dec6b10e196e2057d4cd6f8394db4595447897327598966e3fd08ee9341008217a669d7ff225e606dd37759b6287cba5e7b30f441f30d55b38002e429
7
- data.tar.gz: 1b7551916a0da7c64ec9d38fb2329d7da873419ce352b66cc4ec37ba912e8b6db63ded5457d178d9b96d5dca0b035349d5c350b2a63e95810ae742e599fde901
6
+ metadata.gz: 7fb649e8d0d3d580275a79310d161967a1662130313516c0d406b4b5ee20233914589d09a0c5a7dd4d3611407e38ebc3b5dff2e8b50d8521390f57c235b578e7
7
+ data.tar.gz: c8ed30e20e72306a022fac3ff8298ac92963552e943b389bab32019830dbf3923fdfe09b2821bc46ebe84c940732ee754ecf56e635a4080138f32f5698ae1eb2
@@ -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
- raise(SignatureFailed, "signpost-sign failed: #{err.strip}")
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
@@ -1,5 +1,5 @@
1
1
  module Signpost
2
2
  module Signer
3
- VERSION = "0.1.3"
3
+ VERSION = "0.1.4"
4
4
  end
5
5
  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.3
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-20 00:00:00.000000000 Z
11
+ date: 2016-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler