apple_certs_info 0.1.3 → 0.1.8
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/CODE_OF_CONDUCT.md +1 -1
- data/Gemfile.lock +1 -1
- data/README.md +2 -2
- data/apple_certs_info.gemspec +1 -1
- data/lib/apple_certs_info.rb +15 -8
- data/lib/apple_certs_info/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af7f8229f8689f9d7a2f36440999dde63b2a46c9e4429288765e3e4559b3ade8
|
4
|
+
data.tar.gz: ff41a08af497ea80f00f7cc29dd2d4b760d84fb48c2d8a7051b0b17c3c1af002
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a5dacb311d712650309fdab78945c01fcbd245de49fdf75e72762e3111b6a792e2b6d70cc996ae7b7aa4836c2a2195f72f3653e7330a78b3a527a9c4bbf9af8
|
7
|
+
data.tar.gz: 9b21b435a7bb05be3999187bec9c09fe96ef5c95df7438b22f968d85dd2a4188a4d7f69e3cb7dd17e17feeb5a9c3b72a14113d7b516519fbecdf24f3a4a51c0a
|
data/CODE_OF_CONDUCT.md
CHANGED
@@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
|
|
55
55
|
## Enforcement
|
56
56
|
|
57
57
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
-
reported by contacting the project team at
|
58
|
+
reported by contacting the project team at tarappo@gmail.com. All
|
59
59
|
complaints will be reviewed and investigated and will result in a response that
|
60
60
|
is deemed necessary and appropriate to the circumstances. The project team is
|
61
61
|
obligated to maintain confidentiality with regard to the reporter of an incident.
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -30,10 +30,10 @@ AppleCertsInfo.provisioning_profile_list_limit_days_for(days: 10)
|
|
30
30
|
|
31
31
|
|
32
32
|
```
|
33
|
-
# Development
|
33
|
+
# iPhone Developer / Apple Development
|
34
34
|
AppleCertsInfo.certificate_development_list_limit_days_for(days: 10)
|
35
35
|
|
36
|
-
# Distribution
|
36
|
+
# iPhone / Apple Distribution
|
37
37
|
AppleCertsInfo.certificate_distribution_list_limit_days_for(days: 10)
|
38
38
|
```
|
39
39
|
|
data/apple_certs_info.gemspec
CHANGED
@@ -4,7 +4,7 @@ Gem::Specification.new do |spec|
|
|
4
4
|
spec.name = "apple_certs_info"
|
5
5
|
spec.version = AppleCertsInfo::VERSION
|
6
6
|
spec.authors = ["Toshiyuki Hirata"]
|
7
|
-
spec.email = ["
|
7
|
+
spec.email = ["tarappo@gmail.com"]
|
8
8
|
|
9
9
|
spec.summary = %q{Apple Certificate files and Provisioning Profile information.}
|
10
10
|
spec.homepage = "https://github.com/tarappo/apple_certs_info"
|
data/lib/apple_certs_info.rb
CHANGED
@@ -13,7 +13,7 @@ module AppleCertsInfo
|
|
13
13
|
@debug_log
|
14
14
|
end
|
15
15
|
|
16
|
-
# Check Certificate file for iPhone/Apple Development in the KeyChain
|
16
|
+
# Check Certificate file for iPhone Developer /Apple Development in the KeyChain
|
17
17
|
# @param days: limit days
|
18
18
|
def self.certificate_development_list_limit_days_for(days:)
|
19
19
|
raise "do not set days param" if days.nil?
|
@@ -33,11 +33,21 @@ module AppleCertsInfo
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def self.certificate_development_list
|
36
|
-
|
36
|
+
list = []
|
37
|
+
iphone_list = certificate_list_for(name: "iPhone Developer")
|
38
|
+
apple_list = certificate_list_for(name: "Apple Development")
|
39
|
+
list.concat(iphone_list)
|
40
|
+
list.concat(apple_list)
|
41
|
+
return list.uniq
|
37
42
|
end
|
38
43
|
|
39
44
|
def self.certificate_distribution_list
|
40
|
-
|
45
|
+
list = []
|
46
|
+
iphone_list = certificate_list_for(name: "iPhone Distribution")
|
47
|
+
apple_list = certificate_list_for(name: "Apple Distribution")
|
48
|
+
list.concat(iphone_list)
|
49
|
+
list.concat(apple_list)
|
50
|
+
return list.uniq
|
41
51
|
end
|
42
52
|
|
43
53
|
def self.certificate_info_for(name:)
|
@@ -48,7 +58,6 @@ module AppleCertsInfo
|
|
48
58
|
begin
|
49
59
|
`security find-certificate -a -c "#{name}" -p > #{temp_pem_file.path}`
|
50
60
|
result = `openssl x509 -text -fingerprint -noout -in #{temp_pem_file.path}`
|
51
|
-
puts(result) if @debug_log == true
|
52
61
|
|
53
62
|
expire_datetime_match = result.match(/.*Not After :(.*)/)
|
54
63
|
raise "not exits expire date" if expire_datetime_match.nil?
|
@@ -56,7 +65,7 @@ module AppleCertsInfo
|
|
56
65
|
expire_datetime = Time.parse(expire_datetime_match[1])
|
57
66
|
|
58
67
|
cname_match = result.match(/Subject: .* CN=(.*), OU=.*/)
|
59
|
-
raise "not exists cname" if cname_match.nil?
|
68
|
+
raise "not exists cname:#{result}" if cname_match.nil?
|
60
69
|
cname = cname_match[1]
|
61
70
|
|
62
71
|
limit_days = calc_limit_days(datetime: expire_datetime)
|
@@ -125,16 +134,14 @@ module AppleCertsInfo
|
|
125
134
|
|
126
135
|
danger_list = []
|
127
136
|
list.each do |info|
|
128
|
-
danger_list << info if info[:limit_days] <= days
|
137
|
+
danger_list << info if info[:limit_days].to_i <= days.to_i
|
129
138
|
end
|
130
139
|
|
131
140
|
danger_list
|
132
141
|
end
|
133
142
|
|
134
143
|
def self.certificate_list_for(name:)
|
135
|
-
puts("targetName: #{name}") if @debug_log == true
|
136
144
|
result = `security find-certificate -a -c "#{name}"`
|
137
|
-
puts(result) if @debug_log == true
|
138
145
|
name_match_list = result.scan(/.*alis".*=\"(.*)\".*/)
|
139
146
|
puts(name_match_list) if @debug_log == true
|
140
147
|
|
metadata
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apple_certs_info
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Toshiyuki Hirata
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-01-
|
11
|
+
date: 2021-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|
15
|
-
-
|
15
|
+
- tarappo@gmail.com
|
16
16
|
executables: []
|
17
17
|
extensions: []
|
18
18
|
extra_rdoc_files: []
|