envkey 1.2.1 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +5 -5
  2. data/LICENSE.txt +1 -1
  3. data/README.md +7 -0
  4. data/ext/{envkey-fetch_1.2.1_darwin_386 → envkey-fetch_1.2.9_darwin_amd64}/LICENSE +1 -1
  5. data/ext/{envkey-fetch_1.2.1_darwin_amd64 → envkey-fetch_1.2.9_darwin_amd64}/README.md +18 -7
  6. data/ext/envkey-fetch_1.2.9_darwin_amd64/envkey-fetch +0 -0
  7. data/ext/{envkey-fetch_1.2.1_freebsd_386 → envkey-fetch_1.2.9_darwin_arm64}/LICENSE +1 -1
  8. data/ext/{envkey-fetch_1.2.1_darwin_386 → envkey-fetch_1.2.9_darwin_arm64}/README.md +18 -7
  9. data/ext/envkey-fetch_1.2.9_darwin_arm64/envkey-fetch +0 -0
  10. data/ext/{envkey-fetch_1.2.1_freebsd_amd64 → envkey-fetch_1.2.9_freebsd_amd64}/LICENSE +1 -1
  11. data/ext/{envkey-fetch_1.2.1_freebsd_386 → envkey-fetch_1.2.9_freebsd_amd64}/README.md +18 -7
  12. data/ext/envkey-fetch_1.2.9_freebsd_amd64/envkey-fetch +0 -0
  13. data/ext/{envkey-fetch_1.2.1_darwin_amd64 → envkey-fetch_1.2.9_linux_amd64}/LICENSE +1 -1
  14. data/ext/{envkey-fetch_1.2.1_freebsd_amd64 → envkey-fetch_1.2.9_linux_amd64}/README.md +18 -7
  15. data/ext/envkey-fetch_1.2.9_linux_amd64/envkey-fetch +0 -0
  16. data/ext/envkey-fetch_1.2.9_windows_amd64/LICENSE +21 -0
  17. data/ext/envkey-fetch_1.2.9_windows_amd64/README.md +97 -0
  18. data/ext/envkey-fetch_1.2.9_windows_amd64/envkey-fetch.exe +0 -0
  19. data/lib/envkey.rb +5 -4
  20. data/lib/envkey/core.rb +20 -8
  21. data/lib/envkey/platform.rb +7 -1
  22. data/lib/envkey/rails.rb +2 -5
  23. data/lib/envkey/version.rb +2 -2
  24. metadata +18 -27
  25. data/ext/envkey-fetch_1.2.1_darwin_386/envkey-fetch +0 -0
  26. data/ext/envkey-fetch_1.2.1_darwin_amd64/envkey-fetch +0 -0
  27. data/ext/envkey-fetch_1.2.1_freebsd_386/envkey-fetch +0 -0
  28. data/ext/envkey-fetch_1.2.1_freebsd_amd64/envkey-fetch +0 -0
  29. data/ext/envkey-fetch_1.2.1_linux_386/LICENSE +0 -21
  30. data/ext/envkey-fetch_1.2.1_linux_386/README.md +0 -86
  31. data/ext/envkey-fetch_1.2.1_linux_386/envkey-fetch +0 -0
  32. data/ext/envkey-fetch_1.2.1_linux_amd64/LICENSE +0 -21
  33. data/ext/envkey-fetch_1.2.1_linux_amd64/README.md +0 -86
  34. data/ext/envkey-fetch_1.2.1_linux_amd64/envkey-fetch +0 -0
  35. data/ext/envkey-fetch_1.2.1_windows_386/LICENSE +0 -21
  36. data/ext/envkey-fetch_1.2.1_windows_386/README.md +0 -86
  37. data/ext/envkey-fetch_1.2.1_windows_386/envkey-fetch.exe +0 -0
  38. data/ext/envkey-fetch_1.2.1_windows_amd64/LICENSE +0 -21
  39. data/ext/envkey-fetch_1.2.1_windows_amd64/README.md +0 -86
  40. data/ext/envkey-fetch_1.2.1_windows_amd64/envkey-fetch.exe +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 68217bdf9ae120a8743ed88d7caf5041e03febcfae747425e4ae69b330d68713
4
- data.tar.gz: fba46455607426a7dc380758fe954aada34b25639434cb4f190d50010f964a29
2
+ SHA1:
3
+ metadata.gz: 9a5018a501d4e9a5bf02258fdc732dea2bbeb405
4
+ data.tar.gz: 031547f50b2f416441d85501065d8d1dd548d363
5
5
  SHA512:
6
- metadata.gz: 6a5449bf3e5ab5d8aacdc0bab73389bf3dbe14079a9f40ddfe3097fe45fd6ba26ab2d8a7c83d03f3c87ea9a2a42408c6d0a75ba209dec6986974f58efb1de68b
7
- data.tar.gz: b84acc1f62319bd216d479908383d1561741eb24f7325f5b845c503cee7d2aaf3a64e94aa99776f52b02bdc52d703ae71e4f4b523a9b40b6c699624b2975f2bd
6
+ metadata.gz: d1f2dfd2a4a1ffcd0bdf1309046a6317fd586c66427a4fabc4b9a4716f081629b7ba621487110e7490601e42a345dd4ffe15b22ea03c158cb0404e1fda895e80
7
+ data.tar.gz: 541038a63c0270ad2aadfc4f8c1e4180b14da72a1d41233ab703f49dc784e1740505831ea01f86d4f25f795d13a46ec84d2093620562b38b40f5bd9417374b83
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2017 Envkey Inc. <support@envkey.com>
3
+ Copyright (c) 2021 Envkey Inc. <support@envkey.com>
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -63,6 +63,13 @@ For caching purposes, the gem assumes you're in development mode if either `ENV[
63
63
 
64
64
  If you look in the `ext` directory of this gem, you'll find a number of `envkey-fetch` binaries for various platforms and architectures. These are output by the [envkey-fetch Go library](https://github.com/envkey/envkey-fetch). It contains EnvKey's core cross-platform fetching, decryption, verification, web of trust, redundancy, and caching logic. It is completely open source.
65
65
 
66
+ ## x509 error / ca-certificates
67
+
68
+ On a stripped down OS like Alpine Linux, you may get an `x509: certificate signed by unknown authority` error when the envkey gem attempts to load your config. [envkey-fetch](https://github.com/envkey/envkey-fetch) tries to handle this by including its own set of trusted CAs via [gocertifi](https://github.com/certifi/gocertifi), but if you're getting this error anyway, you can fix it by ensuring that the `ca-certificates` dependency is installed. On Alpine you'll want to run:
69
+ ```
70
+ apk add --no-cache ca-certificates
71
+ ```
72
+
66
73
  ## Further Reading
67
74
 
68
75
  For more on EnvKey in general:
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright © 2017 Envkey Inc. <support@envkey.com>
3
+ Copyright © 2021 Envkey Inc. <support@envkey.com>
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -8,7 +8,7 @@ If you want to build an EnvKey library in a language that isn't yet officially s
8
8
 
9
9
  ## Installation
10
10
 
11
- envkey-fetch compiles into a simple static binary with no dependencies, which makes installation a simple matter of fetching the right binary for your platform and putting it in your `PATH`. An `install.sh` script is available to simplify this.
11
+ envkey-fetch compiles into a simple static binary with no dependencies, which makes installation a simple matter of fetching the right binary for your platform and putting it in your `PATH`. An `install.sh` script is available to simplify this, as well as a [homebrew tap](https://github.com/envkey/homebrew-envkey)..
12
12
 
13
13
  **Install via bash:**
14
14
 
@@ -57,12 +57,23 @@ error: ENVKEY invalid
57
57
  ### Flags
58
58
 
59
59
  ```text
60
- --cache cache encrypted config as a local backup (default is false)
61
- --cache-dir string cache directory (default is $HOME/.envkey/cache)
62
- -h, --help help for envkey-fetch
63
- -v, --version prints the version
64
- --verbose print verbose output (default is false)
65
- --timeout float timeout in seconds for http requests (default 2)
60
+ --cache cache encrypted config as a local backup (default is false)
61
+ --cache-dir string cache directory (default is $HOME/.envkey/cache)
62
+ --client-name string calling client library name (default is none)
63
+ --client-version string calling client library version (default is none)
64
+ -h, --help help for envkey-fetch
65
+ --retries uint8 number of times to retry requests on failure (default 3)
66
+ --retryBackoff float retry backoff factor: {retryBackoff} * (2 ^ {retries - 1}) (default 1)
67
+ --timeout float timeout in seconds for http requests (default 10)
68
+ --verbose print verbose output (default is false)
69
+ -v, --version prints the version
70
+ ```
71
+
72
+ ## x509 error / ca-certificates
73
+
74
+ On a stripped down OS like Alpine Linux, you may get an `x509: certificate signed by unknown authority` error when `envkey-fetch` attempts to load your config. `envkey-fetch` tries to handle this by including its own set of trusted CAs via [gocertifi](https://github.com/certifi/gocertifi), but if you're getting this error anyway, you can fix it by ensuring that the `ca-certificates` dependency is installed. On Alpine you'll want to run:
75
+ ```
76
+ apk add --no-cache ca-certificates
66
77
  ```
67
78
 
68
79
  ## Further Reading
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright © 2017 Envkey Inc. <support@envkey.com>
3
+ Copyright © 2021 Envkey Inc. <support@envkey.com>
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -8,7 +8,7 @@ If you want to build an EnvKey library in a language that isn't yet officially s
8
8
 
9
9
  ## Installation
10
10
 
11
- envkey-fetch compiles into a simple static binary with no dependencies, which makes installation a simple matter of fetching the right binary for your platform and putting it in your `PATH`. An `install.sh` script is available to simplify this.
11
+ envkey-fetch compiles into a simple static binary with no dependencies, which makes installation a simple matter of fetching the right binary for your platform and putting it in your `PATH`. An `install.sh` script is available to simplify this, as well as a [homebrew tap](https://github.com/envkey/homebrew-envkey)..
12
12
 
13
13
  **Install via bash:**
14
14
 
@@ -57,12 +57,23 @@ error: ENVKEY invalid
57
57
  ### Flags
58
58
 
59
59
  ```text
60
- --cache cache encrypted config as a local backup (default is false)
61
- --cache-dir string cache directory (default is $HOME/.envkey/cache)
62
- -h, --help help for envkey-fetch
63
- -v, --version prints the version
64
- --verbose print verbose output (default is false)
65
- --timeout float timeout in seconds for http requests (default 2)
60
+ --cache cache encrypted config as a local backup (default is false)
61
+ --cache-dir string cache directory (default is $HOME/.envkey/cache)
62
+ --client-name string calling client library name (default is none)
63
+ --client-version string calling client library version (default is none)
64
+ -h, --help help for envkey-fetch
65
+ --retries uint8 number of times to retry requests on failure (default 3)
66
+ --retryBackoff float retry backoff factor: {retryBackoff} * (2 ^ {retries - 1}) (default 1)
67
+ --timeout float timeout in seconds for http requests (default 10)
68
+ --verbose print verbose output (default is false)
69
+ -v, --version prints the version
70
+ ```
71
+
72
+ ## x509 error / ca-certificates
73
+
74
+ On a stripped down OS like Alpine Linux, you may get an `x509: certificate signed by unknown authority` error when `envkey-fetch` attempts to load your config. `envkey-fetch` tries to handle this by including its own set of trusted CAs via [gocertifi](https://github.com/certifi/gocertifi), but if you're getting this error anyway, you can fix it by ensuring that the `ca-certificates` dependency is installed. On Alpine you'll want to run:
75
+ ```
76
+ apk add --no-cache ca-certificates
66
77
  ```
67
78
 
68
79
  ## Further Reading
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright © 2017 Envkey Inc. <support@envkey.com>
3
+ Copyright © 2021 Envkey Inc. <support@envkey.com>
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -8,7 +8,7 @@ If you want to build an EnvKey library in a language that isn't yet officially s
8
8
 
9
9
  ## Installation
10
10
 
11
- envkey-fetch compiles into a simple static binary with no dependencies, which makes installation a simple matter of fetching the right binary for your platform and putting it in your `PATH`. An `install.sh` script is available to simplify this.
11
+ envkey-fetch compiles into a simple static binary with no dependencies, which makes installation a simple matter of fetching the right binary for your platform and putting it in your `PATH`. An `install.sh` script is available to simplify this, as well as a [homebrew tap](https://github.com/envkey/homebrew-envkey)..
12
12
 
13
13
  **Install via bash:**
14
14
 
@@ -57,12 +57,23 @@ error: ENVKEY invalid
57
57
  ### Flags
58
58
 
59
59
  ```text
60
- --cache cache encrypted config as a local backup (default is false)
61
- --cache-dir string cache directory (default is $HOME/.envkey/cache)
62
- -h, --help help for envkey-fetch
63
- -v, --version prints the version
64
- --verbose print verbose output (default is false)
65
- --timeout float timeout in seconds for http requests (default 2)
60
+ --cache cache encrypted config as a local backup (default is false)
61
+ --cache-dir string cache directory (default is $HOME/.envkey/cache)
62
+ --client-name string calling client library name (default is none)
63
+ --client-version string calling client library version (default is none)
64
+ -h, --help help for envkey-fetch
65
+ --retries uint8 number of times to retry requests on failure (default 3)
66
+ --retryBackoff float retry backoff factor: {retryBackoff} * (2 ^ {retries - 1}) (default 1)
67
+ --timeout float timeout in seconds for http requests (default 10)
68
+ --verbose print verbose output (default is false)
69
+ -v, --version prints the version
70
+ ```
71
+
72
+ ## x509 error / ca-certificates
73
+
74
+ On a stripped down OS like Alpine Linux, you may get an `x509: certificate signed by unknown authority` error when `envkey-fetch` attempts to load your config. `envkey-fetch` tries to handle this by including its own set of trusted CAs via [gocertifi](https://github.com/certifi/gocertifi), but if you're getting this error anyway, you can fix it by ensuring that the `ca-certificates` dependency is installed. On Alpine you'll want to run:
75
+ ```
76
+ apk add --no-cache ca-certificates
66
77
  ```
67
78
 
68
79
  ## Further Reading
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright © 2017 Envkey Inc. <support@envkey.com>
3
+ Copyright © 2021 Envkey Inc. <support@envkey.com>
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -8,7 +8,7 @@ If you want to build an EnvKey library in a language that isn't yet officially s
8
8
 
9
9
  ## Installation
10
10
 
11
- envkey-fetch compiles into a simple static binary with no dependencies, which makes installation a simple matter of fetching the right binary for your platform and putting it in your `PATH`. An `install.sh` script is available to simplify this.
11
+ envkey-fetch compiles into a simple static binary with no dependencies, which makes installation a simple matter of fetching the right binary for your platform and putting it in your `PATH`. An `install.sh` script is available to simplify this, as well as a [homebrew tap](https://github.com/envkey/homebrew-envkey)..
12
12
 
13
13
  **Install via bash:**
14
14
 
@@ -57,12 +57,23 @@ error: ENVKEY invalid
57
57
  ### Flags
58
58
 
59
59
  ```text
60
- --cache cache encrypted config as a local backup (default is false)
61
- --cache-dir string cache directory (default is $HOME/.envkey/cache)
62
- -h, --help help for envkey-fetch
63
- -v, --version prints the version
64
- --verbose print verbose output (default is false)
65
- --timeout float timeout in seconds for http requests (default 2)
60
+ --cache cache encrypted config as a local backup (default is false)
61
+ --cache-dir string cache directory (default is $HOME/.envkey/cache)
62
+ --client-name string calling client library name (default is none)
63
+ --client-version string calling client library version (default is none)
64
+ -h, --help help for envkey-fetch
65
+ --retries uint8 number of times to retry requests on failure (default 3)
66
+ --retryBackoff float retry backoff factor: {retryBackoff} * (2 ^ {retries - 1}) (default 1)
67
+ --timeout float timeout in seconds for http requests (default 10)
68
+ --verbose print verbose output (default is false)
69
+ -v, --version prints the version
70
+ ```
71
+
72
+ ## x509 error / ca-certificates
73
+
74
+ On a stripped down OS like Alpine Linux, you may get an `x509: certificate signed by unknown authority` error when `envkey-fetch` attempts to load your config. `envkey-fetch` tries to handle this by including its own set of trusted CAs via [gocertifi](https://github.com/certifi/gocertifi), but if you're getting this error anyway, you can fix it by ensuring that the `ca-certificates` dependency is installed. On Alpine you'll want to run:
75
+ ```
76
+ apk add --no-cache ca-certificates
66
77
  ```
67
78
 
68
79
  ## Further Reading
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright © 2021 Envkey Inc. <support@envkey.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,97 @@
1
+ # envkey-fetch
2
+
3
+ This library contains [EnvKey](https://www.envkey.com)'s core cross-platform fetching, decryption, verification, web of trust, redundancy, and caching logic. It accepts an `ENVKEY` generated by the [EnvKey App](https://www.github.com/envkey/envkey-app) and returns decrypted configuration for a specific app environment as json.
4
+
5
+ It is used by EnvKey's various Client Libraries, including [envkey-source](https://github.com/envkey/envkey-source) for bash, [envkey-ruby](https://github.com/envkey/envkey-ruby) for Ruby and Rails, [envkey-python](https://github.com/envkey/envkey-python) for Python, [envkey-node](https://github.com/envkey/envkey-node) for Node.js, and [envkeygo](https://github.com/envkey/envkeygo) for Go.
6
+
7
+ If you want to build an EnvKey library in a language that isn't yet officially supported, build some other type of integration, or simply play around with EnvKey on the command line, envkey-fetch is the library for you. If you just want to integrate EnvKey with your project, check out one of the aforementioned higher level libraries.
8
+
9
+ ## Installation
10
+
11
+ envkey-fetch compiles into a simple static binary with no dependencies, which makes installation a simple matter of fetching the right binary for your platform and putting it in your `PATH`. An `install.sh` script is available to simplify this, as well as a [homebrew tap](https://github.com/envkey/homebrew-envkey)..
12
+
13
+ **Install via bash:**
14
+
15
+ ```bash
16
+ curl -s https://raw.githubusercontent.com/envkey/envkey-fetch/master/install.sh | bash
17
+ ```
18
+
19
+ **Install manually:**
20
+
21
+ Find the [release](https://github.com/envkey/envkey-fetch/releases) for your platform and architecture, and stick the appropriate binary somewhere in your `PATH` (or wherever you like really).
22
+
23
+ **Install from source:**
24
+
25
+ With Go installed, clone the project into your `GOPATH`. `cd` into the directory and run `go get` and `go build`.
26
+
27
+ **Cross-compile from source:**
28
+
29
+ To compile cross-platform binaries, make sure Go is installed, then install [goreleaser](https://goreleaser.com/) - follow instructions in the docs to do so.
30
+
31
+ Then to cross-compile, run:
32
+
33
+ `goreleaser`
34
+
35
+ Binaries for each platform will be output to the `dist` folder.
36
+
37
+ ## Usage
38
+
39
+ ```bash
40
+ envkey-fetch YOUR-ENVKEY [flags]
41
+ ```
42
+
43
+ This will either write your the app environment's configuration associated with your `ENVKEY` as json to stdout or write an error message beginning with `error:` to stdout.
44
+
45
+ ### Example json output
46
+
47
+ ```json
48
+ {"TEST":"it","TEST_2":"works!"}
49
+ ```
50
+
51
+ ### Example error output
52
+
53
+ ```text
54
+ error: ENVKEY invalid
55
+ ```
56
+
57
+ ### Flags
58
+
59
+ ```text
60
+ --cache cache encrypted config as a local backup (default is false)
61
+ --cache-dir string cache directory (default is $HOME/.envkey/cache)
62
+ --client-name string calling client library name (default is none)
63
+ --client-version string calling client library version (default is none)
64
+ -h, --help help for envkey-fetch
65
+ --retries uint8 number of times to retry requests on failure (default 3)
66
+ --retryBackoff float retry backoff factor: {retryBackoff} * (2 ^ {retries - 1}) (default 1)
67
+ --timeout float timeout in seconds for http requests (default 10)
68
+ --verbose print verbose output (default is false)
69
+ -v, --version prints the version
70
+ ```
71
+
72
+ ## x509 error / ca-certificates
73
+
74
+ On a stripped down OS like Alpine Linux, you may get an `x509: certificate signed by unknown authority` error when `envkey-fetch` attempts to load your config. `envkey-fetch` tries to handle this by including its own set of trusted CAs via [gocertifi](https://github.com/certifi/gocertifi), but if you're getting this error anyway, you can fix it by ensuring that the `ca-certificates` dependency is installed. On Alpine you'll want to run:
75
+ ```
76
+ apk add --no-cache ca-certificates
77
+ ```
78
+
79
+ ## Further Reading
80
+
81
+ For more on EnvKey in general:
82
+
83
+ Read the [docs](https://docs.envkey.com).
84
+
85
+ Read the [integration quickstart](https://docs.envkey.com/integration-quickstart.html).
86
+
87
+ Read the [security and cryptography overview](https://security.envkey.com).
88
+
89
+ ## Need help? Have questions, feedback, or ideas?
90
+
91
+ Post an [issue](https://github.com/envkey/envkey-fetch/issues) or email us: [support@envkey.com](mailto:support@envkey.com).
92
+
93
+
94
+
95
+
96
+
97
+
data/lib/envkey.rb CHANGED
@@ -1,10 +1,11 @@
1
1
  require "envkey/version"
2
+ require "envkey/core"
2
3
 
3
- if defined?(Rails)
4
+ Envkey::Core.load_env
5
+
6
+ begin
4
7
  require "envkey/rails"
5
- else
6
- require "envkey/core"
7
- Envkey::Core.load_env
8
+ rescue LoadError
8
9
  end
9
10
 
10
11
 
data/lib/envkey/core.rb CHANGED
@@ -5,18 +5,27 @@ require 'envkey/fetch'
5
5
 
6
6
  module Envkey::Core
7
7
 
8
- def self.load_env spring_pre_fork_ts=nil,
9
- overload_dotenv_vars=[],
10
- overload_envkey_vars=[]
8
+ def self.load_env
11
9
  original_env = ENV.to_h
12
- dotenv_vars = Dotenv.load
10
+ dotenv_vars = Dotenv.parse
11
+
12
+ overwrite_dotenv_vars = JSON.parse(ENV["__ENVKEY_DOT_ENV_VARS"] || "[]")
13
+ overwrite_envkey_vars = JSON.parse(ENV["__ENVKEY_VARS"] || "[]")
14
+
13
15
  updated_dotenv_vars = dotenv_vars.keys.select do |k|
14
- overload_dotenv_vars.include?(k) || original_env[k] == nil
16
+ (overwrite_dotenv_vars.include?(k) || original_env[k] == nil)
15
17
  end
16
- overload_dotenv_vars.each do |k|
18
+ updated_dotenv_vars.each do |k|
17
19
  ENV[k] = dotenv_vars[k]
18
20
  end
19
21
 
22
+ key = ENV["ENVKEY"]
23
+
24
+ # handle changed ENVKEY
25
+ if key && updated_dotenv_vars.include?("ENVKEY") && key != original_env["ENVKEY"]
26
+ overwrite_envkey_vars.each {|var| ENV.delete(var) }
27
+ end
28
+
20
29
  if (key = ENV["ENVKEY"])
21
30
  res = Envkey::Fetch.fetch_env(key)
22
31
  if res && res.gsub("\n","").gsub("\r", "") != "" && !res.start_with?("error:")
@@ -24,13 +33,16 @@ module Envkey::Core
24
33
  updated_envkey_vars = []
25
34
  envs.each do |k,v|
26
35
  var = k.upcase
27
- if !ENV[var] || overload_envkey_vars.include?(var)
36
+ if !ENV[var] || overwrite_envkey_vars.include?(var)
28
37
  updated_envkey_vars << var
29
38
  ENV[var] = v
30
39
  end
31
40
  end
32
41
 
33
- return [Set.new(updated_dotenv_vars), Set.new(updated_envkey_vars)]
42
+ ENV["__ENVKEY_DOT_ENV_VARS"] = updated_dotenv_vars.to_json
43
+ ENV["__ENVKEY_VARS"] = updated_envkey_vars.to_json
44
+
45
+ return updated_dotenv_vars, updated_envkey_vars
34
46
  elsif res.start_with?("error:")
35
47
  STDERR.puts "envkey-fetch " + res
36
48
  raise "ENVKEY invalid. Couldn't load vars."
@@ -37,7 +37,13 @@ module Envkey::Platform
37
37
  end
38
38
 
39
39
  def self.arch_part
40
- ARCH == "x86_64" ? "amd64" : "386"
40
+ if platform_part == "darwin" && ARCH == "arm"
41
+ "arm64"
42
+ elsif ARCH == "x86_64"
43
+ "amd64"
44
+ else
45
+ raise "As of 1.3.0, envkey-ruby only supports 64-bit systems. Please use an earlier version for 32-bit support."
46
+ end
41
47
  end
42
48
 
43
49
  def self.ext
data/lib/envkey/rails.rb CHANGED
@@ -1,18 +1,15 @@
1
1
  require "envkey/core"
2
+ require "rails"
2
3
 
3
4
  module Envkey
4
5
  class Railtie < Rails::Railtie
5
-
6
6
  config.before_configuration do
7
7
  begin
8
8
  require "spring/commands"
9
- ts = Time.now
10
- overload_dotenv_vars, overload_envkey_vars = Envkey::Core.load_env
11
9
  Spring.after_fork do
12
- Envkey::Core.load_env(ts, (overload_dotenv_vars || []), (overload_envkey_vars || []))
10
+ Envkey::Core.load_env
13
11
  end
14
12
  rescue LoadError
15
- Envkey::Core.load_env
16
13
  end
17
14
  end
18
15
  end
@@ -1,4 +1,4 @@
1
1
  module Envkey
2
- VERSION = "1.2.1"
3
- ENVKEY_FETCH_VERSION="1.2.1"
2
+ VERSION = "1.3.0"
3
+ ENVKEY_FETCH_VERSION="1.2.9"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: envkey
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dane Schneider
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-09-28 00:00:00.000000000 Z
11
+ date: 2021-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -83,30 +83,21 @@ files:
83
83
  - bin/console
84
84
  - bin/setup
85
85
  - envkey.gemspec
86
- - ext/envkey-fetch_1.2.1_darwin_386/LICENSE
87
- - ext/envkey-fetch_1.2.1_darwin_386/README.md
88
- - ext/envkey-fetch_1.2.1_darwin_386/envkey-fetch
89
- - ext/envkey-fetch_1.2.1_darwin_amd64/LICENSE
90
- - ext/envkey-fetch_1.2.1_darwin_amd64/README.md
91
- - ext/envkey-fetch_1.2.1_darwin_amd64/envkey-fetch
92
- - ext/envkey-fetch_1.2.1_freebsd_386/LICENSE
93
- - ext/envkey-fetch_1.2.1_freebsd_386/README.md
94
- - ext/envkey-fetch_1.2.1_freebsd_386/envkey-fetch
95
- - ext/envkey-fetch_1.2.1_freebsd_amd64/LICENSE
96
- - ext/envkey-fetch_1.2.1_freebsd_amd64/README.md
97
- - ext/envkey-fetch_1.2.1_freebsd_amd64/envkey-fetch
98
- - ext/envkey-fetch_1.2.1_linux_386/LICENSE
99
- - ext/envkey-fetch_1.2.1_linux_386/README.md
100
- - ext/envkey-fetch_1.2.1_linux_386/envkey-fetch
101
- - ext/envkey-fetch_1.2.1_linux_amd64/LICENSE
102
- - ext/envkey-fetch_1.2.1_linux_amd64/README.md
103
- - ext/envkey-fetch_1.2.1_linux_amd64/envkey-fetch
104
- - ext/envkey-fetch_1.2.1_windows_386/LICENSE
105
- - ext/envkey-fetch_1.2.1_windows_386/README.md
106
- - ext/envkey-fetch_1.2.1_windows_386/envkey-fetch.exe
107
- - ext/envkey-fetch_1.2.1_windows_amd64/LICENSE
108
- - ext/envkey-fetch_1.2.1_windows_amd64/README.md
109
- - ext/envkey-fetch_1.2.1_windows_amd64/envkey-fetch.exe
86
+ - ext/envkey-fetch_1.2.9_darwin_amd64/LICENSE
87
+ - ext/envkey-fetch_1.2.9_darwin_amd64/README.md
88
+ - ext/envkey-fetch_1.2.9_darwin_amd64/envkey-fetch
89
+ - ext/envkey-fetch_1.2.9_darwin_arm64/LICENSE
90
+ - ext/envkey-fetch_1.2.9_darwin_arm64/README.md
91
+ - ext/envkey-fetch_1.2.9_darwin_arm64/envkey-fetch
92
+ - ext/envkey-fetch_1.2.9_freebsd_amd64/LICENSE
93
+ - ext/envkey-fetch_1.2.9_freebsd_amd64/README.md
94
+ - ext/envkey-fetch_1.2.9_freebsd_amd64/envkey-fetch
95
+ - ext/envkey-fetch_1.2.9_linux_amd64/LICENSE
96
+ - ext/envkey-fetch_1.2.9_linux_amd64/README.md
97
+ - ext/envkey-fetch_1.2.9_linux_amd64/envkey-fetch
98
+ - ext/envkey-fetch_1.2.9_windows_amd64/LICENSE
99
+ - ext/envkey-fetch_1.2.9_windows_amd64/README.md
100
+ - ext/envkey-fetch_1.2.9_windows_amd64/envkey-fetch.exe
110
101
  - lib/envkey.rb
111
102
  - lib/envkey/core.rb
112
103
  - lib/envkey/fetch.rb
@@ -134,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
125
  version: '0'
135
126
  requirements: []
136
127
  rubyforge_project:
137
- rubygems_version: 2.7.4
128
+ rubygems_version: 2.6.14
138
129
  signing_key:
139
130
  specification_version: 4
140
131
  summary: Envkey secures and simplifies app secrets and config.
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright © 2017 Envkey Inc. <support@envkey.com>
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
@@ -1,86 +0,0 @@
1
- # envkey-fetch
2
-
3
- This library contains [EnvKey](https://www.envkey.com)'s core cross-platform fetching, decryption, verification, web of trust, redundancy, and caching logic. It accepts an `ENVKEY` generated by the [EnvKey App](https://www.github.com/envkey/envkey-app) and returns decrypted configuration for a specific app environment as json.
4
-
5
- It is used by EnvKey's various Client Libraries, including [envkey-source](https://github.com/envkey/envkey-source) for bash, [envkey-ruby](https://github.com/envkey/envkey-ruby) for Ruby and Rails, [envkey-python](https://github.com/envkey/envkey-python) for Python, [envkey-node](https://github.com/envkey/envkey-node) for Node.js, and [envkeygo](https://github.com/envkey/envkeygo) for Go.
6
-
7
- If you want to build an EnvKey library in a language that isn't yet officially supported, build some other type of integration, or simply play around with EnvKey on the command line, envkey-fetch is the library for you. If you just want to integrate EnvKey with your project, check out one of the aforementioned higher level libraries.
8
-
9
- ## Installation
10
-
11
- envkey-fetch compiles into a simple static binary with no dependencies, which makes installation a simple matter of fetching the right binary for your platform and putting it in your `PATH`. An `install.sh` script is available to simplify this.
12
-
13
- **Install via bash:**
14
-
15
- ```bash
16
- curl -s https://raw.githubusercontent.com/envkey/envkey-fetch/master/install.sh | bash
17
- ```
18
-
19
- **Install manually:**
20
-
21
- Find the [release](https://github.com/envkey/envkey-fetch/releases) for your platform and architecture, and stick the appropriate binary somewhere in your `PATH` (or wherever you like really).
22
-
23
- **Install from source:**
24
-
25
- With Go installed, clone the project into your `GOPATH`. `cd` into the directory and run `go get` and `go build`.
26
-
27
- **Cross-compile from source:**
28
-
29
- To compile cross-platform binaries, make sure Go is installed, then install [goreleaser](https://goreleaser.com/) - follow instructions in the docs to do so.
30
-
31
- Then to cross-compile, run:
32
-
33
- `goreleaser`
34
-
35
- Binaries for each platform will be output to the `dist` folder.
36
-
37
- ## Usage
38
-
39
- ```bash
40
- envkey-fetch YOUR-ENVKEY [flags]
41
- ```
42
-
43
- This will either write your the app environment's configuration associated with your `ENVKEY` as json to stdout or write an error message beginning with `error:` to stdout.
44
-
45
- ### Example json output
46
-
47
- ```json
48
- {"TEST":"it","TEST_2":"works!"}
49
- ```
50
-
51
- ### Example error output
52
-
53
- ```text
54
- error: ENVKEY invalid
55
- ```
56
-
57
- ### Flags
58
-
59
- ```text
60
- --cache cache encrypted config as a local backup (default is false)
61
- --cache-dir string cache directory (default is $HOME/.envkey/cache)
62
- -h, --help help for envkey-fetch
63
- -v, --version prints the version
64
- --verbose print verbose output (default is false)
65
- --timeout float timeout in seconds for http requests (default 2)
66
- ```
67
-
68
- ## Further Reading
69
-
70
- For more on EnvKey in general:
71
-
72
- Read the [docs](https://docs.envkey.com).
73
-
74
- Read the [integration quickstart](https://docs.envkey.com/integration-quickstart.html).
75
-
76
- Read the [security and cryptography overview](https://security.envkey.com).
77
-
78
- ## Need help? Have questions, feedback, or ideas?
79
-
80
- Post an [issue](https://github.com/envkey/envkey-fetch/issues) or email us: [support@envkey.com](mailto:support@envkey.com).
81
-
82
-
83
-
84
-
85
-
86
-
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright © 2017 Envkey Inc. <support@envkey.com>
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
@@ -1,86 +0,0 @@
1
- # envkey-fetch
2
-
3
- This library contains [EnvKey](https://www.envkey.com)'s core cross-platform fetching, decryption, verification, web of trust, redundancy, and caching logic. It accepts an `ENVKEY` generated by the [EnvKey App](https://www.github.com/envkey/envkey-app) and returns decrypted configuration for a specific app environment as json.
4
-
5
- It is used by EnvKey's various Client Libraries, including [envkey-source](https://github.com/envkey/envkey-source) for bash, [envkey-ruby](https://github.com/envkey/envkey-ruby) for Ruby and Rails, [envkey-python](https://github.com/envkey/envkey-python) for Python, [envkey-node](https://github.com/envkey/envkey-node) for Node.js, and [envkeygo](https://github.com/envkey/envkeygo) for Go.
6
-
7
- If you want to build an EnvKey library in a language that isn't yet officially supported, build some other type of integration, or simply play around with EnvKey on the command line, envkey-fetch is the library for you. If you just want to integrate EnvKey with your project, check out one of the aforementioned higher level libraries.
8
-
9
- ## Installation
10
-
11
- envkey-fetch compiles into a simple static binary with no dependencies, which makes installation a simple matter of fetching the right binary for your platform and putting it in your `PATH`. An `install.sh` script is available to simplify this.
12
-
13
- **Install via bash:**
14
-
15
- ```bash
16
- curl -s https://raw.githubusercontent.com/envkey/envkey-fetch/master/install.sh | bash
17
- ```
18
-
19
- **Install manually:**
20
-
21
- Find the [release](https://github.com/envkey/envkey-fetch/releases) for your platform and architecture, and stick the appropriate binary somewhere in your `PATH` (or wherever you like really).
22
-
23
- **Install from source:**
24
-
25
- With Go installed, clone the project into your `GOPATH`. `cd` into the directory and run `go get` and `go build`.
26
-
27
- **Cross-compile from source:**
28
-
29
- To compile cross-platform binaries, make sure Go is installed, then install [goreleaser](https://goreleaser.com/) - follow instructions in the docs to do so.
30
-
31
- Then to cross-compile, run:
32
-
33
- `goreleaser`
34
-
35
- Binaries for each platform will be output to the `dist` folder.
36
-
37
- ## Usage
38
-
39
- ```bash
40
- envkey-fetch YOUR-ENVKEY [flags]
41
- ```
42
-
43
- This will either write your the app environment's configuration associated with your `ENVKEY` as json to stdout or write an error message beginning with `error:` to stdout.
44
-
45
- ### Example json output
46
-
47
- ```json
48
- {"TEST":"it","TEST_2":"works!"}
49
- ```
50
-
51
- ### Example error output
52
-
53
- ```text
54
- error: ENVKEY invalid
55
- ```
56
-
57
- ### Flags
58
-
59
- ```text
60
- --cache cache encrypted config as a local backup (default is false)
61
- --cache-dir string cache directory (default is $HOME/.envkey/cache)
62
- -h, --help help for envkey-fetch
63
- -v, --version prints the version
64
- --verbose print verbose output (default is false)
65
- --timeout float timeout in seconds for http requests (default 2)
66
- ```
67
-
68
- ## Further Reading
69
-
70
- For more on EnvKey in general:
71
-
72
- Read the [docs](https://docs.envkey.com).
73
-
74
- Read the [integration quickstart](https://docs.envkey.com/integration-quickstart.html).
75
-
76
- Read the [security and cryptography overview](https://security.envkey.com).
77
-
78
- ## Need help? Have questions, feedback, or ideas?
79
-
80
- Post an [issue](https://github.com/envkey/envkey-fetch/issues) or email us: [support@envkey.com](mailto:support@envkey.com).
81
-
82
-
83
-
84
-
85
-
86
-
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright © 2017 Envkey Inc. <support@envkey.com>
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
@@ -1,86 +0,0 @@
1
- # envkey-fetch
2
-
3
- This library contains [EnvKey](https://www.envkey.com)'s core cross-platform fetching, decryption, verification, web of trust, redundancy, and caching logic. It accepts an `ENVKEY` generated by the [EnvKey App](https://www.github.com/envkey/envkey-app) and returns decrypted configuration for a specific app environment as json.
4
-
5
- It is used by EnvKey's various Client Libraries, including [envkey-source](https://github.com/envkey/envkey-source) for bash, [envkey-ruby](https://github.com/envkey/envkey-ruby) for Ruby and Rails, [envkey-python](https://github.com/envkey/envkey-python) for Python, [envkey-node](https://github.com/envkey/envkey-node) for Node.js, and [envkeygo](https://github.com/envkey/envkeygo) for Go.
6
-
7
- If you want to build an EnvKey library in a language that isn't yet officially supported, build some other type of integration, or simply play around with EnvKey on the command line, envkey-fetch is the library for you. If you just want to integrate EnvKey with your project, check out one of the aforementioned higher level libraries.
8
-
9
- ## Installation
10
-
11
- envkey-fetch compiles into a simple static binary with no dependencies, which makes installation a simple matter of fetching the right binary for your platform and putting it in your `PATH`. An `install.sh` script is available to simplify this.
12
-
13
- **Install via bash:**
14
-
15
- ```bash
16
- curl -s https://raw.githubusercontent.com/envkey/envkey-fetch/master/install.sh | bash
17
- ```
18
-
19
- **Install manually:**
20
-
21
- Find the [release](https://github.com/envkey/envkey-fetch/releases) for your platform and architecture, and stick the appropriate binary somewhere in your `PATH` (or wherever you like really).
22
-
23
- **Install from source:**
24
-
25
- With Go installed, clone the project into your `GOPATH`. `cd` into the directory and run `go get` and `go build`.
26
-
27
- **Cross-compile from source:**
28
-
29
- To compile cross-platform binaries, make sure Go is installed, then install [goreleaser](https://goreleaser.com/) - follow instructions in the docs to do so.
30
-
31
- Then to cross-compile, run:
32
-
33
- `goreleaser`
34
-
35
- Binaries for each platform will be output to the `dist` folder.
36
-
37
- ## Usage
38
-
39
- ```bash
40
- envkey-fetch YOUR-ENVKEY [flags]
41
- ```
42
-
43
- This will either write your the app environment's configuration associated with your `ENVKEY` as json to stdout or write an error message beginning with `error:` to stdout.
44
-
45
- ### Example json output
46
-
47
- ```json
48
- {"TEST":"it","TEST_2":"works!"}
49
- ```
50
-
51
- ### Example error output
52
-
53
- ```text
54
- error: ENVKEY invalid
55
- ```
56
-
57
- ### Flags
58
-
59
- ```text
60
- --cache cache encrypted config as a local backup (default is false)
61
- --cache-dir string cache directory (default is $HOME/.envkey/cache)
62
- -h, --help help for envkey-fetch
63
- -v, --version prints the version
64
- --verbose print verbose output (default is false)
65
- --timeout float timeout in seconds for http requests (default 2)
66
- ```
67
-
68
- ## Further Reading
69
-
70
- For more on EnvKey in general:
71
-
72
- Read the [docs](https://docs.envkey.com).
73
-
74
- Read the [integration quickstart](https://docs.envkey.com/integration-quickstart.html).
75
-
76
- Read the [security and cryptography overview](https://security.envkey.com).
77
-
78
- ## Need help? Have questions, feedback, or ideas?
79
-
80
- Post an [issue](https://github.com/envkey/envkey-fetch/issues) or email us: [support@envkey.com](mailto:support@envkey.com).
81
-
82
-
83
-
84
-
85
-
86
-
@@ -1,21 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright © 2017 Envkey Inc. <support@envkey.com>
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
@@ -1,86 +0,0 @@
1
- # envkey-fetch
2
-
3
- This library contains [EnvKey](https://www.envkey.com)'s core cross-platform fetching, decryption, verification, web of trust, redundancy, and caching logic. It accepts an `ENVKEY` generated by the [EnvKey App](https://www.github.com/envkey/envkey-app) and returns decrypted configuration for a specific app environment as json.
4
-
5
- It is used by EnvKey's various Client Libraries, including [envkey-source](https://github.com/envkey/envkey-source) for bash, [envkey-ruby](https://github.com/envkey/envkey-ruby) for Ruby and Rails, [envkey-python](https://github.com/envkey/envkey-python) for Python, [envkey-node](https://github.com/envkey/envkey-node) for Node.js, and [envkeygo](https://github.com/envkey/envkeygo) for Go.
6
-
7
- If you want to build an EnvKey library in a language that isn't yet officially supported, build some other type of integration, or simply play around with EnvKey on the command line, envkey-fetch is the library for you. If you just want to integrate EnvKey with your project, check out one of the aforementioned higher level libraries.
8
-
9
- ## Installation
10
-
11
- envkey-fetch compiles into a simple static binary with no dependencies, which makes installation a simple matter of fetching the right binary for your platform and putting it in your `PATH`. An `install.sh` script is available to simplify this.
12
-
13
- **Install via bash:**
14
-
15
- ```bash
16
- curl -s https://raw.githubusercontent.com/envkey/envkey-fetch/master/install.sh | bash
17
- ```
18
-
19
- **Install manually:**
20
-
21
- Find the [release](https://github.com/envkey/envkey-fetch/releases) for your platform and architecture, and stick the appropriate binary somewhere in your `PATH` (or wherever you like really).
22
-
23
- **Install from source:**
24
-
25
- With Go installed, clone the project into your `GOPATH`. `cd` into the directory and run `go get` and `go build`.
26
-
27
- **Cross-compile from source:**
28
-
29
- To compile cross-platform binaries, make sure Go is installed, then install [goreleaser](https://goreleaser.com/) - follow instructions in the docs to do so.
30
-
31
- Then to cross-compile, run:
32
-
33
- `goreleaser`
34
-
35
- Binaries for each platform will be output to the `dist` folder.
36
-
37
- ## Usage
38
-
39
- ```bash
40
- envkey-fetch YOUR-ENVKEY [flags]
41
- ```
42
-
43
- This will either write your the app environment's configuration associated with your `ENVKEY` as json to stdout or write an error message beginning with `error:` to stdout.
44
-
45
- ### Example json output
46
-
47
- ```json
48
- {"TEST":"it","TEST_2":"works!"}
49
- ```
50
-
51
- ### Example error output
52
-
53
- ```text
54
- error: ENVKEY invalid
55
- ```
56
-
57
- ### Flags
58
-
59
- ```text
60
- --cache cache encrypted config as a local backup (default is false)
61
- --cache-dir string cache directory (default is $HOME/.envkey/cache)
62
- -h, --help help for envkey-fetch
63
- -v, --version prints the version
64
- --verbose print verbose output (default is false)
65
- --timeout float timeout in seconds for http requests (default 2)
66
- ```
67
-
68
- ## Further Reading
69
-
70
- For more on EnvKey in general:
71
-
72
- Read the [docs](https://docs.envkey.com).
73
-
74
- Read the [integration quickstart](https://docs.envkey.com/integration-quickstart.html).
75
-
76
- Read the [security and cryptography overview](https://security.envkey.com).
77
-
78
- ## Need help? Have questions, feedback, or ideas?
79
-
80
- Post an [issue](https://github.com/envkey/envkey-fetch/issues) or email us: [support@envkey.com](mailto:support@envkey.com).
81
-
82
-
83
-
84
-
85
-
86
-