acmesmith-google-cloud-storage 0.1.4 → 0.1.5

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
  SHA256:
3
- metadata.gz: a062c406d2879e879b702bada371b6f6d1b67e09499cde4c4f93306cde0e1814
4
- data.tar.gz: 85b0649b0bb15edb29aa19d8abd716e82f1ff0a596651bbaf8bd77cf0206aeed
3
+ metadata.gz: 24508a0aeea8be42257cca1230c49da3fd6d7f38a12ef18b12bb3ded8b9fe59b
4
+ data.tar.gz: e3e07811bd7cb07b33403ac84cd77b3c73c3b1e0e23ced23c7667c5150573089
5
5
  SHA512:
6
- metadata.gz: 8d2fcbb3fb14c2961575438d40c2fa5268bad4d68d02c40f949b54d8633e3d8367dbe0dba466108766bd5aeb7cb0cddc3f8407706adef385091a62c825047f65
7
- data.tar.gz: '0811ee01c972df577b04387619026c28c5d76253476780e789b58c3aafa523980804e0fcef3b13b2557dd6ed68beb219bc5e0b2364756a2de271244b16d163f7'
6
+ metadata.gz: 110bce64521a18fbe10aba30c54023094ae105324787e8e467d4c0ea2666bb2e500a0a7f54e5a48e5aa21e1bd3b3587f83e8696cb5bab6ca69d9bda24707995d
7
+ data.tar.gz: e5c1e8aa73ae74813bb482d797edadc224553a101bf61ba47de6313af67663a06cb4a101b9e9dc72e8b59aeb81a8910d4cb0d2cfd5ecd8b89cd95181a7ecdfba
@@ -39,8 +39,7 @@ module Acmesmith
39
39
  end
40
40
 
41
41
  def get_account_key
42
- @api.get_object(bucket, account_key_key)
43
- AccountKey.new @api.get_object(bucket, account_key_key, download_dest: StringIO.new).string
42
+ AccountKey.new get_object_content(bucket, account_key_key)
44
43
  rescue Google::Apis::ClientError => e
45
44
  if e.status_code == 404
46
45
  raise NotExist.new("Account key doesn't exist")
@@ -108,7 +107,7 @@ module Acmesmith
108
107
  version = certificate_current(common_name) if version == 'current'
109
108
 
110
109
  get = ->(key) do
111
- @api.get_object(bucket, key, download_dest: StringIO.new).string
110
+ get_object_content(bucket, key)
112
111
  end
113
112
 
114
113
  certificate = get.call(certificate_key(common_name, version))
@@ -174,8 +173,7 @@ module Acmesmith
174
173
  end
175
174
 
176
175
  def certificate_current(cn)
177
- @api.get_object(bucket, certificate_current_key(cn))
178
- @api.get_object(bucket, certificate_current_key(cn), download_dest: StringIO.new).string.chomp
176
+ get_object_content(bucket, certificate_current_key(cn)).chomp
179
177
  rescue Google::Apis::ClientError => e
180
178
  if e.status_code == 404
181
179
  raise NotExist.new("Certificate for #{cn.inspect} of current version doesn't exist")
@@ -207,6 +205,12 @@ module Acmesmith
207
205
  private_key: OpenSSL::PKey.read(obj["private_key"]),
208
206
  }
209
207
  end
208
+
209
+ def get_object_content(bucket, key)
210
+ output = StringIO.new
211
+ @api.get_object(bucket, key, download_dest: output)
212
+ output.string
213
+ end
210
214
  end
211
215
  end
212
216
  end
@@ -1,3 +1,3 @@
1
1
  module AcmesmithGoogleCloudStorage
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acmesmith-google-cloud-storage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - YAMADA Tsuyoshi
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-03 00:00:00.000000000 Z
11
+ date: 2022-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: acmesmith
@@ -103,7 +103,7 @@ homepage: https://github.com/minimum2scp/acmesmith-google-cloud-storage
103
103
  licenses:
104
104
  - MIT
105
105
  metadata: {}
106
- post_install_message:
106
+ post_install_message:
107
107
  rdoc_options: []
108
108
  require_paths:
109
109
  - lib
@@ -118,8 +118,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
118
  - !ruby/object:Gem::Version
119
119
  version: '0'
120
120
  requirements: []
121
- rubygems_version: 3.1.2
122
- signing_key:
121
+ rubygems_version: 3.3.22
122
+ signing_key:
123
123
  specification_version: 4
124
124
  summary: acmesmith plugin implementing google_cloud_storage storage
125
125
  test_files: []