bullion 0.7.1 → 0.7.3

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: 3e9ebdfc8744eadaf021a1f19f79c12e39b63e87896d21896c546ef875e15955
4
- data.tar.gz: a6dd92c1c76bdd65a0e2a58ae90e3db912590d6f2e2e0a522adfeda5bc287e2e
3
+ metadata.gz: 827d24fcfaf7bca7596c5385117d8bd5c51d23e636a562e64d3401979a08845b
4
+ data.tar.gz: 01edf02e356c2b1ea2a56420a82a1f8ff1dc02a3cda56a6e19f5f2ed74b16ebb
5
5
  SHA512:
6
- metadata.gz: a6eaf7ae8d958d3adef49a95fe9d3c53b1610fed2ebdfcee0f13b7b71aacd07ded25e7652b0f1c0f8168d812df8ecbb83642c0679c3c8d26a75cf50207f21c35
7
- data.tar.gz: ce2065af090c95f31ed8bfbcc23f4c12f452d3d52fca7f9715877c975e8a0dcb10a6670759277a218edb8b6988cadb9a3f45941f6cda4f71f77ecf084c51db54
6
+ metadata.gz: f07630d7c8f0535a6010f236cc9b94801b6e4daa3f5787517f3a52747e7d5645d71f5fb18fe24065dba0df49f0c32d2ea784a6ad563b75dd92ba38e42fb628d8
7
+ data.tar.gz: a5790c1b157d7f237fd691d319e1725ce58e824e905f7ddfe0cfcb0cb6a427560be85fa51709306f7985fcbbf08547d5a49412d71ff0d88c7d7b65144d5d9ccf
data/.gitignore CHANGED
@@ -6,9 +6,10 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
+ /scripts/local_testing/
9
10
 
10
11
  # rspec failure tracking
11
12
  .rspec_status
12
13
 
13
14
  .DS_Store
14
- *.gem
15
+ *.gem
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.2.2
1
+ 3.3.4
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bullion (0.7.1)
4
+ bullion (0.7.3)
5
5
  dry-configurable (~> 1.1)
6
6
  httparty (~> 0.21)
7
7
  json (~> 2.6)
@@ -18,142 +18,157 @@ PATH
18
18
  GEM
19
19
  remote: https://rubygems.org/
20
20
  specs:
21
- acme-client (2.0.16)
21
+ acme-client (2.0.18)
22
22
  faraday (>= 1.0, < 3.0.0)
23
23
  faraday-retry (>= 1.0, < 3.0.0)
24
- activemodel (7.1.3)
25
- activesupport (= 7.1.3)
26
- activerecord (7.1.3)
27
- activemodel (= 7.1.3)
28
- activesupport (= 7.1.3)
24
+ activemodel (7.2.0)
25
+ activesupport (= 7.2.0)
26
+ activerecord (7.2.0)
27
+ activemodel (= 7.2.0)
28
+ activesupport (= 7.2.0)
29
29
  timeout (>= 0.4.0)
30
- activesupport (7.1.3)
30
+ activesupport (7.2.0)
31
31
  base64
32
32
  bigdecimal
33
- concurrent-ruby (~> 1.0, >= 1.0.2)
33
+ concurrent-ruby (~> 1.0, >= 1.3.1)
34
34
  connection_pool (>= 2.2.5)
35
35
  drb
36
36
  i18n (>= 1.6, < 2)
37
+ logger (>= 1.4.2)
37
38
  minitest (>= 5.1)
38
- mutex_m
39
- tzinfo (~> 2.0)
39
+ securerandom (>= 0.3)
40
+ tzinfo (~> 2.0, >= 2.0.5)
40
41
  ast (2.4.2)
41
42
  backport (1.2.0)
42
43
  base64 (0.2.0)
43
44
  benchmark (0.3.0)
44
- bigdecimal (3.1.6)
45
+ bigdecimal (3.1.8)
45
46
  byebug (11.1.3)
46
- concurrent-ruby (1.2.3)
47
+ concurrent-ruby (1.3.4)
47
48
  connection_pool (2.4.1)
48
- diff-lcs (1.5.0)
49
- docile (1.4.0)
50
- drb (2.2.0)
51
- ruby2_keywords
52
- dry-configurable (1.1.0)
49
+ csv (3.3.0)
50
+ diff-lcs (1.5.1)
51
+ docile (1.4.1)
52
+ drb (2.2.1)
53
+ dry-configurable (1.2.0)
53
54
  dry-core (~> 1.0, < 2)
54
55
  zeitwerk (~> 2.6)
55
56
  dry-core (1.0.1)
56
57
  concurrent-ruby (~> 1.0)
57
58
  zeitwerk (~> 2.6)
58
59
  e2mmap (0.1.0)
59
- faraday (2.9.0)
60
+ faraday (2.10.1)
60
61
  faraday-net_http (>= 2.0, < 3.2)
61
- faraday-net_http (3.1.0)
62
+ logger
63
+ faraday-net_http (3.1.1)
62
64
  net-http
63
- faraday-retry (2.2.0)
65
+ faraday-retry (2.2.1)
64
66
  faraday (~> 2.0)
65
- httparty (0.21.0)
67
+ httparty (0.22.0)
68
+ csv
66
69
  mini_mime (>= 1.0.0)
67
70
  multi_xml (>= 0.5.2)
68
- i18n (1.14.1)
71
+ i18n (1.14.5)
69
72
  concurrent-ruby (~> 1.0)
70
- jaro_winkler (1.5.6)
71
- json (2.7.1)
72
- jwt (2.7.1)
73
+ jaro_winkler (1.6.0)
74
+ json (2.7.2)
75
+ jwt (2.8.2)
76
+ base64
73
77
  kramdown (2.4.0)
74
78
  rexml
75
79
  kramdown-parser-gfm (1.1.0)
76
80
  kramdown (~> 2.0)
77
81
  language_server-protocol (3.17.0.3)
82
+ logger (1.6.0)
78
83
  mini_mime (1.1.5)
79
- mini_portile2 (2.8.5)
80
- minitest (5.21.2)
84
+ minitest (5.25.0)
81
85
  multi_json (1.15.0)
82
- multi_xml (0.6.0)
83
- mustermann (3.0.0)
86
+ multi_xml (0.7.1)
87
+ bigdecimal (~> 3.1)
88
+ mustermann (3.0.2)
84
89
  ruby2_keywords (~> 0.0.1)
85
- mutex_m (0.2.0)
86
- mysql2 (0.5.5)
90
+ mysql2 (0.5.6)
87
91
  net-http (0.4.1)
88
92
  uri
89
- nio4r (2.7.0)
90
- nokogiri (1.16.0)
91
- mini_portile2 (~> 2.8.2)
93
+ nio4r (2.7.3)
94
+ nokogiri (1.16.7-aarch64-linux)
95
+ racc (~> 1.4)
96
+ nokogiri (1.16.7-arm-linux)
97
+ racc (~> 1.4)
98
+ nokogiri (1.16.7-arm64-darwin)
92
99
  racc (~> 1.4)
93
- nokogiri (1.16.0-arm64-darwin)
100
+ nokogiri (1.16.7-x86-linux)
94
101
  racc (~> 1.4)
95
- nokogiri (1.16.0-x86_64-linux)
102
+ nokogiri (1.16.7-x86_64-darwin)
103
+ racc (~> 1.4)
104
+ nokogiri (1.16.7-x86_64-linux)
96
105
  racc (~> 1.4)
97
106
  openssl (3.2.0)
98
- parallel (1.24.0)
99
- parser (3.3.0.5)
107
+ parallel (1.26.2)
108
+ parser (3.3.4.2)
100
109
  ast (~> 2.4.1)
101
110
  racc
102
- prometheus-client (4.2.2)
111
+ prometheus-client (4.2.3)
112
+ base64
103
113
  puma (6.4.2)
104
114
  nio4r (~> 2.0)
105
- racc (1.7.3)
106
- rack (2.2.8)
115
+ racc (1.8.1)
116
+ rack (2.2.9)
107
117
  rack-protection (3.2.0)
108
118
  base64 (>= 0.1.0)
109
119
  rack (~> 2.2, >= 2.2.4)
110
120
  rack-test (2.1.0)
111
121
  rack (>= 1.3)
112
122
  rainbow (3.1.1)
113
- rake (13.1.0)
123
+ rake (13.2.1)
114
124
  rbs (2.8.4)
115
- regexp_parser (2.9.0)
125
+ regexp_parser (2.9.2)
116
126
  reverse_markdown (2.1.1)
117
127
  nokogiri
118
- rexml (3.2.6)
119
- rspec (3.12.0)
120
- rspec-core (~> 3.12.0)
121
- rspec-expectations (~> 3.12.0)
122
- rspec-mocks (~> 3.12.0)
123
- rspec-core (3.12.2)
124
- rspec-support (~> 3.12.0)
125
- rspec-expectations (3.12.3)
128
+ rexml (3.3.5)
129
+ strscan
130
+ rspec (3.13.0)
131
+ rspec-core (~> 3.13.0)
132
+ rspec-expectations (~> 3.13.0)
133
+ rspec-mocks (~> 3.13.0)
134
+ rspec-core (3.13.0)
135
+ rspec-support (~> 3.13.0)
136
+ rspec-expectations (3.13.1)
126
137
  diff-lcs (>= 1.2.0, < 2.0)
127
- rspec-support (~> 3.12.0)
128
- rspec-mocks (3.12.6)
138
+ rspec-support (~> 3.13.0)
139
+ rspec-mocks (3.13.1)
129
140
  diff-lcs (>= 1.2.0, < 2.0)
130
- rspec-support (~> 3.12.0)
131
- rspec-support (3.12.1)
132
- rubocop (1.60.2)
141
+ rspec-support (~> 3.13.0)
142
+ rspec-support (3.13.1)
143
+ rubocop (1.65.1)
133
144
  json (~> 2.3)
134
145
  language_server-protocol (>= 3.17.0)
135
146
  parallel (~> 1.10)
136
147
  parser (>= 3.3.0.2)
137
148
  rainbow (>= 2.2.2, < 4.0)
138
- regexp_parser (>= 1.8, < 3.0)
149
+ regexp_parser (>= 2.4, < 3.0)
139
150
  rexml (>= 3.2.5, < 4.0)
140
- rubocop-ast (>= 1.30.0, < 2.0)
151
+ rubocop-ast (>= 1.31.1, < 2.0)
141
152
  ruby-progressbar (~> 1.7)
142
153
  unicode-display_width (>= 2.4.0, < 3.0)
143
- rubocop-ast (1.30.0)
144
- parser (>= 3.2.1.0)
145
- rubocop-capybara (2.20.0)
146
- rubocop (~> 1.41)
147
- rubocop-factory_bot (2.25.1)
154
+ rubocop-ast (1.32.0)
155
+ parser (>= 3.3.1.0)
156
+ rubocop-capybara (2.21.0)
148
157
  rubocop (~> 1.41)
158
+ rubocop-factory_bot (2.26.1)
159
+ rubocop (~> 1.61)
149
160
  rubocop-rake (0.6.0)
150
161
  rubocop (~> 1.0)
151
- rubocop-rspec (2.26.1)
162
+ rubocop-rspec (2.31.0)
152
163
  rubocop (~> 1.40)
153
164
  rubocop-capybara (~> 2.17)
154
165
  rubocop-factory_bot (~> 2.22)
166
+ rubocop-rspec_rails (~> 2.28)
167
+ rubocop-rspec_rails (2.29.1)
168
+ rubocop (~> 1.61)
155
169
  ruby-progressbar (1.13.0)
156
170
  ruby2_keywords (0.0.5)
171
+ securerandom (0.3.1)
157
172
  simplecov (0.22.0)
158
173
  docile (~> 1.1)
159
174
  simplecov-html (~> 0.11)
@@ -193,23 +208,29 @@ GEM
193
208
  thor (~> 1.0)
194
209
  tilt (~> 2.0)
195
210
  yard (~> 0.9, >= 0.9.24)
196
- sqlite3 (1.7.1)
197
- mini_portile2 (~> 2.8.0)
198
- sqlite3 (1.7.1-arm64-darwin)
199
- sqlite3 (1.7.1-x86_64-linux)
200
- thor (1.3.0)
201
- tilt (2.3.0)
211
+ sqlite3 (1.7.3-aarch64-linux)
212
+ sqlite3 (1.7.3-arm-linux)
213
+ sqlite3 (1.7.3-arm64-darwin)
214
+ sqlite3 (1.7.3-x86-linux)
215
+ sqlite3 (1.7.3-x86_64-darwin)
216
+ sqlite3 (1.7.3-x86_64-linux)
217
+ strscan (3.1.0)
218
+ thor (1.3.1)
219
+ tilt (2.4.0)
202
220
  timeout (0.4.1)
203
221
  tzinfo (2.0.6)
204
222
  concurrent-ruby (~> 1.0)
205
223
  unicode-display_width (2.5.0)
206
224
  uri (0.13.0)
207
- yard (0.9.34)
208
- zeitwerk (2.6.12)
225
+ yard (0.9.36)
226
+ zeitwerk (2.6.17)
209
227
 
210
228
  PLATFORMS
211
- arm64-darwin-23
212
- ruby
229
+ aarch64-linux
230
+ arm-linux
231
+ arm64-darwin
232
+ x86-linux
233
+ x86_64-darwin
213
234
  x86_64-linux
214
235
 
215
236
  DEPENDENCIES
@@ -229,4 +250,4 @@ DEPENDENCIES
229
250
  yard (~> 0.9)
230
251
 
231
252
  BUNDLED WITH
232
- 2.4.13
253
+ 2.5.11
data/Rakefile CHANGED
@@ -40,9 +40,9 @@ task :prep do
40
40
  ENV["CA_SECRET"] = "SomeS3cret"
41
41
  ENV["CA_DOMAINS"] = "test.domain"
42
42
 
43
- key = OpenSSL::PKey::RSA.new(4096)
44
- File.write(File.join(File.expand_path("."), "tmp", "tls.key"),
45
- key.to_pem(OpenSSL::Cipher.new("aes-128-cbc"), ENV.fetch("CA_SECRET", nil)))
43
+ root_key = OpenSSL::PKey::RSA.new(4096)
44
+ File.write(File.join(File.expand_path("."), "tmp", "root_tls.key"),
45
+ root_key.to_pem(OpenSSL::Cipher.new("aes-128-cbc"), ENV.fetch("CA_SECRET", nil)))
46
46
 
47
47
  root_ca = OpenSSL::X509::Certificate.new
48
48
  root_ca.version = 2
@@ -51,7 +51,7 @@ task :prep do
51
51
  %w[test domain].reverse.map { |piece| "DC=#{piece}" }.join("/") + "/CN=bullion"
52
52
  )
53
53
  root_ca.issuer = root_ca.subject # root CA's are "self-signed"
54
- root_ca.public_key = key.public_key
54
+ root_ca.public_key = root_key.public_key
55
55
  root_ca.not_before = Time.now
56
56
  root_ca.not_after = root_ca.not_before + (5 * 365 * 24 * 60 * 60) # 5 years validity
57
57
  ef = OpenSSL::X509::ExtensionFactory.new
@@ -69,8 +69,43 @@ task :prep do
69
69
  root_ca.add_extension(
70
70
  ef.create_extension("authorityKeyIdentifier", "keyid:always", false)
71
71
  )
72
- root_ca.sign(key, OpenSSL::Digest.new("SHA256"))
73
- File.write(File.join(File.expand_path("."), "tmp", "tls.crt"), root_ca.to_pem)
72
+ root_ca.sign(root_key, OpenSSL::Digest.new("SHA256"))
73
+ File.write(File.join(File.expand_path("."), "tmp", "root_tls.crt"), root_ca.to_pem)
74
+
75
+ intermediate_key = OpenSSL::PKey::RSA.new(4096)
76
+ File.write(File.join(File.expand_path("."), "tmp", "tls.key"),
77
+ intermediate_key.to_pem(OpenSSL::Cipher.new("aes-128-cbc"), ENV.fetch("CA_SECRET")))
78
+
79
+ int_ca = OpenSSL::X509::Certificate.new
80
+ int_ca.version = 2
81
+ int_ca.serial = (2**rand(10..20)) - 1
82
+ int_ca.subject = OpenSSL::X509::Name.parse(
83
+ %w[intermediate test domain].reverse.map { |piece| "DC=#{piece}" }.join("/") + "/CN=bullion"
84
+ )
85
+ int_ca.issuer = root_ca.subject
86
+ int_ca.public_key = intermediate_key.public_key
87
+ int_ca.not_before = Time.now
88
+ int_ca.not_after = int_ca.not_before + (2 * 365 * 24 * 60 * 60) # 2 years validity
89
+ ef = OpenSSL::X509::ExtensionFactory.new
90
+ ef.subject_certificate = int_ca
91
+ ef.issuer_certificate = root_ca
92
+ int_ca.add_extension(
93
+ ef.create_extension("basicConstraints", "CA:TRUE", true)
94
+ )
95
+ int_ca.add_extension(
96
+ ef.create_extension("keyUsage", "keyCertSign, cRLSign", true)
97
+ )
98
+ int_ca.add_extension(
99
+ ef.create_extension("subjectKeyIdentifier", "hash", false)
100
+ )
101
+ int_ca.add_extension(
102
+ ef.create_extension("authorityKeyIdentifier", "keyid:always", false)
103
+ )
104
+ int_ca.sign(root_key, OpenSSL::Digest.new("SHA256"))
105
+ File.write(
106
+ File.join(File.expand_path("."), "tmp", "tls.crt"),
107
+ int_ca.to_pem + root_ca.to_pem
108
+ )
74
109
  end
75
110
 
76
111
  desc "Runs a backgrounded demo environment"
@@ -87,7 +122,7 @@ end
87
122
 
88
123
  desc "Runs a foregrounded demo environment"
89
124
  task :foreground_demo do
90
- system("rackup -P #{File.expand_path(".")}/tmp/daemon.pid")
125
+ system("rackup -o 0.0.0.0 -P #{File.expand_path(".")}/tmp/daemon.pid")
91
126
  end
92
127
 
93
128
  desc "Cleans up test or demo environment"
@@ -98,6 +133,8 @@ task :cleanup do
98
133
  end
99
134
  FileUtils.rm_f(File.join(File.expand_path("."), "tmp", "tls.crt"))
100
135
  FileUtils.rm_f(File.join(File.expand_path("."), "tmp", "tls.key"))
136
+ FileUtils.rm_f(File.join(File.expand_path("."), "tmp", "root_tls.crt"))
137
+ FileUtils.rm_f(File.join(File.expand_path("."), "tmp", "root_tls.key"))
101
138
  FileUtils.rm_rf(File.join(File.expand_path("."), "tmp", "db"))
102
139
  ENV["CA_DIR"] = nil
103
140
  ENV["CA_SECRET"] = nil
data/bullion.gemspec CHANGED
@@ -26,18 +26,18 @@ Gem::Specification.new do |spec|
26
26
 
27
27
  spec.required_ruby_version = "~> 3.2"
28
28
 
29
- spec.add_runtime_dependency "dry-configurable", "~> 1.1"
30
- spec.add_runtime_dependency "httparty", "~> 0.21"
31
- spec.add_runtime_dependency "json", "~> 2.6"
32
- spec.add_runtime_dependency "jwt", "~> 2.7"
33
- spec.add_runtime_dependency "mysql2", "~> 0.5"
34
- spec.add_runtime_dependency "openssl", "~> 3.0"
35
- spec.add_runtime_dependency "prometheus-client", "~> 4.2"
36
- spec.add_runtime_dependency "puma", "~> 6.4"
37
- spec.add_runtime_dependency "sinatra", "~> 3.1"
38
- spec.add_runtime_dependency "sinatra-activerecord", "~> 2.0"
39
- spec.add_runtime_dependency "sinatra-contrib", "~> 3.1"
40
- spec.add_runtime_dependency "sqlite3", "~> 1.6"
29
+ spec.add_dependency "dry-configurable", "~> 1.1"
30
+ spec.add_dependency "httparty", "~> 0.21"
31
+ spec.add_dependency "json", "~> 2.6"
32
+ spec.add_dependency "jwt", "~> 2.7"
33
+ spec.add_dependency "mysql2", "~> 0.5"
34
+ spec.add_dependency "openssl", "~> 3.0"
35
+ spec.add_dependency "prometheus-client", "~> 4.2"
36
+ spec.add_dependency "puma", "~> 6.4"
37
+ spec.add_dependency "sinatra", "~> 3.1"
38
+ spec.add_dependency "sinatra-activerecord", "~> 2.0"
39
+ spec.add_dependency "sinatra-contrib", "~> 3.1"
40
+ spec.add_dependency "sqlite3", "~> 1.6"
41
41
 
42
42
  spec.add_development_dependency "acme-client", "~> 2.0"
43
43
  spec.add_development_dependency "bundler", "~> 2.4"
data/db/schema.rb CHANGED
@@ -10,7 +10,7 @@
10
10
  #
11
11
  # It's strongly recommended that you check this file into your version control system.
12
12
 
13
- ActiveRecord::Schema[7.1].define(version: 2021_01_06_060335) do
13
+ ActiveRecord::Schema[7.2].define(version: 2021_01_06_060335) do
14
14
  create_table "accounts", force: :cascade do |t|
15
15
  t.boolean "tos_agreed", default: true, null: false
16
16
  t.text "public_key", null: false
@@ -95,7 +95,7 @@ module Bullion
95
95
  content_type "application/x-pem-file"
96
96
 
97
97
  attachment "cabundle.pem"
98
- Bullion.ca_cert.to_pem
98
+ Bullion.ca_cert_file
99
99
  end
100
100
 
101
101
  # Retrieves a Nonce via a HEAD request
@@ -383,7 +383,7 @@ module Bullion
383
383
 
384
384
  cert = Models::Certificate.find(params[:id])
385
385
 
386
- cert.data + Bullion.ca_cert.to_pem
386
+ cert.data + Bullion.ca_cert_file
387
387
  else
388
388
  halt(422, { error: "Order not valid" }.to_json)
389
389
  end
@@ -4,6 +4,6 @@ module Bullion
4
4
  VERSION = [
5
5
  0, # major
6
6
  7, # minor
7
- 1 # patch
7
+ 3 # patch
8
8
  ].join(".")
9
9
  end
data/lib/bullion.rb CHANGED
@@ -70,8 +70,12 @@ module Bullion
70
70
  @ca_key ||= OpenSSL::PKey::RSA.new(File.read(config.ca.key_path), config.ca.secret)
71
71
  end
72
72
 
73
+ def self.ca_cert_file
74
+ @ca_cert_file ||= File.read(config.ca.cert_path)
75
+ end
76
+
73
77
  def self.ca_cert
74
- @ca_cert ||= OpenSSL::X509::Certificate.new(File.read(config.ca.cert_path))
78
+ @ca_cert ||= OpenSSL::X509::Certificate.new(ca_cert_file)
75
79
  end
76
80
 
77
81
  def self.rotate_keys!
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Gnagy
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-01-31 00:00:00.000000000 Z
11
+ date: 2024-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-configurable