apple_certs_info 0.1.4 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- 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 +2 -2
- data/lib/apple_certs_info.rb +19 -10
- 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: 8919e7f716548ce695171e206e2fb3eeb7c3a27d3bc09165c4aecf09faf921ad
|
4
|
+
data.tar.gz: b5fd6e5598c774e9213df13956b609bf5f304851712374854a55aca5c78c962d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 915eafd2ce442ad64472816068ce04b0695c63250981f120fafffcad32981ef430df1ab0611f13cc98a9b497ef53625888d0f3bdb2029fdf60a4244d8a5b796a
|
7
|
+
data.tar.gz: df12e08a66305f18768cb2770c59a184c6587291d00b1d2dac28d753a535b20d388ba970d2cb232b859ee95072581243bb1985a5420429dbeaecc571c536f8bd
|
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
@@ -3,8 +3,8 @@ require_relative 'lib/apple_certs_info/version'
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = "apple_certs_info"
|
5
5
|
spec.version = AppleCertsInfo::VERSION
|
6
|
-
spec.authors = ["
|
7
|
-
spec.email = ["
|
6
|
+
spec.authors = ["tarappo"]
|
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,11 +13,11 @@ module AppleCertsInfo
|
|
13
13
|
@debug_log
|
14
14
|
end
|
15
15
|
|
16
|
-
# Check Certificate file for iPhone/Apple
|
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?
|
20
|
-
limit_days_for(days: days, type: "
|
20
|
+
limit_days_for(days: days, type: "certificate_development")
|
21
21
|
end
|
22
22
|
|
23
23
|
# Check Certificate file for iPhone/Apple Distribution in the KeyChain
|
@@ -32,12 +32,22 @@ module AppleCertsInfo
|
|
32
32
|
limit_days_for(days: days, type: "provisioning_profile")
|
33
33
|
end
|
34
34
|
|
35
|
-
def self.
|
36
|
-
|
35
|
+
def self.certificate_development_list
|
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)
|
@@ -114,8 +123,8 @@ module AppleCertsInfo
|
|
114
123
|
private
|
115
124
|
def self.limit_days_for(days:, type:)
|
116
125
|
case type
|
117
|
-
when "
|
118
|
-
list =
|
126
|
+
when "certificate_development" then
|
127
|
+
list = certificate_development_list
|
119
128
|
when "certificate_distribution" then
|
120
129
|
list = certificate_distribution_list
|
121
130
|
when "provisioning_profile" then
|
@@ -125,7 +134,7 @@ 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
|
metadata
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apple_certs_info
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- tarappo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
@@ -12,7 +12,7 @@ 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: []
|