diff --git a/Gemfile.lock b/Gemfile.lock index e0ff56f..18a4a88 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,9 +1,10 @@ PATH remote: . specs: - secure-keys (1.0.3) + secure-keys (1.0.4) base64 (~> 0.2.0) digest (~> 3.2.0) + dotenv (~> 3.1.7) json (~> 2.10.1) osx_keychain (~> 1.0.2) @@ -16,6 +17,7 @@ GEM ast (2.4.2) base64 (0.2.0) digest (3.2.0) + dotenv (3.1.7) json (2.10.1) language_server-protocol (3.17.0.4) osx_keychain (1.0.2) @@ -46,7 +48,6 @@ GEM PLATFORMS arm64-darwin-24 - ruby DEPENDENCIES rubocop (~> 1.71.2) diff --git a/bin/secure-keys b/bin/secure-keys index 27e9b87..efe301b 100755 --- a/bin/secure-keys +++ b/bin/secure-keys @@ -1,6 +1,7 @@ #!/usr/bin/env ruby require 'bundler/setup' +require 'dotenv/load' require_relative '../lib/keys' # Generate the keys diff --git a/docs/index.md b/docs/index.md index 48fb45a..9989756 100644 --- a/docs/index.md +++ b/docs/index.md @@ -86,7 +86,7 @@ security add-generic-password -a "$SECURE_KEYS_IDENTIFIER" -s "apiKey" -w "your- #### From Environment Variables -You can export them directly as environment variables. +You can define the keys in the `.env` file or export the keys as environment variables. ```bash export SECURE_KEYS_IDENTIFIER="github-token,api_key,firebaseToken" @@ -199,8 +199,8 @@ public enum Keys { /// The decrypted value of the key public var decryptedValue: String { switch self { - case .apiKey: return [1, 2, 4].decrypt(key: [248, 53, 26], iv: [148, 55, 47], tag: [119, 81]) - case .someKey: return [1, 2, 4].decrypt(key: [248, 53, 26], iv: [148, 55, 47], tag: [119, 81]) + case .apiKey: [1, 2, 4].decrypt(key: [248, 53, 26], iv: [148, 55, 47], tag: [119, 81]) + case .someKey: [1, 2, 4].decrypt(key: [248, 53, 26], iv: [148, 55, 47], tag: [119, 81]) case .unknown: fatalError("Unknown key \(rawValue)") } } diff --git a/lib/version.rb b/lib/version.rb index 7f27314..bcd19f8 100644 --- a/lib/version.rb +++ b/lib/version.rb @@ -1,8 +1,8 @@ #!/usr/bin/env ruby module Keys - VERSION = '1.0.3'.freeze - SUMMARY = 'Keys is a simple tool for managing your secret keys'.freeze - DESCRIPTION = 'Keys is a simple tool to manage your secret keys in iOS your project'.freeze + VERSION = '1.0.4'.freeze + SUMMARY = 'Secure Keys is a simple tool for managing your secret keys'.freeze + DESCRIPTION = 'Secure Keys is a simple tool to manage your secret keys in your iOS project'.freeze HOMEPAGE_URI = 'https://github.com/DerianCordobaPerez/secure-keys-generator'.freeze end diff --git a/secure-keys.gemspec b/secure-keys.gemspec index 9dbf07a..e5b511d 100644 --- a/secure-keys.gemspec +++ b/secure-keys.gemspec @@ -31,6 +31,7 @@ Gem::Specification.new do |spec| spec.add_runtime_dependency 'base64', '~> 0.2.0' spec.add_runtime_dependency 'digest', '~> 3.2.0' + spec.add_runtime_dependency 'dotenv', '~> 3.1.7' spec.add_runtime_dependency 'json', '~> 2.10.1' spec.add_runtime_dependency 'osx_keychain', '~> 1.0.2' spec.add_development_dependency 'rubocop', '~> 1.71.2'