bullion 0.10.0 → 0.10.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
  SHA256:
3
- metadata.gz: 74fbfc1ee8b98c2ff1c707302c8e62c9b2f8d106308b8b3b02d6a1ffe622cb77
4
- data.tar.gz: adbd79fc4e82a9630dee2dd71c1e33c7e0a8f02732c986af07b1ba3d1733fd5c
3
+ metadata.gz: 9b418034aabf17318c2f100d13bedd6e24338241d175a8a745aa59adc63b88c3
4
+ data.tar.gz: 55de2bbebec20c8a485baa9d7f3e1b4f50fdc0b3d79e1124ed1dbb67c25ef759
5
5
  SHA512:
6
- metadata.gz: f1cfc723554109cdb6e837e2dabd66eed6dd52d3cd7ca649923f88940c31e83e957e749ec1449c6eef4ffbcc89aafbbf822a3725b55688a3dc5d4290bd63552b
7
- data.tar.gz: ccbe2a235fa91b4568b6977f55b22122de5f0fc1e0c2620c4ef9e16dfc4ce618ccff0322ea1e5c9dc3711f2dc10b22a9dc0bcd5c45d406adb08640229ec78048
6
+ metadata.gz: 955267201ea388e0676962863224b79883a239830347a5d372415b45b71b52a334116ec58aac187dec20c7f5992ad7bc3422809da85a5dbbdbce53c062081ab3
7
+ data.tar.gz: 781b2d68d4808a3ff1ae72c5d252c75a3220aa1d23be6d456a9b15bc5c87f970f8b6cd0397888d19167d35b22b1830bfcd1f583827302b33b2cdd324810c22ae
@@ -31,3 +31,26 @@ jobs:
31
31
 
32
32
  - uses: rubygems/release-gem@v1
33
33
  if: ${{ steps.release.outputs.release_created }}
34
+
35
+ - name: Login to Docker Hub
36
+ uses: docker/login-action@v3
37
+ if: ${{ steps.release.outputs.release_created }}
38
+ with:
39
+ username: ${{ vars.DOCKERHUB_USERNAME }}
40
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
41
+
42
+ - name: Set up QEMU
43
+ uses: docker/setup-qemu-action@v3
44
+ if: ${{ steps.release.outputs.release_created }}
45
+
46
+ - name: Set up Docker Buildx
47
+ uses: docker/setup-buildx-action@v3
48
+ if: ${{ steps.release.outputs.release_created }}
49
+
50
+ - name: Build and push
51
+ uses: docker/build-push-action@v6
52
+ if: ${{ steps.release.outputs.release_created }}
53
+ with:
54
+ platforms: linux/amd64,linux/arm64
55
+ push: true
56
+ tags: jgnagy/bullion:latest,jgnagy/bullion:${{ steps.release.outputs.version }},jgnagy/bullion:${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "0.10.0"
2
+ ".": "0.10.2"
3
3
  }
data/.rubocop.yml CHANGED
@@ -73,7 +73,7 @@ RSpec/MultipleExpectations:
73
73
  Max: 13
74
74
 
75
75
  RSpec/ExampleLength:
76
- Max: 34
76
+ Max: 40
77
77
 
78
78
  Gemspec/DevelopmentDependencies:
79
79
  Enabled: false
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.10.2](https://github.com/jgnagy/bullion/compare/bullion/v0.10.1...bullion/v0.10.2) (2025-08-20)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * correct x509 certificate version to ensure x509v3 compliance ([0e8f6d7](https://github.com/jgnagy/bullion/commit/0e8f6d7bb6fc9b6913cff84390b1a5c436b53d2c))
9
+
10
+ ## [0.10.1](https://github.com/jgnagy/bullion/compare/bullion/v0.10.0...bullion/v0.10.1) (2025-07-06)
11
+
12
+
13
+ ### Features
14
+
15
+ * enable automatic Docker image builds ([6854692](https://github.com/jgnagy/bullion/commit/685469269d1f7e5b11c3c87bcd814225d5a26d1e))
16
+
3
17
  ## [0.10.0](https://github.com/jgnagy/bullion/compare/bullion/v0.9.0...bullion/v0.10.0) (2025-07-05)
4
18
 
5
19
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bullion (0.10.0)
4
+ bullion (0.10.2)
5
5
  benchmark (~> 0.4)
6
6
  dry-configurable (~> 1.1)
7
7
  httparty (~> 0.21)
@@ -23,13 +23,13 @@ GEM
23
23
  base64 (~> 0.2)
24
24
  faraday (>= 1.0, < 3.0.0)
25
25
  faraday-retry (>= 1.0, < 3.0.0)
26
- activemodel (8.0.2)
27
- activesupport (= 8.0.2)
28
- activerecord (8.0.2)
29
- activemodel (= 8.0.2)
30
- activesupport (= 8.0.2)
26
+ activemodel (8.0.2.1)
27
+ activesupport (= 8.0.2.1)
28
+ activerecord (8.0.2.1)
29
+ activemodel (= 8.0.2.1)
30
+ activesupport (= 8.0.2.1)
31
31
  timeout (>= 0.4.0)
32
- activesupport (8.0.2)
32
+ activesupport (8.0.2.1)
33
33
  base64
34
34
  benchmark (>= 0.3)
35
35
  bigdecimal
@@ -19,53 +19,44 @@ module Bullion
19
19
  end
20
20
 
21
21
  module Errors
22
+ # ACME exception for nonexistent accounts
23
+ class AccountDoesNotExist < Bullion::Acme::Error
24
+ def acme_type = "accountDoesNotExist"
25
+ end
26
+
22
27
  # ACME exception for bad CSRs
23
28
  class BadCsr < Bullion::Acme::Error
24
- def acme_type
25
- "badCSR"
26
- end
29
+ def acme_type = "badCSR"
27
30
  end
28
31
 
29
32
  # ACME exception for bad Nonces
30
33
  class BadNonce < Bullion::Acme::Error
31
- def acme_type
32
- "badNonce"
33
- end
34
+ def acme_type = "badNonce"
34
35
  end
35
36
 
36
37
  # ACME exception for invalid contacts in accounts
37
38
  class InvalidContact < Bullion::Acme::Error
38
- def acme_type
39
- "invalidContact"
40
- end
39
+ def acme_type = "invalidContact"
41
40
  end
42
41
 
43
42
  # ACME exception for invalid orders
44
43
  class InvalidOrder < Bullion::Acme::Error
45
- def acme_type
46
- "invalidOrder"
47
- end
44
+ def acme_type = "invalidOrder"
48
45
  end
49
46
 
50
47
  # ACME exception for malformed requests
51
48
  class Malformed < Bullion::Acme::Error
52
- def acme_type
53
- "malformed"
54
- end
49
+ def acme_type = "malformed"
55
50
  end
56
51
 
57
52
  # ACME exception for unsupported contacts in accounts
58
53
  class UnsupportedContact < Bullion::Acme::Error
59
- def acme_type
60
- "unsupportedContact"
61
- end
54
+ def acme_type = "unsupportedContact"
62
55
  end
63
56
 
64
57
  # Non-standard exception for unsupported challenge types
65
58
  class UnsupportedChallengeType < Bullion::Acme::Error
66
- def acme_error
67
- "urn:ietf:params:bullion:error:unsupportedChallengeType"
68
- end
59
+ def acme_error = "urn:ietf:params:bullion:error:unsupportedChallengeType"
69
60
  end
70
61
  end
71
62
  end
@@ -200,7 +200,7 @@ module Bullion
200
200
  # Create a OpenSSL cert using select info from the CSR
201
201
  csr_cert = OpenSSL::X509::Certificate.new
202
202
  csr_cert.serial = cert.serial
203
- csr_cert.version = 3
203
+ csr_cert.version = 2 # OpenSSL uses zero-indexed versions: 2 = x509v3
204
204
  csr_cert.not_before = Time.now
205
205
  # only 90 days for ACMEv2
206
206
  csr_cert.not_after = csr_cert.not_before + (3 * 30 * 24 * 60 * 60)
@@ -118,14 +118,9 @@ module Bullion
118
118
  # @see https://tools.ietf.org/html/rfc8555#section-7.3
119
119
  post "/accounts" do
120
120
  header_data = JSON.parse(Base64.decode64(@json_body[:protected]))
121
- begin
122
- parse_acme_jwt(header_data["jwk"], validate_nonce: false)
121
+ parse_acme_jwt(header_data["jwk"], validate_nonce: false)
123
122
 
124
- account_data_valid?(@payload_data)
125
- rescue Bullion::Acme::Error => e
126
- content_type "application/problem+json"
127
- halt 400, { type: e.acme_error, detail: e.message }.to_json
128
- end
123
+ account_data_valid?(@payload_data)
129
124
 
130
125
  user = Models::Account.where(
131
126
  public_key: header_data["jwk"]
@@ -133,7 +128,10 @@ module Bullion
133
128
 
134
129
  if @payload_data["onlyReturnExisting"]
135
130
  content_type "application/problem+json"
136
- halt 400, { type: "urn:ietf:params:acme:error:accountDoesNotExist" }.to_json unless user
131
+ unless user
132
+ raise Bullion::Acme::Error::AccountDoesNotExist,
133
+ "onlyReturnExisting requested and account does not exist"
134
+ end
137
135
  end
138
136
 
139
137
  user ||= Models::Account.new(public_key: header_data["jwk"])
@@ -149,6 +147,9 @@ module Bullion
149
147
  contact: user.contacts,
150
148
  orders: uri("/accounts/#{user.id}/orders")
151
149
  }.to_json
150
+ rescue Bullion::Acme::Error => e
151
+ content_type "application/problem+json"
152
+ halt 400, { type: e.acme_error, detail: e.message }.to_json
152
153
  end
153
154
 
154
155
  # Endpoint for updating accounts
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bullion
4
- VERSION = "0.10.0"
4
+ VERSION = "0.10.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Gnagy