match 0.11.0 → 0.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/match.rb +7 -1
- data/lib/match/generator.rb +2 -1
- data/lib/match/options.rb +1 -0
- data/lib/match/runner.rb +4 -0
- data/lib/match/table_printer.rb +14 -0
- data/lib/match/utils.rb +30 -23
- data/lib/match/version.rb +1 -1
- metadata +11 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2a8fdcf766e8137661f1f80021efcbfe0d0b732
|
4
|
+
data.tar.gz: 4e7de3efa9546a4b011ab42c4309115233a06998
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1d23e83c8e0a137e33a54417a3354c34e58d8a8dc542b5a506911baec5457d45b965e827e105f7d1746ead73210428ed322217fa069fcc06a3d82cb400682b2
|
7
|
+
data.tar.gz: b4eab30e467fe8fc5574f754cf5816b5aeedfe59ef1f433864ea274e6f2b976fa75c4393a38cb99fa826b325e2a240da7dd5f838a900753b2a79f0f73d529caa
|
data/README.md
CHANGED
@@ -256,7 +256,7 @@ gym
|
|
256
256
|
|
257
257
|
##### Registering new devices
|
258
258
|
|
259
|
-
By using `match`, you'll save a lot of time every time you add new device to your Ad Hoc or Development profiles. Use `match` in combination with the [`register_devices`](https://
|
259
|
+
By using `match`, you'll save a lot of time every time you add new device to your Ad Hoc or Development profiles. Use `match` in combination with the [`register_devices`](https://docs.fastlane.tools/actions#register_devices) action.
|
260
260
|
|
261
261
|
```ruby
|
262
262
|
lane :beta do
|
data/lib/match.rb
CHANGED
@@ -28,7 +28,13 @@ module Match
|
|
28
28
|
|
29
29
|
# @return [Boolean] returns true if the unsupported enterprise mode should be enabled
|
30
30
|
def self.enterprise?
|
31
|
-
ENV["MATCH_FORCE_ENTERPRISE"]
|
31
|
+
force_enterprise = ENV["MATCH_FORCE_ENTERPRISE"]
|
32
|
+
|
33
|
+
return false if (force_enterprise.kind_of?(String) || force_enterprise.kind_of?(Numeric)) &&
|
34
|
+
(force_enterprise.to_s == "0")
|
35
|
+
return false if force_enterprise.kind_of?(String) &&
|
36
|
+
(force_enterprise == "" || force_enterprise.casecmp("false") == 0 || force_enterprise.casecmp("no") == 0)
|
37
|
+
return !!force_enterprise
|
32
38
|
end
|
33
39
|
|
34
40
|
# @return [Boolean] returns true if match should interpret the given [certificate|profile] type as an enterprise one
|
data/lib/match/generator.rb
CHANGED
@@ -10,7 +10,8 @@ module Match
|
|
10
10
|
output_path: output_path,
|
11
11
|
force: true, # we don't need a certificate without its private key, we only care about a new certificate
|
12
12
|
username: params[:username],
|
13
|
-
team_id: params[:team_id]
|
13
|
+
team_id: params[:team_id],
|
14
|
+
keychain_path: FastlaneCore::Helper.keychain_path(params[:keychain_name])
|
14
15
|
})
|
15
16
|
|
16
17
|
Cert.config = arguments
|
data/lib/match/options.rb
CHANGED
@@ -47,6 +47,7 @@ module Match
|
|
47
47
|
FastlaneCore::ConfigItem.new(key: :keychain_password,
|
48
48
|
short_option: "-p",
|
49
49
|
env_name: "MATCH_KEYCHAIN_PASSWORD",
|
50
|
+
sensitive: true,
|
50
51
|
description: "This might be required the first time you access certificates on a new mac. For the login/default keychain this is your account password",
|
51
52
|
optional: true),
|
52
53
|
FastlaneCore::ConfigItem.new(key: :readonly,
|
data/lib/match/runner.rb
CHANGED
@@ -85,6 +85,10 @@ module Match
|
|
85
85
|
# Import the private key
|
86
86
|
# there seems to be no good way to check if it's already installed - so just install it
|
87
87
|
Utils.import(keys.last, params[:keychain_name], password: params[:keychain_password])
|
88
|
+
|
89
|
+
# Get and print info of certificate
|
90
|
+
info = Utils.get_cert_info(cert_path)
|
91
|
+
TablePrinter.print_certificate_info(cert_info: info)
|
88
92
|
end
|
89
93
|
|
90
94
|
return File.basename(cert_path).gsub(".cer", "") # Certificate ID
|
data/lib/match/table_printer.rb
CHANGED
@@ -1,5 +1,19 @@
|
|
1
1
|
module Match
|
2
2
|
class TablePrinter
|
3
|
+
# logs public key's name, user, organisation, country, availability dates
|
4
|
+
def self.print_certificate_info(cert_info: nil)
|
5
|
+
params = {
|
6
|
+
rows: cert_info,
|
7
|
+
title: "Installed Certificate".green
|
8
|
+
}
|
9
|
+
|
10
|
+
puts ""
|
11
|
+
puts Terminal::Table.new(params)
|
12
|
+
puts ""
|
13
|
+
rescue => ex
|
14
|
+
UI.error(ex)
|
15
|
+
end
|
16
|
+
|
3
17
|
def self.print_summary(app_identifier: nil, type: nil)
|
4
18
|
rows = []
|
5
19
|
|
data/lib/match/utils.rb
CHANGED
@@ -1,29 +1,7 @@
|
|
1
1
|
module Match
|
2
2
|
class Utils
|
3
3
|
def self.import(item_path, keychain, password: "")
|
4
|
-
|
5
|
-
# in the user's home directory. However, this will not allow the user to pass an absolute path
|
6
|
-
# for the keychain value
|
7
|
-
#
|
8
|
-
# So, if the passed value can't be resolved as a file in Library/Keychains, just use it as-is
|
9
|
-
# as the keychain path.
|
10
|
-
#
|
11
|
-
# We need to expand each path because File.exist? won't handle directories including ~ properly
|
12
|
-
#
|
13
|
-
# We also try to append `-db` at the end of the file path, as with Sierra the default Keychain name
|
14
|
-
# has changed for some users: https://github.com/fastlane/fastlane/issues/5649
|
15
|
-
#
|
16
|
-
keychain_paths = [
|
17
|
-
File.join(Dir.home, 'Library', 'Keychains', keychain),
|
18
|
-
File.join(Dir.home, 'Library', 'Keychains', "#{keychain}-db"),
|
19
|
-
keychain,
|
20
|
-
"#{keychain}-db"
|
21
|
-
].map { |path| File.expand_path(path) }
|
22
|
-
|
23
|
-
keychain_path = keychain_paths.find { |path| File.exist?(path) }
|
24
|
-
|
25
|
-
UI.user_error!("Could not locate the provided keychain. Tried:\n\t#{keychain_paths.join("\n\t")}") unless keychain_path
|
26
|
-
|
4
|
+
keychain_path = FastlaneCore::Helper.keychain_path(keychain)
|
27
5
|
FastlaneCore::KeychainImporter.import_file(item_path, keychain_path, keychain_password: password, output: $verbose)
|
28
6
|
end
|
29
7
|
|
@@ -45,6 +23,35 @@ module Match
|
|
45
23
|
(base_environment_variable_name(app_identifier: app_identifier, type: type) + ["profile-name"]).join("_")
|
46
24
|
end
|
47
25
|
|
26
|
+
def self.get_cert_info(cer_certificate_path)
|
27
|
+
command = "openssl x509 -inform der -in #{cer_certificate_path.shellescape} -subject -dates -noout"
|
28
|
+
command << " &" # start in separate process
|
29
|
+
output = Helper.backticks(command, print: $verbose)
|
30
|
+
|
31
|
+
# openssl output:
|
32
|
+
# subject= /UID={User ID}/CN={Certificate Name}/OU={Certificate User}/O={Organisation}/C={Country}\n
|
33
|
+
# notBefore={Start datetime}\n
|
34
|
+
# notAfter={End datetime}
|
35
|
+
cert_info = output.gsub(/\s*subject=\s*/, "").tr("/", "\n")
|
36
|
+
out_array = cert_info.split("\n")
|
37
|
+
openssl_keys_to_readable_keys = {
|
38
|
+
'UID' => 'User ID',
|
39
|
+
'CN' => 'Common Name',
|
40
|
+
'OU' => 'Organisation Unit',
|
41
|
+
'O' => 'Organisation',
|
42
|
+
'C' => 'Country',
|
43
|
+
'notBefore' => 'Start Datetime',
|
44
|
+
'notAfter' => 'End Datetime'
|
45
|
+
}
|
46
|
+
|
47
|
+
return out_array.map { |x| x.split(/=+/) if x.include? "=" }
|
48
|
+
.compact
|
49
|
+
.map { |k, v| [openssl_keys_to_readable_keys.fetch(k, k), v] }
|
50
|
+
rescue => ex
|
51
|
+
UI.error(ex)
|
52
|
+
return {}
|
53
|
+
end
|
54
|
+
|
48
55
|
def self.base_environment_variable_name(app_identifier: nil, type: nil)
|
49
56
|
["sigh", app_identifier, type]
|
50
57
|
end
|
data/lib/match/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: match
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.1
|
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-
|
11
|
+
date: 2016-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: security
|
@@ -30,7 +30,7 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.58.0
|
34
34
|
- - "<"
|
35
35
|
- !ruby/object:Gem::Version
|
36
36
|
version: 1.0.0
|
@@ -40,7 +40,7 @@ dependencies:
|
|
40
40
|
requirements:
|
41
41
|
- - ">="
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: 0.
|
43
|
+
version: 0.58.0
|
44
44
|
- - "<"
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: 1.0.0
|
@@ -70,7 +70,7 @@ dependencies:
|
|
70
70
|
requirements:
|
71
71
|
- - ">="
|
72
72
|
- !ruby/object:Gem::Version
|
73
|
-
version: 0.
|
73
|
+
version: 0.38.5
|
74
74
|
- - "<"
|
75
75
|
- !ruby/object:Gem::Version
|
76
76
|
version: 1.0.0
|
@@ -80,7 +80,7 @@ dependencies:
|
|
80
80
|
requirements:
|
81
81
|
- - ">="
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
version: 0.
|
83
|
+
version: 0.38.5
|
84
84
|
- - "<"
|
85
85
|
- !ruby/object:Gem::Version
|
86
86
|
version: 1.0.0
|
@@ -90,7 +90,7 @@ dependencies:
|
|
90
90
|
requirements:
|
91
91
|
- - ">="
|
92
92
|
- !ruby/object:Gem::Version
|
93
|
-
version: 1.
|
93
|
+
version: 1.12.1
|
94
94
|
- - "<"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: 2.0.0
|
@@ -100,7 +100,7 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 1.
|
103
|
+
version: 1.12.1
|
104
104
|
- - "<"
|
105
105
|
- !ruby/object:Gem::Version
|
106
106
|
version: 2.0.0
|
@@ -110,7 +110,7 @@ dependencies:
|
|
110
110
|
requirements:
|
111
111
|
- - ">="
|
112
112
|
- !ruby/object:Gem::Version
|
113
|
-
version: 1.4.
|
113
|
+
version: 1.4.4
|
114
114
|
- - "<"
|
115
115
|
- !ruby/object:Gem::Version
|
116
116
|
version: 2.0.0
|
@@ -120,7 +120,7 @@ dependencies:
|
|
120
120
|
requirements:
|
121
121
|
- - ">="
|
122
122
|
- !ruby/object:Gem::Version
|
123
|
-
version: 1.4.
|
123
|
+
version: 1.4.4
|
124
124
|
- - "<"
|
125
125
|
- !ruby/object:Gem::Version
|
126
126
|
version: 2.0.0
|
@@ -311,7 +311,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
311
311
|
version: '0'
|
312
312
|
requirements: []
|
313
313
|
rubyforge_project:
|
314
|
-
rubygems_version: 2.
|
314
|
+
rubygems_version: 2.6.6
|
315
315
|
signing_key:
|
316
316
|
specification_version: 4
|
317
317
|
summary: Easily sync your certificates and profiles across your team using git
|