Skip to content

Commit

Permalink
Added dotenv dependency (#9)
Browse files Browse the repository at this point in the history
### Description

This PR resolved #8 and added the`dotenv` dependency to load the env
variables from `.env` file.

### Medias (if needed)

- None.

### Testplan

- [x] I tested this change on my local environment.
- [ ] I ran the unit tests.

### Checklist

- [ ] I added tests for this change.
- [ ] I checked the code style and run the linter.
- [ ] I added necessary documentation (if applicable).
  • Loading branch information
derian-cordoba authored Feb 17, 2025
1 parent 39391e4 commit f9aa2a6
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
5 changes: 3 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -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)

Expand All @@ -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)
Expand Down Expand Up @@ -46,7 +48,6 @@ GEM

PLATFORMS
arm64-darwin-24
ruby

DEPENDENCIES
rubocop (~> 1.71.2)
Expand Down
1 change: 1 addition & 0 deletions bin/secure-keys
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env ruby

require 'bundler/setup'
require 'dotenv/load'
require_relative '../lib/keys'

# Generate the keys
Expand Down
6 changes: 3 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)")
}
}
Expand Down
6 changes: 3 additions & 3 deletions lib/version.rb
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions secure-keys.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit f9aa2a6

Please sign in to comment.