cocoapods-keys 1.7.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +7 -3
- data/SWIFT_PROJECTS.md +8 -2
- data/lib/cocoapods_keys.rb +1 -1
- data/lib/key_master.rb +1 -1
- data/lib/preinstaller.rb +4 -0
- data/spec/key_master_spec.rb +15 -0
- data/templates/Keys.h.erb +5 -1
- data/templates/Keys.m.erb +2 -0
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b01fd13b64082cf9a456e3375e5265921e5d146a
|
4
|
+
data.tar.gz: e46f5ad08f13973adf790f97683c3e1907018298
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0814c7e535af3237cc3d3aa7419056554c2e79029af71615c87d3b617aaa923c5ff0b04c9dac651169f692d68794323a45b059f009fbf1f0b9fee1026adab851
|
7
|
+
data.tar.gz: 60820ab391f39b05d571ffee200735bdc31fa6a97bcc4617322385122cb10af7524dc12618231b6196d4a752f5e0bfd07e1af33b2ebda8f3b35815088773f2bf
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
## Master
|
2
2
|
|
3
|
+
## 2.0.0
|
4
|
+
|
5
|
+
* Handles casing correctly in generated key names [breaking] [marcelofabri]
|
6
|
+
* Adds Nullability notations to default erb template [Skogetroll]
|
7
|
+
* Use properties for accessing key values instead of functions [breaking, for swift] [Skogetroll]
|
8
|
+
* Don't ask for keys on the command line when running on CI. [dantoml]
|
9
|
+
|
3
10
|
## 1.7.0
|
4
11
|
|
5
12
|
* Fixes undefined method '*' for nil:NilClass issue on first run [rpassis]
|
data/README.md
CHANGED
@@ -6,7 +6,7 @@ Its good security practice to keep production keys out of developer hands. Cocoa
|
|
6
6
|
|
7
7
|
## Requirements
|
8
8
|
|
9
|
-
Requires CocoaPods 0.36
|
9
|
+
Requires CocoaPods 0.36+
|
10
10
|
|
11
11
|
## Installation
|
12
12
|
|
@@ -22,7 +22,7 @@ The generated Objective-C classes are stored in the `Pods/CocoaPodsKeys` directo
|
|
22
22
|
|
23
23
|
Using the new Plugin API in CocoaPods we can automate a lot of the fiddly bits away. You define what keys you want inside your [Podfile](https://github.com/artsy/eidolon/blob/0a9f5947914eb637fd4abf364fa3532b56da3c52/Podfile#L6-L21) and Keys will detect what keys are not yet set. If you need to specify a different project name from the target name, use the key `:target` to specify it.
|
24
24
|
|
25
|
-
```
|
25
|
+
```ruby
|
26
26
|
plugin 'cocoapods-keys', {
|
27
27
|
:project => "Eidolon",
|
28
28
|
:keys => [
|
@@ -111,6 +111,10 @@ CocoaPods-keys has 3 other commands:
|
|
111
111
|
|
112
112
|
It's rarely a good idea to mess around with the keychain in your CI, so keys will look for an environment var with the same string before looking in the keychain. Also you could create a `.env` file in your project folder.
|
113
113
|
|
114
|
+
#### Maintainance State
|
115
|
+
|
116
|
+
CocoaPods Keys is effectively "done" software from Artsy's perspective. It has done everything we've needed for years. So, I wouldn't recommend making issues requesting new features, simply because we won't be building them ourselves. We'll definitely continue making sure it works etc though, we use it in production.
|
117
|
+
|
114
118
|
#### Security
|
115
119
|
|
116
120
|
Key security is difficult. Right now even the biggest apps get their keys [leaked](https://threatpost.com/twitter-oauth-api-keys-leaked-030713/77597). This is neatly summed up by John Adams of the Twitter Security Team on [Quora](http://www.quora.com/Twitter-1/How-were-the-Twitter-iPhone-and-Android-OAuth-keys-leaked).
|
@@ -125,4 +129,4 @@ So in summary, the ideal way to store keys is to not store keys. In reality thou
|
|
125
129
|
|
126
130
|
#### Thanks
|
127
131
|
|
128
|
-
This was built with a lot of help from [@segiddins](https://github.com/segiddins)
|
132
|
+
This was built with a lot of help from [@segiddins](https://github.com/segiddins), [@ashfurrow](http://github.com/ashfurrow) and [@marcelofabri](https://github.com/marcelofabri).
|
data/SWIFT_PROJECTS.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
# Using
|
1
|
+
# Using CocoaPods-Keys in Swift projects
|
2
2
|
|
3
|
-
Once you've followed the setup instructions described in the [Usage](
|
3
|
+
Once you've followed the setup instructions described in the [Usage](README.md#usage)
|
4
4
|
section of the README, you have two choices.
|
5
5
|
|
6
6
|
## Importing the framework
|
@@ -18,3 +18,9 @@ import Keys
|
|
18
18
|
let keys = MyApplicationKeys()
|
19
19
|
ARAnalytics.setupWithAnalytics(keys.analyticsToken)
|
20
20
|
```
|
21
|
+
|
22
|
+
### Troubleshooting
|
23
|
+
|
24
|
+
You can get into a situation where you have an existing integrated project but when you add a new key it isn't recognized in the file(s) you `import Keys` in, although your project is configured properly (you can check by verifying it's shown with a `pod keys` and/or manually viewing the generated `*.h/*.m` files).
|
25
|
+
|
26
|
+
The fix: clear out your Xcode's Derived Data finder folder and rebuilding should generate a proper swift class in the Keys module.
|
data/lib/cocoapods_keys.rb
CHANGED
data/lib/key_master.rb
CHANGED
data/lib/preinstaller.rb
CHANGED
@@ -42,6 +42,10 @@ module CocoaPodsKeys
|
|
42
42
|
# and prompt for their value if needed.
|
43
43
|
keys.each do |key|
|
44
44
|
unless keyring.keychain_has_key?(key)
|
45
|
+
if ENV['CI']
|
46
|
+
raise Informative, "CocoaPods-Keys could not find a key named: #{key}"
|
47
|
+
end
|
48
|
+
|
45
49
|
unless has_shown_intro
|
46
50
|
ui.puts "\n CocoaPods-Keys has detected a keys mismatch for your setup."
|
47
51
|
has_shown_intro = true
|
data/spec/key_master_spec.rb
CHANGED
@@ -34,11 +34,26 @@ describe CocoaPodsKeys::KeyMaster do
|
|
34
34
|
key_master = KeyMaster.new(keyring)
|
35
35
|
expect(key_master.name).to eq('_500pxKeys')
|
36
36
|
end
|
37
|
+
|
37
38
|
it 'takes keyring with proper name returns proper Keys file' do
|
38
39
|
keyring = Keyring.new('Artsy', '/', ['ARMyKey'])
|
39
40
|
keyring.instance_variable_set(:@keychain, FakeKeychain.new('ARMyKey' => 'secretkey'))
|
40
41
|
key_master = KeyMaster.new(keyring)
|
41
42
|
expect(key_master.name).to eq('ArtsyKeys')
|
42
43
|
end
|
44
|
+
|
45
|
+
it 'takes keyring with multiple words returns proper Keys file' do
|
46
|
+
keyring = Keyring.new('ArtsyExample', '/', ['ARMyKey'])
|
47
|
+
keyring.instance_variable_set(:@keychain, FakeKeychain.new('ARMyKey' => 'secretkey'))
|
48
|
+
key_master = KeyMaster.new(keyring)
|
49
|
+
expect(key_master.name).to eq('ArtsyExampleKeys')
|
50
|
+
end
|
51
|
+
|
52
|
+
it 'takes keyring with lowercase name returns proper Keys file' do
|
53
|
+
keyring = Keyring.new('artsy', '/', ['ARMyKey'])
|
54
|
+
keyring.instance_variable_set(:@keychain, FakeKeychain.new('ARMyKey' => 'secretkey'))
|
55
|
+
key_master = KeyMaster.new(keyring)
|
56
|
+
expect(key_master.name).to eq('ArtsyKeys')
|
57
|
+
end
|
43
58
|
end
|
44
59
|
end
|
data/templates/Keys.h.erb
CHANGED
@@ -6,8 +6,12 @@
|
|
6
6
|
|
7
7
|
#import <Foundation/NSString.h>
|
8
8
|
|
9
|
+
NS_ASSUME_NONNULL_BEGIN
|
10
|
+
|
9
11
|
@interface <%= @name %> : NSObject
|
10
12
|
<% @keys.each do |key, value| %>
|
11
|
-
|
13
|
+
@property (readonly) NSString *<%= key %>;<% end %>
|
12
14
|
|
13
15
|
@end
|
16
|
+
|
17
|
+
NS_ASSUME_NONNULL_END
|
data/templates/Keys.m.erb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-keys
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Orta Therox
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2017-01-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: osx_keychain
|
@@ -181,4 +181,3 @@ test_files:
|
|
181
181
|
- spec/keyring_spec.rb
|
182
182
|
- spec/plugin_spec.rb
|
183
183
|
- spec/spec_helper.rb
|
184
|
-
has_rdoc:
|