From 0a44148df6936c57f6691e24ea7497e975949438 Mon Sep 17 00:00:00 2001 From: Orta Therox Date: Fri, 4 Jan 2019 09:53:53 -0500 Subject: [PATCH 01/32] Prepare for release --- CHANGELOG.md | 2 ++ lib/cocoapods_keys.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b60e68..336a4cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## Master +## 2.0.7 + * Fix keys not recorded in YML on first run. [ileitch] ## 2.0.6 diff --git a/lib/cocoapods_keys.rb b/lib/cocoapods_keys.rb index 78c41a4..0171aac 100644 --- a/lib/cocoapods_keys.rb +++ b/lib/cocoapods_keys.rb @@ -1,3 +1,3 @@ module CocoaPodsKeys - VERSION = '2.0.6'.freeze + VERSION = '2.0.7'.freeze end From 850c9850d762b4b500ce8bfc72b8fe739a2586f2 Mon Sep 17 00:00:00 2001 From: Orta Therox Date: Fri, 4 Jan 2019 09:54:12 -0500 Subject: [PATCH 02/32] Lockfile --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 1afe4b0..20a4bab 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - cocoapods-keys (2.0.6) + cocoapods-keys (2.0.7) dotenv osx_keychain From 5b35ebade30aa1828c39efb966a834f769c04365 Mon Sep 17 00:00:00 2001 From: Frederik Wallner Date: Tue, 12 Feb 2019 08:45:16 +0100 Subject: [PATCH 03/32] Add fallback key option to generate command --- lib/pod/command/keys/generate.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/pod/command/keys/generate.rb b/lib/pod/command/keys/generate.rb index ed4cb73..a6d6141 100644 --- a/lib/pod/command/keys/generate.rb +++ b/lib/pod/command/keys/generate.rb @@ -16,14 +16,19 @@ class Generate < Keys self.arguments = [CLAide::Argument.new('project_name', false)] + def self.options + [['--keys=key1,key2...', 'An array of keys to add if no keyring is found']].concat(super) + end + def initialize(argv) @project_name = argv.shift_argument + @keys = argv.option('keys', '').split(',') super end def run Dotenv.load - keyring = get_current_keyring + keyring = get_current_keyring || CocoaPodsKeys::Keyring.new(@project_name, '/', @keys) if keyring From ef2057dbf601c43e664be9d29ce66c0b104f6c56 Mon Sep 17 00:00:00 2001 From: Frederik Wallner Date: Tue, 12 Feb 2019 08:45:57 +0100 Subject: [PATCH 04/32] Add changelog entry --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 336a4cf..808de46 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## Master +* Add the ability to manually specify keys when running `pod keys generate`. [fwal] + ## 2.0.7 * Fix keys not recorded in YML on first run. [ileitch] From 3a337b3fb19474bb6018abdf2f2323304aaf5e29 Mon Sep 17 00:00:00 2001 From: Orta Therox Date: Tue, 12 Feb 2019 09:18:19 -0500 Subject: [PATCH 05/32] Make release --- CHANGELOG.md | 2 ++ lib/cocoapods_keys.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 808de46..7c75b91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## Master +## 2.1.0 + * Add the ability to manually specify keys when running `pod keys generate`. [fwal] ## 2.0.7 diff --git a/lib/cocoapods_keys.rb b/lib/cocoapods_keys.rb index 0171aac..f3f9234 100644 --- a/lib/cocoapods_keys.rb +++ b/lib/cocoapods_keys.rb @@ -1,3 +1,3 @@ module CocoaPodsKeys - VERSION = '2.0.7'.freeze + VERSION = '2.1.0'.freeze end From bfdaa7be34457539a4cbcd74f907befd179fd4e7 Mon Sep 17 00:00:00 2001 From: Orta Therox Date: Tue, 12 Feb 2019 09:19:02 -0500 Subject: [PATCH 06/32] Update lockfile --- Gemfile.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 20a4bab..753a449 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - cocoapods-keys (2.0.7) + cocoapods-keys (2.1.0) dotenv osx_keychain @@ -11,7 +11,7 @@ GEM CFPropertyList (2.3.5) RubyInline (3.12.4) ZenTest (~> 4.3) - ZenTest (4.11.1) + ZenTest (4.11.2) activesupport (4.2.9) i18n (~> 0.7) minitest (~> 5.1) @@ -53,7 +53,7 @@ GEM colored (1.2) colored2 (3.1.2) diff-lcs (1.3) - dotenv (2.5.0) + dotenv (2.6.0) escape (0.0.4) fourflusher (0.3.2) fuzzy_match (2.0.4) @@ -116,4 +116,4 @@ DEPENDENCIES rubocop BUNDLED WITH - 1.16.3 + 1.16.4 From ad5bbfffff5fea24cd8880aeb542fde425fb7aa2 Mon Sep 17 00:00:00 2001 From: Ash Furrow Date: Wed, 25 Mar 2020 20:29:09 -0400 Subject: [PATCH 07/32] Updates to avoid inlined C functions. --- lib/key_master.rb | 2 +- templates/Keys.m.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/key_master.rb b/lib/key_master.rb index a2a88a2..2a8e331 100644 --- a/lib/key_master.rb +++ b/lib/key_master.rb @@ -84,7 +84,7 @@ def render_erb(erb_template) end def key_data_arrays - Hash[@indexed_keys.map { |key, value| [key, value.map { |i| name + "Data[#{i}]" }.join(', ')] }] + Hash[@indexed_keys.map { |key, value| [key, value.map { |i| "[" + name + "Data characterAtIndex:#{i}]" }.join(', ')] }] end end end diff --git a/templates/Keys.m.erb b/templates/Keys.m.erb index 763ae43..0e99c1e 100644 --- a/templates/Keys.m.erb +++ b/templates/Keys.m.erb @@ -48,7 +48,7 @@ static NSString *_podKeys<%= Digest::MD5.hexdigest(key) %>(<%= name %> *self, SE } <% end %> -static char <%= name %>Data[<%= @data_length %>] = "<%= @data.gsub('\\', '\\\\\\').gsub('"', '\\"') if @data %>"; +static NSString *<%= name %>Data = @"<%= @data.gsub('\\', '\\\\\\').gsub('"', '\\"') if @data %>"; - (NSString *)description { From a86bf86be65a8506b8c6213674cc2d6595792b2c Mon Sep 17 00:00:00 2001 From: Ash Furrow Date: Wed, 25 Mar 2020 20:45:14 -0400 Subject: [PATCH 08/32] Avoids a bunch of Objective-C runtime faffing. --- templates/Keys.m.erb | 54 +++++++++++++++++--------------------------- 1 file changed, 21 insertions(+), 33 deletions(-) diff --git a/templates/Keys.m.erb b/templates/Keys.m.erb index 0e99c1e..7bcda03 100644 --- a/templates/Keys.m.erb +++ b/templates/Keys.m.erb @@ -4,49 +4,37 @@ // For more information see https://github.com/orta/cocoapods-keys // -#import #import #import "<%= @name %>.h" -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wincomplete-implementation" +@interface <%= @name %> () -@implementation <%= @name %> -<% @keys.each do |key, value| %> - @dynamic <%= key %>;<% end %> +<% @keys.each do |key, value| %>@property (nonatomic, copy) NSString *<%= key %>; +<% end %> -#pragma clang diagnostic pop +@end -+ (BOOL)resolveInstanceMethod:(SEL)name -{ - NSString *key = NSStringFromSelector(name); - NSString * (*implementation)(<%= name %> *, SEL) = NULL; -<% @keys.each do |key, value| %> - if ([key isEqualToString:@"<%= key %>"]) { - implementation = _podKeys<%= Digest::MD5.hexdigest(key) %>; - } -<% end %> - if (!implementation) { - return [super resolveInstanceMethod:name]; - } +@implementation <%= @name %> - return class_addMethod([self class], name, (IMP)implementation, "@@:"); -} -<% @keys.each do |key, value| %> -static NSString *_podKeys<%= Digest::MD5.hexdigest(key) %>(<%= name %> *self, SEL _cmd) +- (instancetype)init { - <% if @indexed_keys.length > 0 %> - <% if @indexed_keys[key].length > 0 %> - char cString[<%= @indexed_keys[key].length + 1 %>] = { <%= key_data_arrays[key] %>, '\0' }; - <% else %> - char cString[1] = { '\0' }; + if (!(self = [super init])) { return nil; } + + <% @keys.each do |key, value| %> + char <%= key %>CString[<%= @indexed_keys[key].length + 1 %>] = { <%= key_data_arrays[key] %>, '\0' }; + _<%= key %> = <% if @indexed_keys.length > 0 %> + <% if @indexed_keys[key].length > 0 %> + [NSString stringWithCString:<%= key %>CString encoding:NSUTF8StringEncoding]; + <% else %> + @""; + <% end %> + <% else %> + @""; + <% end %> <% end %> - return [NSString stringWithCString:cString encoding:NSUTF8StringEncoding]; - <% else %> - return @""; - <% end %> + + return self; } -<% end %> static NSString *<%= name %>Data = @"<%= @data.gsub('\\', '\\\\\\').gsub('"', '\\"') if @data %>"; From 110536d7f57229c2febf8b1dccf96b23f228f9a4 Mon Sep 17 00:00:00 2001 From: Ash Furrow Date: Thu, 26 Mar 2020 11:27:43 -0400 Subject: [PATCH 09/32] Update lib/key_master.rb --- lib/key_master.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/key_master.rb b/lib/key_master.rb index 2a8e331..7087867 100644 --- a/lib/key_master.rb +++ b/lib/key_master.rb @@ -84,7 +84,7 @@ def render_erb(erb_template) end def key_data_arrays - Hash[@indexed_keys.map { |key, value| [key, value.map { |i| "[" + name + "Data characterAtIndex:#{i}]" }.join(', ')] }] + Hash[@indexed_keys.map { |key, value| [key, value.map { |i| '[' + name + "Data characterAtIndex:#{i}]" }.join(', ')] }] end end end From 4ed63506b986960be1d1eea00e06420f67f940e4 Mon Sep 17 00:00:00 2001 From: Orta Therox Date: Thu, 26 Mar 2020 14:24:57 -0400 Subject: [PATCH 10/32] Prepare for release --- CHANGELOG.md | 4 ++++ lib/cocoapods_keys.rb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c75b91..9e166f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## Master +## 2.2.0 + +* Revised template which doesn't allow for secrets to appear in the binaries in modern Xcode builds. [ashfurrow] + ## 2.1.0 * Add the ability to manually specify keys when running `pod keys generate`. [fwal] diff --git a/lib/cocoapods_keys.rb b/lib/cocoapods_keys.rb index f3f9234..bac3a6b 100644 --- a/lib/cocoapods_keys.rb +++ b/lib/cocoapods_keys.rb @@ -1,3 +1,3 @@ module CocoaPodsKeys - VERSION = '2.1.0'.freeze + VERSION = '2.2.0'.freeze end From 841ac9a04e81333e2fca69a3eb22a172162756b7 Mon Sep 17 00:00:00 2001 From: Roger Oba Date: Thu, 2 Jul 2020 15:37:43 -0300 Subject: [PATCH 11/32] Fix Keys.m generation when there are empty-string keys. --- templates/Keys.m.erb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/templates/Keys.m.erb b/templates/Keys.m.erb index 7bcda03..f5ade22 100644 --- a/templates/Keys.m.erb +++ b/templates/Keys.m.erb @@ -21,7 +21,11 @@ if (!(self = [super init])) { return nil; } <% @keys.each do |key, value| %> - char <%= key %>CString[<%= @indexed_keys[key].length + 1 %>] = { <%= key_data_arrays[key] %>, '\0' }; + <% if @indexed_keys[key].length > 0 %> + char <%= key %>CString[<%= @indexed_keys[key].length + 1 %>] = { <%= key_data_arrays[key] %>, '\0' }; + <% else %> + char <%= key %>CString[<%= @indexed_keys[key].length + 1 %>] = { '\0' }; + <% end %> _<%= key %> = <% if @indexed_keys.length > 0 %> <% if @indexed_keys[key].length > 0 %> [NSString stringWithCString:<%= key %>CString encoding:NSUTF8StringEncoding]; @@ -32,7 +36,7 @@ @""; <% end %> <% end %> - + return self; } From ac35e319c7f57ebb2bd7386643cb6cda8ff795a2 Mon Sep 17 00:00:00 2001 From: Roger Oba Date: Thu, 2 Jul 2020 15:40:27 -0300 Subject: [PATCH 12/32] Release v2.2.1 --- CHANGELOG.md | 4 ++++ lib/cocoapods_keys.rb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e166f4..9418dd2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## Master +## 2.2.1 + +* Fixed Keys.m generation when there are empty-string keys. [rogerluan] + ## 2.2.0 * Revised template which doesn't allow for secrets to appear in the binaries in modern Xcode builds. [ashfurrow] diff --git a/lib/cocoapods_keys.rb b/lib/cocoapods_keys.rb index bac3a6b..aadb484 100644 --- a/lib/cocoapods_keys.rb +++ b/lib/cocoapods_keys.rb @@ -1,3 +1,3 @@ module CocoaPodsKeys - VERSION = '2.2.0'.freeze + VERSION = '2.2.1'.freeze end From 01c8d686a81625760582c2eea4a8fdfedaf21cba Mon Sep 17 00:00:00 2001 From: Ash Furrow Date: Fri, 3 Jul 2020 18:48:33 -0400 Subject: [PATCH 13/32] Ignores gem files. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index de301ca..b115128 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ spec/fixtures/dump-key vendor install .bundle +*.gem From 3ffd19c0cd7b82594c653d4966a2a8efaadf9cd1 Mon Sep 17 00:00:00 2001 From: Ash Furrow Date: Fri, 3 Jul 2020 18:49:53 -0400 Subject: [PATCH 14/32] Fixes link URL. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d9e2783..354bc7e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![Build Status](https://travis-ci.org/orta/cocoapods-keys.svg) +[![Build Status](https://travis-ci.org/orta/cocoapods-keys.svg?branch=master)](https://travis-ci.org/orta/cocoapods-keys) A key value store for enviroment and application keys. From 136529b9e08d1608d9b5fca157dc66fe606db96a Mon Sep 17 00:00:00 2001 From: Ash Furrow Date: Fri, 3 Jul 2020 18:50:20 -0400 Subject: [PATCH 15/32] Updates bundle. --- Gemfile.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 753a449..84bc1a7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - cocoapods-keys (2.1.0) + cocoapods-keys (2.2.1) dotenv osx_keychain @@ -9,9 +9,9 @@ GEM remote: https://rubygems.org/ specs: CFPropertyList (2.3.5) - RubyInline (3.12.4) + RubyInline (3.12.5) ZenTest (~> 4.3) - ZenTest (4.11.2) + ZenTest (4.12.0) activesupport (4.2.9) i18n (~> 0.7) minitest (~> 5.1) @@ -53,7 +53,7 @@ GEM colored (1.2) colored2 (3.1.2) diff-lcs (1.3) - dotenv (2.6.0) + dotenv (2.7.5) escape (0.0.4) fourflusher (0.3.2) fuzzy_match (2.0.4) @@ -116,4 +116,4 @@ DEPENDENCIES rubocop BUNDLED WITH - 1.16.4 + 1.17.3 From a7e4b87c5473a25fbaff0ef562b80f9f6457aa10 Mon Sep 17 00:00:00 2001 From: Ernest Chechelski Date: Wed, 26 May 2021 12:06:51 +0200 Subject: [PATCH 16/32] Update README.md Explicit warning to not use underscore in the keys. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 354bc7e..7ba0d17 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,8 @@ plugin 'cocoapods-keys', { ... ]} ``` +> Please do not use underscores in the key names ([Reason why here in this issue #197](https://github.com/orta/cocoapods-keys/issues/197)). +
For example convert any key like this `WRONG_DEFINED_KEY` to `CorrectlyDefinedKey`. Then running `pod install` will prompt for the keys not yet set and you can ensure everyone has the same setup. From c594de3a95ea10753941a3d09f580e4e827a8ae4 Mon Sep 17 00:00:00 2001 From: Ernest Chechelski Date: Wed, 26 May 2021 12:07:40 +0200 Subject: [PATCH 17/32] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7ba0d17..e91b874 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ plugin 'cocoapods-keys', { ... ]} ``` -> Please do not use underscores in the key names ([Reason why here in this issue #197](https://github.com/orta/cocoapods-keys/issues/197)). +> Please do not use underscores in key names ([Reason why here in this issue #197](https://github.com/orta/cocoapods-keys/issues/197)).
For example convert any key like this `WRONG_DEFINED_KEY` to `CorrectlyDefinedKey`. Then running `pod install` will prompt for the keys not yet set and you can ensure everyone has the same setup. From 2a907403d19092bc2849766f70f4efabd9ec458a Mon Sep 17 00:00:00 2001 From: Ernest Chechelski Date: Wed, 26 May 2021 12:09:35 +0200 Subject: [PATCH 18/32] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e91b874..5e23f62 100644 --- a/README.md +++ b/README.md @@ -34,8 +34,8 @@ plugin 'cocoapods-keys', { ... ]} ``` -> Please do not use underscores in key names ([Reason why here in this issue #197](https://github.com/orta/cocoapods-keys/issues/197)). -
For example convert any key like this `WRONG_DEFINED_KEY` to `CorrectlyDefinedKey`. +> Please do not use dash in key names ([Reason why here in this issue #197](https://github.com/orta/cocoapods-keys/issues/197)). +
For example convert any key like this `WRONG-DEFINED-KEY` to `CorrectlyDefinedKey`. Then running `pod install` will prompt for the keys not yet set and you can ensure everyone has the same setup. From 8c4604e76ed97413a9623f7fa3e71260a5ffbc5d Mon Sep 17 00:00:00 2001 From: Ernest Chechelski Date: Wed, 26 May 2021 12:10:09 +0200 Subject: [PATCH 19/32] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5e23f62..6a8b272 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ plugin 'cocoapods-keys', { ]} ``` > Please do not use dash in key names ([Reason why here in this issue #197](https://github.com/orta/cocoapods-keys/issues/197)). -
For example convert any key like this `WRONG-DEFINED-KEY` to `CorrectlyDefinedKey`. +
For example convert any key like this `WRONGLY-DEFINED-KEY` to `CorrectlyDefinedKey`. Then running `pod install` will prompt for the keys not yet set and you can ensure everyone has the same setup. From 4a914e84e8008fd1912e8d0f2819232180d77fc6 Mon Sep 17 00:00:00 2001 From: Ash Furrow Date: Wed, 26 May 2021 12:02:25 -0300 Subject: [PATCH 20/32] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6a8b272..fc19692 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,8 @@ plugin 'cocoapods-keys', { ]} ``` > Please do not use dash in key names ([Reason why here in this issue #197](https://github.com/orta/cocoapods-keys/issues/197)). -
For example convert any key like this `WRONGLY-DEFINED-KEY` to `CorrectlyDefinedKey`. +> +> For example convert any key like this `WRONGLY-DEFINED-KEY` to `CorrectlyDefinedKey`. Then running `pod install` will prompt for the keys not yet set and you can ensure everyone has the same setup. From 22f2a1bd1b3b7713323bc25dca55bc47d68b69df Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Apr 2022 22:21:06 +0000 Subject: [PATCH 21/32] Bump cocoapods-downloader from 1.1.3 to 1.6.3 Bumps [cocoapods-downloader](https://github.com/CocoaPods/cocoapods-downloader) from 1.1.3 to 1.6.3. - [Release notes](https://github.com/CocoaPods/cocoapods-downloader/releases) - [Changelog](https://github.com/CocoaPods/cocoapods-downloader/blob/master/CHANGELOG.md) - [Commits](https://github.com/CocoaPods/cocoapods-downloader/compare/1.1.3...1.6.3) --- updated-dependencies: - dependency-name: cocoapods-downloader dependency-type: indirect ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 84bc1a7..7557b49 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -41,7 +41,7 @@ GEM fuzzy_match (~> 2.0.4) nap (~> 1.0) cocoapods-deintegrate (1.0.1) - cocoapods-downloader (1.1.3) + cocoapods-downloader (1.6.3) cocoapods-plugins (1.0.0) nap cocoapods-search (1.0.0) From cbc635bd93d1adcebbef744b90b75381ff570331 Mon Sep 17 00:00:00 2001 From: Orta Therox Date: Mon, 4 Jul 2022 06:53:38 +0100 Subject: [PATCH 22/32] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index fc19692..dfca9cc 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,10 @@ A key value store for enviroment and application keys. Its good security practice to keep production keys out of developer hands. CocoaPods-keys makes it easy to have per-user config settings stored securely in the developer's keychain, and not in the application source. It is a plugin that once installed will run on every `pod install` or `pod update`. +## Alternatives + +CocoaPods Keys has had a great run since its creation in 2014, and still works perfectly fine today. If you're interested in a fresh re-think of the concept, check out https://github.com/rogerluan/arkana + ## Requirements Requires CocoaPods 0.36+ From 0bd3130b34032d5bfeaba807273b8a213f8674eb Mon Sep 17 00:00:00 2001 From: Wataru Nagasawa Date: Fri, 4 Nov 2022 11:07:42 +0900 Subject: [PATCH 23/32] Use keyword argument like ERB.new(str, trim_mode: ...) instead --- lib/key_master.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/key_master.rb b/lib/key_master.rb index 7087867..063f4f8 100644 --- a/lib/key_master.rb +++ b/lib/key_master.rb @@ -80,7 +80,7 @@ def verify_keychain_integrity def render_erb(erb_template) erb = (Pathname(__dir__).parent + 'templates' + erb_template).read - ERB.new(erb, nil, '-').result(binding) + ERB.new(erb, trim_mode: '-').result(binding) end def key_data_arrays From 0700310000a1931fc449366f4b100c4097643a09 Mon Sep 17 00:00:00 2001 From: Thom Ritterfeld Date: Sat, 3 Dec 2022 07:48:58 +0100 Subject: [PATCH 24/32] Update dependencies --- Gemfile | 5 +- Gemfile.lock | 204 ++++++++++++++++++++++++----------------- cocoapods_keys.gemspec | 6 +- spec/fixtures/Podfile | 2 +- 4 files changed, 128 insertions(+), 89 deletions(-) diff --git a/Gemfile b/Gemfile index 680e915..bc348ea 100644 --- a/Gemfile +++ b/Gemfile @@ -3,5 +3,6 @@ source 'https://rubygems.org' # Specify your gem's dependencies in cocoapods-keys.gemspec gemspec -gem 'cocoapods', '1.0.0.beta.6' -gem 'activesupport', '< 5' \ No newline at end of file +gem 'cocoapods', '>= 1.11' +gem 'activesupport', '>= 5' +gem 'ruby-keychain', :require => 'keychain' \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index 7557b49..665e239 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -3,117 +3,155 @@ PATH specs: cocoapods-keys (2.2.1) dotenv - osx_keychain + keychain GEM remote: https://rubygems.org/ specs: - CFPropertyList (2.3.5) - RubyInline (3.12.5) - ZenTest (~> 4.3) - ZenTest (4.12.0) - activesupport (4.2.9) - i18n (~> 0.7) - minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) - tzinfo (~> 1.1) - ast (2.3.0) - claide (1.0.2) - cocoapods (1.0.0.beta.6) - activesupport (>= 4.0.2) - claide (>= 1.0.0.beta.3, < 2.0) - cocoapods-core (= 1.0.0.beta.6) - cocoapods-deintegrate (>= 1.0.0.beta.1, < 2.0) - cocoapods-downloader (>= 1.0.0.beta.2, < 2.0) - cocoapods-plugins (>= 1.0.0.beta.1, < 2.0) - cocoapods-search (>= 1.0.0.beta.1, < 2.0) - cocoapods-stats (>= 1.0.0.beta.3, < 2.0) - cocoapods-trunk (>= 1.0.0.beta.2, < 2.0) - cocoapods-try (>= 1.0.0.beta.3, < 2.0) - colored (~> 1.2) + CFPropertyList (3.0.5) + rexml + activesupport (6.1.7) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + zeitwerk (~> 2.3) + addressable (2.8.1) + public_suffix (>= 2.0.2, < 6.0) + algoliasearch (1.27.5) + httpclient (~> 2.8, >= 2.8.3) + json (>= 1.5.1) + ast (2.4.2) + atomos (0.1.3) + claide (1.1.0) + cocoapods (1.11.3) + addressable (~> 2.8) + claide (>= 1.0.2, < 2.0) + cocoapods-core (= 1.11.3) + cocoapods-deintegrate (>= 1.0.3, < 2.0) + cocoapods-downloader (>= 1.4.0, < 2.0) + cocoapods-plugins (>= 1.0.0, < 2.0) + cocoapods-search (>= 1.0.0, < 2.0) + cocoapods-trunk (>= 1.4.0, < 2.0) + cocoapods-try (>= 1.1.0, < 2.0) + colored2 (~> 3.1) escape (~> 0.0.4) - fourflusher (~> 0.3.0) - molinillo (~> 0.4.4) + fourflusher (>= 2.3.0, < 3.0) + gh_inspector (~> 1.0) + molinillo (~> 0.8.0) nap (~> 1.0) - xcodeproj (>= 1.0.0.beta.3, < 2.0) - cocoapods-core (1.0.0.beta.6) - activesupport (>= 4.0.2) + ruby-macho (>= 1.0, < 3.0) + xcodeproj (>= 1.21.0, < 2.0) + cocoapods-core (1.11.3) + activesupport (>= 5.0, < 7) + addressable (~> 2.8) + algoliasearch (~> 1.0) + concurrent-ruby (~> 1.1) fuzzy_match (~> 2.0.4) nap (~> 1.0) - cocoapods-deintegrate (1.0.1) + netrc (~> 0.11) + public_suffix (~> 4.0) + typhoeus (~> 1.0) + cocoapods-deintegrate (1.0.5) cocoapods-downloader (1.6.3) cocoapods-plugins (1.0.0) nap - cocoapods-search (1.0.0) - cocoapods-stats (1.0.0) - cocoapods-trunk (1.2.0) + cocoapods-search (1.0.1) + cocoapods-trunk (1.6.0) nap (>= 0.8, < 2.0) - netrc (= 0.7.8) - cocoapods-try (1.1.0) - colored (1.2) + netrc (~> 0.11) + cocoapods-try (1.2.0) colored2 (3.1.2) - diff-lcs (1.3) - dotenv (2.7.5) + concurrent-ruby (1.1.10) + crypt (2.2.1) + diff-lcs (1.5.0) + dotenv (2.8.1) escape (0.0.4) - fourflusher (0.3.2) + ethon (0.16.0) + ffi (>= 1.15.0) + ffi (1.15.5) + fourflusher (2.3.1) fuzzy_match (2.0.4) - i18n (0.8.4) - minitest (5.10.2) - molinillo (0.4.5) - nanaimo (0.2.3) + gh_inspector (1.1.3) + highline (2.0.3) + httpclient (2.8.3) + i18n (1.12.0) + concurrent-ruby (~> 1.0) + json (2.6.2) + keychain (0.2.3) + crypt (>= 1.1.4) + highline (>= 1.4.0) + minitest (5.16.3) + molinillo (0.8.0) + nanaimo (0.3.0) nap (1.1.0) - netrc (0.7.8) - osx_keychain (1.0.2) - RubyInline (~> 3) - parallel (1.11.2) - parser (2.4.0.0) - ast (~> 2.2) - powerpack (0.1.1) - rainbow (2.2.2) - rake - rake (12.0.0) - rspec (3.6.0) - rspec-core (~> 3.6.0) - rspec-expectations (~> 3.6.0) - rspec-mocks (~> 3.6.0) - rspec-core (3.6.0) - rspec-support (~> 3.6.0) - rspec-expectations (3.6.0) + netrc (0.11.0) + og-corefoundation (0.2.3) + ffi + parallel (1.22.1) + parser (3.1.3.0) + ast (~> 2.4.1) + public_suffix (4.0.7) + rainbow (3.1.1) + rake (13.0.6) + regexp_parser (2.6.1) + rexml (3.2.5) + rspec (3.12.0) + rspec-core (~> 3.12.0) + rspec-expectations (~> 3.12.0) + rspec-mocks (~> 3.12.0) + rspec-core (3.12.0) + rspec-support (~> 3.12.0) + rspec-expectations (3.12.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.6.0) - rspec-mocks (3.6.0) + rspec-support (~> 3.12.0) + rspec-mocks (3.12.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.6.0) - rspec-support (3.6.0) - rubocop (0.49.1) + rspec-support (~> 3.12.0) + rspec-support (3.12.0) + rubocop (1.39.0) + json (~> 2.3) parallel (~> 1.10) - parser (>= 2.3.3.1, < 3.0) - powerpack (~> 0.1) - rainbow (>= 1.99.1, < 3.0) + parser (>= 3.1.2.1) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.23.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (~> 1.0, >= 1.0.1) - ruby-progressbar (1.8.1) - thread_safe (0.3.6) - tzinfo (1.2.3) - thread_safe (~> 0.1) - unicode-display_width (1.3.0) - xcodeproj (1.5.0) - CFPropertyList (~> 2.3.3) + unicode-display_width (>= 1.4.0, < 3.0) + rubocop-ast (1.24.0) + parser (>= 3.1.1.0) + ruby-keychain (0.4.0) + ffi + og-corefoundation (~> 0.2.0) + ruby-macho (2.5.1) + ruby-progressbar (1.11.0) + typhoeus (1.4.0) + ethon (>= 0.9.0) + tzinfo (2.0.5) + concurrent-ruby (~> 1.0) + unicode-display_width (2.3.0) + xcodeproj (1.22.0) + CFPropertyList (>= 2.3.3, < 4.0) + atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) colored2 (~> 3.1) - nanaimo (~> 0.2.3) + nanaimo (~> 0.3.0) + rexml (~> 3.2.4) + zeitwerk (2.6.6) PLATFORMS - ruby + arm64-darwin-22 DEPENDENCIES - activesupport (< 5) - bundler (~> 1.3) - cocoapods (= 1.0.0.beta.6) + activesupport (>= 5) + bundler (~> 2.3) + cocoapods (>= 1.11) cocoapods-keys! rake rspec - rubocop + rubocop (> 1.38) + ruby-keychain BUNDLED WITH - 1.17.3 + 2.3.26 diff --git a/cocoapods_keys.gemspec b/cocoapods_keys.gemspec index f3bf6c0..2317f6e 100644 --- a/cocoapods_keys.gemspec +++ b/cocoapods_keys.gemspec @@ -18,12 +18,12 @@ Gem::Specification.new do |spec| spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] - spec.add_runtime_dependency "osx_keychain" + spec.add_runtime_dependency "keychain" spec.add_runtime_dependency "dotenv" # spec.add_runtime_dependency "cocoapods", "> 1" - spec.add_development_dependency "bundler", "~> 1.3" + spec.add_development_dependency "bundler", "~> 2.3" spec.add_development_dependency "rake" spec.add_development_dependency "rspec" - spec.add_development_dependency "rubocop" + spec.add_development_dependency "rubocop", "> 1.38" end diff --git a/spec/fixtures/Podfile b/spec/fixtures/Podfile index d969a3c..2e81977 100644 --- a/spec/fixtures/Podfile +++ b/spec/fixtures/Podfile @@ -4,5 +4,5 @@ plugin 'cocoapods-keys', { :keys => [ 'KeyWithData', 'KeyWithoutData', - ] + ], } From 38ff89ca94465889016cabed775549e90b6fdd4d Mon Sep 17 00:00:00 2001 From: Thom Ritterfeld Date: Sat, 3 Dec 2022 07:49:57 +0100 Subject: [PATCH 25/32] Replaced osx_keychain with ruby-keychain gem --- lib/keyring.rb | 16 ++++++++++++---- spec/keyring_spec.rb | 2 +- spec/spec_helper.rb | 14 ++++++++++++-- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/lib/keyring.rb b/lib/keyring.rb index 24baea5..ee9f065 100644 --- a/lib/keyring.rb +++ b/lib/keyring.rb @@ -1,4 +1,6 @@ -require 'osx_keychain' +require 'keychain' +require 'base64' +require 'json' module CocoaPodsKeys class Keyring @@ -27,11 +29,17 @@ def self.keychain_prefix end def keychain - @keychain ||= OSXKeychain.new + @keychain ||= Keychain.generic_passwords end def save(key, value) - keychain[self.class.keychain_prefix + name, key] = value + item = keychain.where(service: self.class.keychain_prefix + name, account: key).first + if item + item.password = value + item.save! + else + keychain_has_keykeychain.create(service: self.class.keychain_prefix + name, password: value, account: key) + end end def keychain_data @@ -53,7 +61,7 @@ def keychain_has_key?(key) end def keychain_value(key) - ENV[key] || keychain[self.class.keychain_prefix + name, key] + ENV[key] || keychain.where(service: self.class.keychain_prefix + name, account: key).first.password end def camel_cased_keys diff --git a/spec/keyring_spec.rb b/spec/keyring_spec.rb index dfc067e..57ebc0e 100644 --- a/spec/keyring_spec.rb +++ b/spec/keyring_spec.rb @@ -17,7 +17,7 @@ expect(keyring.keychain_data).to eq('ARMyKey' => 'Hello') end - it 'looks up keys from the OSXKeychain' do + it 'looks up keys from Keychain Access' do keyring = Keyring.new('test', '/', ['ARMyKey']) keyring.instance_variable_set(:@keychain, FakeKeychain.new('KeychainKey' => 'abcde')) expect(keyring.keychain_has_key?('KeychainKey')).to be_truthy diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 108ee3d..c6d1152 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -16,12 +16,22 @@ def fixture(name) c.color = true end +class FakeKeychainItem + attr_accessor :password + + def initialize(password) + @password = password + end +end + class FakeKeychain def initialize(data) @data = data end - def [](_, key) - @data[key] + def where(conditions) + password = @data[conditions[:account]] + item = FakeKeychainItem.new(password) + [item] end end From 7499696f58356836cceb13b60d854c00a1a2d311 Mon Sep 17 00:00:00 2001 From: Thom Ritterfeld Date: Sat, 3 Dec 2022 07:50:17 +0100 Subject: [PATCH 26/32] Updated rubcop and build commands --- .rubocop.yml | 2 +- .rubocop_cocoapods.yml | 39 ++++++++++++++++++++++----------------- .rubocop_todo.yml | 4 ++-- .travis.yml | 2 +- 4 files changed, 26 insertions(+), 21 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 9220fbe..d3163ee 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -4,7 +4,7 @@ inherit_from: #- cocoapods-keys ------------------------------------------------------------- -Style/FileName: +Naming/FileName: Exclude: - bin/* - Rakefile diff --git a/.rubocop_cocoapods.yml b/.rubocop_cocoapods.yml index 3deb027..c5eb65f 100644 --- a/.rubocop_cocoapods.yml +++ b/.rubocop_cocoapods.yml @@ -1,4 +1,6 @@ AllCops: + NewCops: enable + SuggestExtensions: false Include: - ./Rakefile - ./Gemfile @@ -8,44 +10,47 @@ AllCops: # At the moment not ready to be used # https://github.com/bbatsov/rubocop/issues/947 -Documentation: +Style/Documentation: Enabled: false #- CocoaPods -----------------------------------------------------------------# # We adopted raise instead of fail. -SignalException: +Style/SignalException: EnforcedStyle: only_raise # They are idiomatic -AssignmentInCondition: +Lint/AssignmentInCondition: Enabled: false # Allow backticks -AsciiComments: +Style/AsciiComments: Enabled: false # Indentation clarifies logic branches in implementations -IfUnlessModifier: +Style/IfUnlessModifier: Enabled: false # No enforced convention here. -SingleLineBlockParams: +Style/SingleLineBlockParams: Enabled: false # We only add the comment when needed. -Encoding: +Style/Encoding: + Enabled: false + +Style/FrozenStringLiteralComment: Enabled: false Layout/MultilineOperationIndentation: EnforcedStyle: indented # Clashes with CLAide Command#validate! -GuardClause: +Style/GuardClause: Enabled: false # Not always desirable: lib/claide/command/plugins_helper.rb:12:15 -Next: +Style/Next: Enabled: false # Arbitrary max lengths for classes simply do not work and enabling this will @@ -74,16 +79,16 @@ Metrics/CyclomaticComplexity: #- CocoaPods support for Ruby 1.8.7 ------------------------------------------# -HashSyntax: +Style/HashSyntax: EnforcedStyle: hash_rockets -Lambda: +Style/Lambda: Enabled: false -DotPosition: +Layout/DotPosition: EnforcedStyle: trailing -EachWithObject: +Style/EachWithObject: Enabled: false Style/SpecialGlobalVars: @@ -92,20 +97,20 @@ Style/SpecialGlobalVars: #- CocoaPods specs -----------------------------------------------------------# # Allow for `should.match /regexp/`. -AmbiguousRegexpLiteral: +Lint/AmbiguousRegexpLiteral: Exclude: - spec/**/* # Allow `object.should == object` syntax. -Void: +Lint/Void: Exclude: - spec/**/* -ClassAndModuleChildren: +Style/ClassAndModuleChildren: Exclude: - spec/**/* -UselessComparison: +Lint/BinaryOperatorWithIdenticalOperands: Exclude: - spec/**/* diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 3e45176..8308a4b 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -23,7 +23,7 @@ Lint/Void: # Offense count: 38 # Configuration parameters: AllowURI, URISchemes. -Metrics/LineLength: +Layout/LineLength: Max: 173 # Offense count: 1 @@ -31,7 +31,7 @@ Metrics/PerceivedComplexity: Max: 9 # Offense count: 4 -Style/AccessorMethodName: +Naming/AccessorMethodName: Enabled: false # Offense count: 1 diff --git a/.travis.yml b/.travis.yml index 618eeb1..ee9a775 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,3 @@ language: objective-c -install: bundle install --deployment +install: bundle install script: bundle exec rake spec From ab4ec9ab52ae9d3eaf33e9daba9166e319703381 Mon Sep 17 00:00:00 2001 From: Thom Ritterfeld Date: Mon, 5 Dec 2022 20:25:32 +0100 Subject: [PATCH 27/32] Update dependency --- cocoapods_keys.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocoapods_keys.gemspec b/cocoapods_keys.gemspec index 2317f6e..5d47de8 100644 --- a/cocoapods_keys.gemspec +++ b/cocoapods_keys.gemspec @@ -18,7 +18,7 @@ Gem::Specification.new do |spec| spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] - spec.add_runtime_dependency "keychain" + spec.add_runtime_dependency "ruby-keychain" spec.add_runtime_dependency "dotenv" # spec.add_runtime_dependency "cocoapods", "> 1" From 9f89cf6a7ee0e0faf4fa884f64c5efc361a13a01 Mon Sep 17 00:00:00 2001 From: orta Date: Tue, 6 Dec 2022 06:41:59 +0000 Subject: [PATCH 28/32] Package --- CHANGELOG.md | 4 ++++ lib/cocoapods_keys.rb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9418dd2..9aeb073 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## Master +## 2.3.0 + +* Switched dependencies for the keychain, should fix m-class OS issues . [tritter] + ## 2.2.1 * Fixed Keys.m generation when there are empty-string keys. [rogerluan] diff --git a/lib/cocoapods_keys.rb b/lib/cocoapods_keys.rb index aadb484..b266d46 100644 --- a/lib/cocoapods_keys.rb +++ b/lib/cocoapods_keys.rb @@ -1,3 +1,3 @@ module CocoaPodsKeys - VERSION = '2.2.1'.freeze + VERSION = '2.3.0'.freeze end From 19f3ef4cbf52daee8e3d498ccda58ddf30a11cc4 Mon Sep 17 00:00:00 2001 From: Thom Ritterfeld Date: Tue, 6 Dec 2022 08:01:45 +0100 Subject: [PATCH 29/32] Fixes getting nil keychain item --- lib/keyring.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/keyring.rb b/lib/keyring.rb index ee9f065..e6ae91f 100644 --- a/lib/keyring.rb +++ b/lib/keyring.rb @@ -61,7 +61,8 @@ def keychain_has_key?(key) end def keychain_value(key) - ENV[key] || keychain.where(service: self.class.keychain_prefix + name, account: key).first.password + item = keychain.where(service: self.class.keychain_prefix + name, account: key).first + ENV[key] || item&.password end def camel_cased_keys From 2cb8a294cc5ec965eb66410821af18c00b2e7c84 Mon Sep 17 00:00:00 2001 From: Thom Ritterfeld Date: Tue, 6 Dec 2022 08:08:46 +0100 Subject: [PATCH 30/32] Fixes keychain setter --- lib/keyring.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/keyring.rb b/lib/keyring.rb index e6ae91f..7244849 100644 --- a/lib/keyring.rb +++ b/lib/keyring.rb @@ -38,7 +38,7 @@ def save(key, value) item.password = value item.save! else - keychain_has_keykeychain.create(service: self.class.keychain_prefix + name, password: value, account: key) + keychain.create(service: self.class.keychain_prefix + name, password: value, account: key) end end From f1935014168dbdb52f49860630baddd044af8980 Mon Sep 17 00:00:00 2001 From: Thom Ritterfeld Date: Tue, 6 Dec 2022 08:16:20 +0100 Subject: [PATCH 31/32] Simplify nil check --- lib/keyring.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/keyring.rb b/lib/keyring.rb index 7244849..6015ddf 100644 --- a/lib/keyring.rb +++ b/lib/keyring.rb @@ -61,8 +61,7 @@ def keychain_has_key?(key) end def keychain_value(key) - item = keychain.where(service: self.class.keychain_prefix + name, account: key).first - ENV[key] || item&.password + ENV[key] || keychain.where(service: self.class.keychain_prefix + name, account: key).first&.password end def camel_cased_keys From 93885465ba12564eef1cee458020b82d46a5f1b1 Mon Sep 17 00:00:00 2001 From: Prokash Sarkar Date: Fri, 1 Sep 2023 12:59:20 +0600 Subject: [PATCH 32/32] Fixed typo and improved readability * Fixed a typo where *environment* spelling was wrong * Added a few prepositions and other minor changes --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index dfca9cc..f808d2a 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ [![Build Status](https://travis-ci.org/orta/cocoapods-keys.svg?branch=master)](https://travis-ci.org/orta/cocoapods-keys) -A key value store for enviroment and application keys. +A key value store for environment and application keys. -Its good security practice to keep production keys out of developer hands. CocoaPods-keys makes it easy to have per-user config settings stored securely in the developer's keychain, and not in the application source. It is a plugin that once installed will run on every `pod install` or `pod update`. +It's good security practice to keep production keys out of the developer's hands. CocoaPods-keys make it easy to have per-user config settings stored securely in the developer's keychain, and not in the application source. It is a plugin that once installed will run on every `pod install` or `pod update`. ## Alternatives @@ -40,7 +40,7 @@ plugin 'cocoapods-keys', { ``` > Please do not use dash in key names ([Reason why here in this issue #197](https://github.com/orta/cocoapods-keys/issues/197)). > -> For example convert any key like this `WRONGLY-DEFINED-KEY` to `CorrectlyDefinedKey`. +> For example, convert any key like this `WRONGLY-DEFINED-KEY` to `CorrectlyDefinedKey`. Then running `pod install` will prompt for the keys not yet set and you can ensure everyone has the same setup. @@ -74,7 +74,7 @@ For example: └ redditAPIToken & mixpanelAPIToken ``` -After the next `pod install` or `pod update` keys will add a new `Keys` pod to your Pods project, supporting both static libraries and frameworks. *Note* you have to include `plugin 'cocoapods-keys'` in the Podfile for Keys to register that it should work. This provides an API to your keys from Cocoa code. For example the application code above would look like: +After the next `pod install` or `pod update` keys will add a new `Keys` pod to your Pods project, supporting both static libraries and frameworks. *Note* You have to include `plugin 'cocoapods-keys'` in the Podfile for Keys to register that it should work. This provides an API to your keys from Cocoa code. For example, the application code above would look like: ``` objc @@ -108,7 +108,7 @@ CocoaPods-keys has 3 other commands: * `bundle exec pod keys rm [key] [optional project]` Will remove a key from a project. - If Wildcards are included, it will remove the keys matching the pattern. E.g.: `bundle exec pod keys rm "G*og*"` will remove *all* the keys that begin with 'G', have 'og' in the middle and end with anything. + If Wildcards are included, it will remove the keys matching the pattern. E.g.: `bundle exec pod keys rm "G*og*"` will remove *all* the keys that begin with 'G', have 'og' in the middle, and end with anything. To nuke all the keys, run either `bundle exec pod keys rm "*"` or `bundle exec pod keys rm --all` * `bundle exec pod keys generate [optional project]` @@ -116,11 +116,11 @@ CocoaPods-keys has 3 other commands: #### Continuous Integration -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. +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. #### Maintainance State -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. +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. #### Security @@ -128,11 +128,11 @@ Key security is difficult. Right now even the biggest apps get their keys [leake > Putting this in the context of, "should you be storing keys in software", is more appropriate. Many companies do this. It's never a good idea. -> When developers do that, other developers can use debuggers and string searching commands to extract those keys from the running application. There are numerous talks on how to do that, but leave that as an exercise to the reader to find those talks. +> When developers do that, other developers can use debuggers and string searching commands to extract those keys from the running application. There are numerous talks on how to do that, but leave that as an exercise for the reader to find those talks. > Many people believe that obfuscating these keys in code will help. It usually won't because you can just run a debugger and find the fully functional keys. -So in summary, the ideal way to store keys is to not store keys. In reality though most Apps embed keys, and this does that and adds some rudimentary obfuscation to the keys. A well motivated app cracker could probably extract this within a few minutes however. +So in summary, the ideal way to store keys is to not store keys. In reality, though most Apps embed keys, and this does that and adds some rudimentary obfuscation to the keys. A well motivated app cracker could probably extract this within a few minutes however. #### Thanks