trixie 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +15 -3
- data/lib/trixie/load.rb +12 -1
- data/lib/trixie/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4601cd84921ad3fca11a80ffb627ef4b5d44d9a404dc25ac1905d75ab12a0b96
|
4
|
+
data.tar.gz: fcd3bb97d53845a6cd7752c90305bd9641c7809d57e86fc2d9fd4a6bcab41e96
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 558dbef73b15724f9559e64d9f20cfa736fddea2445d8a9edd7c7a8bd9ee514a4c8a244356095c470787e509df6af58c29a99525bd96f5ef94d718a287e75852
|
7
|
+
data.tar.gz: 8327f5fa9e8392e563e888fd981760ac6ec78438de8a28cf8b0c83691c8748dcdb6fd6156457977132421e6780b157c1eae17d5ab59ffd9921486e3f6345d732
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -18,7 +18,20 @@ secrets:
|
|
18
18
|
value: "{{ op://Developers/NPM_TOKEN/SETUP_SECRET/value }}"
|
19
19
|
```
|
20
20
|
|
21
|
-
Then you can run `trixie load > .env.secrets` to update your env file with the `NPM_TOKEN
|
21
|
+
Then you can run `trixie load > .env.secrets` to update your env file with the `NPM_TOKEN`.
|
22
|
+
|
23
|
+
Alternatively, you can also leverage the following environment variables:
|
24
|
+
- TRIXIE_OP_ADDRESS - sets the authentication address for 1Password
|
25
|
+
- TRIXIE_OP_EMAIL - sets the user email address for 1Password
|
26
|
+
|
27
|
+
Example:
|
28
|
+
```ssh
|
29
|
+
TRIXIE_OP_ADDRESS=https://{account}.1password.com \
|
30
|
+
TRIXIE_OP_EMAIL=john.doe@email.com \
|
31
|
+
trixie load > .env.secrets
|
32
|
+
```
|
33
|
+
this will populate your env file with:
|
34
|
+
`export NPM_TOKEN={toptals-read-only-npm-token}`
|
22
35
|
|
23
36
|
### Groups
|
24
37
|
|
@@ -70,8 +83,7 @@ Or install it yourself as:
|
|
70
83
|
## TODO IDEAS
|
71
84
|
|
72
85
|
1. Support Multiple Backends/Password Managers, Trixie::Loader can be refactored to be an adapter for the op CLI
|
73
|
-
2.
|
74
|
-
3. Add a load --cache option, so fetched secrets could be retained for a while without using the Password Manager Backend
|
86
|
+
2. Add a load --cache option, so fetched secrets could be retained for a while without using the Password Manager Backend
|
75
87
|
|
76
88
|
## Development
|
77
89
|
|
data/lib/trixie/load.rb
CHANGED
@@ -4,6 +4,8 @@ module Trixie
|
|
4
4
|
# Fetches the specified secrets with op cli and returns them formatted
|
5
5
|
class Load
|
6
6
|
OP_NOT_INSTALLED = "op cli is not installed please download and install at https://developer.1password.com/docs/cli/get-started#install"
|
7
|
+
OP_ADDRESS_ENV = "TRIXIE_OP_ADDRESS"
|
8
|
+
OP_EMAIL_ENV = "TRIXIE_OP_EMAIL"
|
7
9
|
|
8
10
|
def initialize(file:, groups: [], format: "env")
|
9
11
|
@file = file
|
@@ -38,7 +40,7 @@ module Trixie
|
|
38
40
|
warn "* Configuring 1password Account"
|
39
41
|
warn "To get the Secret Key take a look at https://support.1password.com/secret-key/"
|
40
42
|
|
41
|
-
|
43
|
+
add_op_account
|
42
44
|
end
|
43
45
|
|
44
46
|
def fetch_secrets
|
@@ -58,5 +60,14 @@ module Trixie
|
|
58
60
|
def formatted_secrets
|
59
61
|
@formatter.call(filtered_secrets)
|
60
62
|
end
|
63
|
+
|
64
|
+
def add_op_account
|
65
|
+
cmd = "op account add"
|
66
|
+
|
67
|
+
cmd += " --address #{ENV[OP_ADDRESS_ENV]}" if ENV[OP_ADDRESS_ENV]
|
68
|
+
cmd += " --email #{ENV[OP_EMAIL_ENV]}" if ENV[OP_EMAIL_ENV]
|
69
|
+
|
70
|
+
`#{cmd}`
|
71
|
+
end
|
61
72
|
end
|
62
73
|
end
|
data/lib/trixie/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trixie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Toptal, LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-cli
|