rails_kms_credentials 0.0.3 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 75b923804031caddd3be015d207c02cdb9758d2dc98ebe527ee5ecd163823478
4
- data.tar.gz: 98fef79cee6c7910b8e665de1c99ce886159b4c903095321e751f0e1339e801d
3
+ metadata.gz: 44bc978f5ac247ec65a51df713cc84366e80c7ae27dcfe2e5c13f29eef1761f3
4
+ data.tar.gz: b91a33f301098c11373a5d9fa8516f53ac93c3799fc9ec94348d6bb9c6c49881
5
5
  SHA512:
6
- metadata.gz: 14f001897a77ad3664c9125a493992ec2586ee467e2b15c39beaa4ece0685ea29e2ed7281dc8258a17768884431f2dac8e38c0c630ea3ef7b92d1be28cebcbcf
7
- data.tar.gz: 257fddec2f37904ef64e578a1bb93e57c8573cf3dee5749fcac565801a79edd2d417669a6b979de3b76ed72618c6aa5da049212d37d3b08829b32126384766ac
6
+ metadata.gz: 50fd05f387be1c04f35098e771f37ec22f78ca52ea2cd06ac74221a4196ee43a34c4426df9064245edf584ed75a3f666bef3c1f67731e247e352ecd815f4f4b2
7
+ data.tar.gz: b5a23437fd1ddfa0f13783a6fb2ccee860f7f4b0a89cfcb37073c1ac34af1ff267a4706fe1f45ed69e17b484dcfcabf2814813f6a47993211f731dc0d72b11be
data/README.md CHANGED
@@ -1 +1,65 @@
1
1
  # rails-kms-credentials
2
+
3
+ This gem expands the capabilities of `Rails.application.credentials` to support fetching the credentials from a Key Management System.
4
+
5
+ ## Configuration
6
+ This gem will read `config/kms_credentials.yml` using `Rails.application.config_for`.
7
+
8
+ Key | Description
9
+ ---|---
10
+ `store` | [Stores](#stores) The Key Managedment System to use.
11
+
12
+ ## Stores
13
+
14
+ Key Management System | Config Value
15
+ ---|---
16
+ [Azure Key Vault](#azure-key-vault) | `azure_key_vault`
17
+
18
+ ### Azure Key Vault
19
+ Credentials will be loaded from a Key Vault's Secrets.
20
+
21
+ All hyphens (`-`) in a secret name will be replaced with underscores (`_`) when put into credentials (ex. `foo-bar` -> `foo_bar`).
22
+
23
+ Credentials can be nested by separating the parent key from the child key with `--` (ex. secret `foo--bar--baz` with a value of `test` will become `{foo: {bar: {baz: "test"}}}`.
24
+
25
+ Since Secrets cannot be empty in Azure Key Vault, if you need a key to show up in credentials, but need its value to be empty, then set the Secret's value to `--EMPTY--`.
26
+
27
+ #### Config
28
+ Key | Description
29
+ ---|---
30
+ `vault` | The name of the Key Vault
31
+ `client` | Client specific configuration. See [Client Types](#client-types).
32
+ `client.type` | The [Client Type](#client-types) to use.
33
+ `client.secret_prefix` | The prefix that all secrets for this application will have. See [Secret Prefix](#secret-prefix).
34
+
35
+ #### Secret Prefix
36
+ The prefix along with `----` will be added to the beginning of the secret name (ex. `prefix: abc123` -> `abc123----some-secret`)
37
+
38
+ #### Client Types
39
+
40
+ How to connect/authenticate to Azure Ket Vault.
41
+
42
+ Client | `client.type`
43
+ ---|---
44
+ [Managed Identity](#managed-identity) | `managed_identity`
45
+ [Client Credentials](#client-credentials) | `client_credentials`
46
+
47
+
48
+ ##### Managed Identity
49
+ This is the client to use when running on an [Azure VM](https://learn.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/how-to-use-vm-token).
50
+
51
+ **Config:**
52
+ Key | Description
53
+ ---|---
54
+ `client.type` | `managed_identity`
55
+
56
+
57
+ ##### Client Credentials
58
+ This is the client to use when connecting from outside of Azure. [See here](https://learn.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-client-creds-grant-flow).
59
+
60
+ **Config**
61
+ Key | Description
62
+ ---|---
63
+ `client.tenant_id` | The directory tenant the application plans to operate against, in GUID or domain-name format.
64
+ `client.client_id` | The application ID that's assigned to your app. You can find this information in the portal where you registered your app.
65
+ `client.client_secret` | The client secret that you generated for your app in the app registration portal.
@@ -4,9 +4,5 @@ module RailsKmsCredentials
4
4
  class Railtie < Rails::Railtie
5
5
  railtie_name :rails_kms_credentials
6
6
 
7
- rake_tasks do
8
- load 'tasks/credentials.rake'
9
- end
10
-
11
7
  end
12
8
  end
@@ -4,8 +4,8 @@ module RailsKmsCredentials
4
4
 
5
5
  module Version
6
6
  MAJOR = 0
7
- MINOR = 0
8
- PATCH = 3
7
+ MINOR = 1
8
+ PATCH = 0
9
9
 
10
10
  end
11
11
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_kms_credentials
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taylor Yelverton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-02 00:00:00.000000000 Z
11
+ date: 2022-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -72,7 +72,6 @@ files:
72
72
  - lib/rails_kms_credentials/store/azure_key_vault/client/managed_identity.rb
73
73
  - lib/rails_kms_credentials/store/base.rb
74
74
  - lib/rails_kms_credentials/version.rb
75
- - lib/tasks/credentials.rake
76
75
  - rails_kms_credentials.gemspec
77
76
  homepage: https://github.com/ComplyMD/rails_kms_credentials
78
77
  licenses:
@@ -1,8 +0,0 @@
1
- namespace :kms_creds do
2
- task :show, [:environment] do |_, args|
3
- end
4
-
5
- task :edit, [:environment] do |_, args|
6
- ENV['EDITOR'] += ' --wait' if ENV['EDITOR'].present? && (ENV['EDITOR'] == 'code' || ENV['EDITOR'].ends_with?('/code')) # Stupid fix for vscode exiting too quickly
7
- end
8
- end