rails_kms_credentials 0.1.1 → 0.2.1

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: ffcfd3a08a85870fd8b6766fe27ab31e56f3955e3ab896017ea9d2589da1ca01
4
- data.tar.gz: b50ad3a3cef7961756cac6b67c3dee6819755310bd4941897d6fdd8a3d5741d4
3
+ metadata.gz: 532e8e95ed3635abe5c43507b35822004aba639aa7e54c6288e2d7c67c206c9b
4
+ data.tar.gz: 30bd1527ede5fd129a31941a5252b98196ce1b12c997f10576c29c83ed583b9d
5
5
  SHA512:
6
- metadata.gz: fdfe4826eed0375403edbfaa0a308c937fe7d611eb8017ce8db072b9d93400b6033bcf806c311777dd75f38c4e965d9c3c5e06384cb1dc609c6b64366b58259d
7
- data.tar.gz: b66eb3b4d6c86d2d218f427b31647844efc89d7dc0b13e8489296c6a63071f71b3cca15da2664de4c1189b9f6dc14b604e64f75b2689d0e0dcfc265e1c7cd242
6
+ metadata.gz: 9b76e471786e5ac4d9ab8e1017e23916fcd469f1144e5352e72d25e644cc9e646bd8e7823b7629254723f11c30a60fba819e402d1405079033e3f26338c6bbe1
7
+ data.tar.gz: 616d9251fb153f967579886457d0370651a17425e693cb31af31c9966f1bb9a88713036bf455ca120095b6ace6ad84f2f72b3d0457b13a253a654d3685a3873f
@@ -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
  }
@@ -23,7 +23,7 @@ module RailsKmsCredentials
23
23
  @client = @_client_klass.new self
24
24
  @secret_prefix = case config['client']['secret_prefix']
25
25
  when true
26
- Rails.application.class.parent.to_s.underscore.dasherize
26
+ Rails.application.class.name.split('::').first.underscore.dasherize
27
27
  when String
28
28
  config['client']['secret_prefix']
29
29
  end
@@ -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 = 1
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.1
4
+ version: 0.2.1
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-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport