rails_kms_credentials 0.1.0 → 0.2.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: 44bc978f5ac247ec65a51df713cc84366e80c7ae27dcfe2e5c13f29eef1761f3
4
- data.tar.gz: b91a33f301098c11373a5d9fa8516f53ac93c3799fc9ec94348d6bb9c6c49881
3
+ metadata.gz: a26eb0c9f7955c0194d458d7885c1111ef00b091479400e87117d50627cd8aa8
4
+ data.tar.gz: fbd4f98d7e786ec2e83ee5ae40cc078e655d34461195cab057584648d0c78019
5
5
  SHA512:
6
- metadata.gz: 50fd05f387be1c04f35098e771f37ec22f78ca52ea2cd06ac74221a4196ee43a34c4426df9064245edf584ed75a3f666bef3c1f67731e247e352ecd815f4f4b2
7
- data.tar.gz: b5a23437fd1ddfa0f13783a6fb2ccee860f7f4b0a89cfcb37073c1ac34af1ff267a4706fe1f45ed69e17b484dcfcabf2814813f6a47993211f731dc0d72b11be
6
+ metadata.gz: 4013a1ff4b2df35b2cdb7569b00654a70cc552f83adb43ea9b177264470f125c0bcd4c0456355b041e877dadf07399d042981353fbb7a04f3eafa321523ba271
7
+ data.tar.gz: bd2c6472a47b2746e7cca38dfab08b476a74d2b989a65b3ffced87aead5a5d77c565f860e8e797740f4c313d417be25ec312cb78044eec68b94943726084168f
data/README.md CHANGED
@@ -33,7 +33,8 @@ Key | Description
33
33
  `client.secret_prefix` | The prefix that all secrets for this application will have. See [Secret Prefix](#secret-prefix).
34
34
 
35
35
  #### Secret Prefix
36
- The prefix along with `----` will be added to the beginning of the secret name (ex. `prefix: abc123` -> `abc123----some-secret`)
36
+ The prefix along with `----` will be added to the beginning of the secret name (ex. `prefix: abc123` -> `abc123----some-secret`). May be specified with a string, or using your application's name by passing `true` (will use `Rails.application.class.parent.to_s.underscore.dasherize`).
37
+
37
38
 
38
39
  #### Client Types
39
40
 
@@ -21,6 +21,12 @@ module RailsKmsCredentials
21
21
  raise NotImplementedError
22
22
  end
23
23
 
24
+ private
25
+
26
+ def client_config
27
+ config['client']
28
+ end
29
+
24
30
  end
25
31
  end
26
32
  end
@@ -37,10 +37,6 @@ module RailsKmsCredentials
37
37
 
38
38
  private
39
39
 
40
- def client_config
41
- config['client']
42
- end
43
-
44
40
  def access_token
45
41
  return @access_token if instance_variable_defined?(:@access_token)
46
42
  @_access_token_response = HTTParty.post(
@@ -27,8 +27,10 @@ module RailsKmsCredentials
27
27
 
28
28
  def access_token
29
29
  return @access_token if instance_variable_defined?(:@access_token)
30
+ url = 'http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https%3A%2F%2Fvault.azure.net'
31
+ url += "&client_id=#{client_config['client_id']}" if client_config['client_id']
30
32
  @_access_token_response = HTTParty.get(
31
- 'http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https%3A%2F%2Fvault.azure.net',
33
+ url,
32
34
  {
33
35
  headers: { Metadata: 'true' },
34
36
  }
@@ -4,7 +4,7 @@ module RailsKmsCredentials
4
4
 
5
5
  module Version
6
6
  MAJOR = 0
7
- MINOR = 1
7
+ MINOR = 2
8
8
  PATCH = 0
9
9
 
10
10
  end
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.1.0
4
+ version: 0.2.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-10 00:00:00.000000000 Z
11
+ date: 2022-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport