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 +4 -4
- data/lib/cecha/client.rb +18 -2
- data/lib/cecha/version.rb +1 -1
- data/lib/cecha.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e18b42d2e5a4395f1f9cd6f1bc10ac16fbf249e
|
4
|
+
data.tar.gz: 56cc11e2dc26087a99123296cf88bb19e26cdad9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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(
|
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
|
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
data/lib/cecha.rb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
require "cecha/version"
|
2
|
-
require "cecha/
|
2
|
+
require "cecha/cli"
|