cert 1.3.0 → 1.4.0

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
  SHA1:
3
- metadata.gz: 714f76d328ab06cf34b40ce8f3d97fa772be8981
4
- data.tar.gz: 521e125d30b81831df122d9706ba275675ec64fa
3
+ metadata.gz: 4890626fc51ac7deafb1d14fe15d67ed2f7cc38c
4
+ data.tar.gz: 37d2c4b4834a9195865868574339355b429ab14a
5
5
  SHA512:
6
- metadata.gz: 87860072cd460b853c8079255a2a30dac9ec3cc5197baa9821c2cf913e8911b60d1808cea9201ec9dd919d77c10179e078d4274c629ef9da2462f64077b6d984
7
- data.tar.gz: 7481ffb4c7669121d71a49a73853aa0c7b95977b19ddf8dacf43a8396bdc3494c1cdeb2a48b669893db931c58b18b42862d716a09d73624fb340dbe41388ded4
6
+ metadata.gz: 22bf615b35044d0605fe8cae8fc837a2b8861c11d40653a7179748c35910bb68219ba17c0eea1cdf58173fa2263f382205df2b9bc71d5f762ab73508eeab4614
7
+ data.tar.gz: 98cc677404b938f2c4636cf7994be50e1e3b8dda9d8de728020334e4bab71eafbe3b4acaf6a45c2a51b5a25a05830b95d2c0b0528855879fd7da9b9e3251fbdf
data/bin/cert CHANGED
@@ -34,6 +34,16 @@ class CertApplication
34
34
  end
35
35
  end
36
36
 
37
+ command :revoke_expired do |c|
38
+ c.syntax = 'cert revoke_expired'
39
+ c.description = 'Revoke expired iOS code signing certificates'
40
+
41
+ c.action do |args, options|
42
+ Cert.config = FastlaneCore::Configuration.create(Cert::Options.available_options, options.__hash__)
43
+ Cert::Runner.new.revoke_expired_certs!
44
+ end
45
+ end
46
+
37
47
  default_command :create
38
48
 
39
49
  run!
data/lib/cert/runner.rb CHANGED
@@ -12,15 +12,19 @@ module Cert
12
12
  return ENV["CER_FILE_PATH"]
13
13
  end
14
14
 
15
+ def login
16
+ UI.message "Starting login with user '#{Cert.config[:username]}'"
17
+ Spaceship.login(Cert.config[:username], nil)
18
+ Spaceship.select_team
19
+ UI.message "Successfully logged in"
20
+ end
21
+
15
22
  def run
16
23
  FileUtils.mkdir_p(Cert.config[:output_path])
17
24
 
18
25
  FastlaneCore::PrintTable.print_values(config: Cert.config, hide_keys: [:output_path], title: "Summary for cert #{Cert::VERSION}")
19
26
 
20
- UI.message "Starting login with user '#{Cert.config[:username]}'"
21
- Spaceship.login(Cert.config[:username], nil)
22
- Spaceship.select_team
23
- UI.message "Successfully logged in"
27
+ login
24
28
 
25
29
  should_create = Cert.config[:force]
26
30
  unless should_create
@@ -37,6 +41,41 @@ module Cert
37
41
  end
38
42
  end
39
43
 
44
+ # Command method for the :revoke_expired sub-command
45
+ def revoke_expired_certs!
46
+ FastlaneCore::PrintTable.print_values(config: Cert.config, hide_keys: [:output_path], title: "Summary for cert #{Cert::VERSION}")
47
+
48
+ login
49
+
50
+ to_revoke = expired_certs
51
+
52
+ if to_revoke.empty?
53
+ UI.success "No expired certificates were found to revoke! 👍"
54
+ return
55
+ end
56
+
57
+ revoke_count = 0
58
+
59
+ to_revoke.each do |certificate|
60
+ begin
61
+ UI.message "#{certificate.id} #{certificate.name} has expired, revoking..."
62
+ certificate.revoke!
63
+ revoke_count += 1
64
+ rescue => e
65
+ UI.error "An error occurred while revoking #{certificate.id} #{certificate.name}"
66
+ UI.error "#{e.message}\n#{e.backtrace.join("\n")}" if $verbose
67
+ end
68
+ end
69
+
70
+ UI.success "#{revoke_count} expired certificate#{'s' if revoke_count != 1} #{revoke_count == 1 ? 'has' : 'have'} been revoked! 👍"
71
+ end
72
+
73
+ def expired_certs
74
+ certificates.select do |certificate|
75
+ certificate.expires < Time.now.utc
76
+ end
77
+ end
78
+
40
79
  def find_existing_cert
41
80
  certificates.each do |certificate|
42
81
  unless certificate.can_download
data/lib/cert/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Cert
2
- VERSION = "1.3.0"
2
+ VERSION = "1.4.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cert
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-04 00:00:00.000000000 Z
11
+ date: 2016-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fastlane_core
@@ -36,7 +36,7 @@ dependencies:
36
36
  requirements:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
- version: 0.16.0
39
+ version: 0.22.0
40
40
  - - "<"
41
41
  - !ruby/object:Gem::Version
42
42
  version: 1.0.0
@@ -46,7 +46,7 @@ dependencies:
46
46
  requirements:
47
47
  - - ">="
48
48
  - !ruby/object:Gem::Version
49
- version: 0.16.0
49
+ version: 0.22.0
50
50
  - - "<"
51
51
  - !ruby/object:Gem::Version
52
52
  version: 1.0.0
@@ -212,7 +212,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
212
212
  version: '0'
213
213
  requirements: []
214
214
  rubyforge_project:
215
- rubygems_version: 2.4.0
215
+ rubygems_version: 2.4.5.1
216
216
  signing_key:
217
217
  specification_version: 4
218
218
  summary: Create new iOS code signing certificates