cecha 0.1.0 → 0.2.0

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
  SHA1:
3
- metadata.gz: 383be8c4517ba41053ae6ecfafc253e92d8def29
4
- data.tar.gz: 31793d19eae2b98a6c054ea4f0a01a615ce0991b
3
+ metadata.gz: 7e18b42d2e5a4395f1f9cd6f1bc10ac16fbf249e
4
+ data.tar.gz: 56cc11e2dc26087a99123296cf88bb19e26cdad9
5
5
  SHA512:
6
- metadata.gz: a1d7b0223cd69280e074a361967dc87fe0cd7d8b274efff0cb4e0ad71e544a41d810ca4c241245b199b6c049aae81d8f932383a42e68526960c4836e272d9c0f
7
- data.tar.gz: 459229d178c1a0dd95a57342ab83c7226aa1b671eef6a7bf493442cc062f5e52f4ce75f83059771d936acfa7424dc641d7047526d00db9776003ed79fa15a7b0
6
+ metadata.gz: b555ceab125d28bb4f096f4b55ea1e2cc7a6c955191ad1cb51447a4b8489d817ff7683f9b6fb55cd759da8b6234fe164494feefa44a8a1561ef69bd783305d69
7
+ data.tar.gz: 61f1feaa8571d262340d9feffd026803618f2bc9ee1fc0cd74dca64063977eb1d4290e363f4e98d790976129df3f4d7a38cc3618176de4e52df4179278c8ea9d
data/lib/cecha/client.rb CHANGED
@@ -5,7 +5,15 @@ module Cecha
5
5
  class Client
6
6
  attr_reader :logger
7
7
 
8
- ElbCert = Struct.new("ElbCert", :elb_name, :elb_port, :ssl_certificate_name, :signature_algorithm) do
8
+ ElbCert = Struct.new(
9
+ "ElbCert",
10
+ :aws_account_number,
11
+ :region,
12
+ :elb_name,
13
+ :elb_port,
14
+ :ssl_certificate_name,
15
+ :signature_algorithm
16
+ ) do
9
17
  def to_s
10
18
  values.join("\t")
11
19
  end
@@ -19,6 +27,7 @@ module Cecha
19
27
 
20
28
  @elasticloadbalancing = Aws::ElasticLoadBalancing::Resource.new aws_configuration
21
29
  @iam = Aws::IAM::Resource.new aws_configuration
30
+ @region = aws_configuration[:region]
22
31
  end
23
32
 
24
33
  def list
@@ -29,7 +38,10 @@ module Cecha
29
38
  elb.listener_descriptions.each do |desc|
30
39
  cert = ssl_certificate(desc.listener.ssl_certificate_id)
31
40
  if cert
32
- elbcert = ElbCert.new(elb.load_balancer_name)
41
+ elbcert = ElbCert.new
42
+ elbcert.aws_account_number = aws_account_number(desc.listener.ssl_certificate_id)
43
+ elbcert.region = @region
44
+ elbcert.elb_name = elb.load_balancer_name
33
45
  elbcert.elb_port = desc.listener.load_balancer_port
34
46
  elbcert.ssl_certificate_name = cert.name
35
47
  elbcert.signature_algorithm = OpenSSL::X509::Certificate.new(cert.certificate_body).signature_algorithm
@@ -49,5 +61,9 @@ module Cecha
49
61
  cert.server_certificate_metadata.arn == arn
50
62
  end
51
63
  end
64
+
65
+ def aws_account_number(arn)
66
+ arn.split(':')[4]
67
+ end
52
68
  end
53
69
  end
data/lib/cecha/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Cecha
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
data/lib/cecha.rb CHANGED
@@ -1,2 +1,2 @@
1
1
  require "cecha/version"
2
- require "cecha/CLI"
2
+ require "cecha/cli"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cecha
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ISOBE Kazuhiko