digifi_api 2.0.0 → 2.0.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 82f3b1ce01a6bb111593152809df5151bc91adc8d065e5dfad8d5caeae92ed1b
4
- data.tar.gz: a1f6a73b451e71c2677392d196b9051fdfc7c7897e4ae62d967863c177e6b626
2
+ SHA1:
3
+ metadata.gz: 583124d9612e11aa5ff17c6cb865e9acbce3bf8a
4
+ data.tar.gz: a1c05711f35d4dfbce804487312e2362c1ac4900
5
5
  SHA512:
6
- metadata.gz: b62b6f8b1539b29586e1198d16b84cd4f6688ec6a9258a2836141a5c4b3be68b44a1c34d41b38a8d7fa45c7fdd75329b1679f5e40f38d3b848478ddc92da2784
7
- data.tar.gz: e213f96208f0d352bcbb4f844bf3bdc64f055105bd488f712c264255baf93e7267c5b69af1234a1a509308c4012e9ce8ba5f8eb15b2476c7ff4aefd4a2544372
6
+ metadata.gz: 968466570b31f5a271fc29a2c768a3010e11e63989a7463836b71d74866c20cdbd811cacb6a9135565c8c4fe059c133650e66d3bb86b972fdc3d94ed6e74cfc8
7
+ data.tar.gz: 9470bf1d94a0016625afa55393cd205b2cd24b4c2e0dab37d39f8e8e835a7e43cf9c81c4e833cd881d7baa1696e1c90b3bdcc27a36f66d60c5ee99916322729e
data/.gitignore CHANGED
@@ -11,3 +11,4 @@
11
11
  .rspec_status
12
12
 
13
13
  .DS_Store
14
+ *.gem
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- digifi_api (2.0.0)
4
+ digifi_api (2.0.1)
5
5
  json (~> 2.1.0)
6
6
  rest-client (~> 2.0.2)
7
7
 
@@ -60,7 +60,7 @@ PLATFORMS
60
60
  ruby
61
61
 
62
62
  DEPENDENCIES
63
- bundler (~> 1.16)
63
+ bundler (~> 2.0.1)
64
64
  digifi_api!
65
65
  pry (~> 0.11.3)
66
66
  rake (~> 10.0)
@@ -68,4 +68,4 @@ DEPENDENCIES
68
68
  webmock (~> 3.4.2)
69
69
 
70
70
  BUNDLED WITH
71
- 1.16.4
71
+ 2.0.1
data/README.md CHANGED
@@ -20,29 +20,20 @@ Or install it yourself as:
20
20
 
21
21
  $ gem install digifi_api
22
22
 
23
- ## Setup in Rails
24
-
25
- 1. Add configuration for each environment in config/secrets.yml or whatever your strategy is for storing sensitive variables.
23
+ ## Setup in Rails 5.2+ (Encrypted Credentials)
26
24
 
25
+ 1. Add configuration to config/credentials.yml.enc (change atom to your preferred text editor)
26
+
27
+ ```
28
+ EDITOR="atom --wait" rails credentials:edit
29
+ ```
30
+
27
31
  ```yaml
28
- development:
29
- digifi_api:
30
- client_id: 'yourclientidhere'
31
- client_app_key: 'yourclientappkeyhere'
32
- secret: 'yoursecrethere'
33
- base_uri: 'https://cloud.digifi.io/api/v2'
34
- test:
35
- digifi_api:
36
- client_id: 'yourclientidhere'
37
- client_app_key: 'yourclientappkeyhere'
38
- secret: 'yoursecrethere'
39
- base_uri: 'https://cloud.digifi.io/api/v2'
40
- production:
41
- digifi_api:
42
- client_id: 'yourclientidhere'
43
- client_app_key: 'yourclientappkeyhere'
44
- secret: 'yoursecrethere'
45
- base_uri: 'https://cloud.digifi.io/api/v2'
32
+ digifi_api:
33
+ client_id: 'yourclientidhere'
34
+ client_public_key: 'yourclientpublickeyhere'
35
+ secret: 'yoursecrethere'
36
+ base_uri: 'https://cloud.digifi.io/api/v2'
46
37
  ```
47
38
 
48
39
  2. Create an initializer: /config/initializers/digifi_api.rb
@@ -51,10 +42,10 @@ Or install it yourself as:
51
42
 
52
43
  ```ruby
53
44
  DigifiApi.configure do |config|
54
- config.client_id = Rails.application.secrets.digifi_api.client_id
55
- config.client_public_key = Rails.application.secrets.digifi_api.client_app_key
56
- config.secret = Rails.application.secrets.digifi_api.secret
57
- end
45
+ config.client_id = Rails.application.credentials.digifi_api[:client_id]
46
+ config.client_public_key = Rails.application.credentials.digifi_api[:client_public_key]
47
+ config.secret = Rails.application.credentials.digifi_api[:secret]
48
+ end
58
49
  ```
59
50
 
60
51
  ## Usage
@@ -96,4 +87,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
96
87
 
97
88
  ## Code of Conduct
98
89
 
99
- Everyone interacting in the DigifiApi project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/digifi_api/blob/master/CODE_OF_CONDUCT.md).
90
+ Everyone interacting in the DigifiApi project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/justinlyman/digifi_api/blob/master/CODE_OF_CONDUCT.md).
data/digifi_api.gemspec CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
24
24
  spec.require_paths = ["lib"]
25
25
 
26
26
  # Development Dependencies
27
- spec.add_development_dependency "bundler", "~> 1.16"
27
+ spec.add_development_dependency "bundler", "~> 2.0.1"
28
28
  spec.add_development_dependency "rake", "~> 10.0"
29
29
  spec.add_development_dependency "rspec", "~> 3.0"
30
30
  spec.add_development_dependency "pry", "~> 0.11.3"
@@ -13,6 +13,7 @@ module DigifiApi
13
13
  body_hash['client_id'] = DigifiApi.configuration.client_id
14
14
  body_hash['client_public_key'] = DigifiApi.configuration.client_public_key
15
15
  body_hash['client_secret'] = DigifiApi.configuration.secret
16
+ body_hash['x-access-token'] = DigifiApi.configuration.x_access_token unless DigifiApi.configuration.x_access_token.nil?
16
17
  body_hash.merge!(elements)
17
18
  end
18
19
 
@@ -1,11 +1,12 @@
1
1
  module DigifiApi
2
2
  class Configuration
3
3
 
4
- attr_accessor :client_id, :client_public_key, :secret, :base_uri
4
+ attr_accessor :client_id, :client_public_key, :secret, :base_uri, :x_access_token
5
5
 
6
6
  DEFAULT_CLIENT_ID = nil
7
7
  DEFAULT_CLIENT_PUBLIC_KEY = nil
8
8
  DEFAULT_SECRET = nil
9
+ DEFAULT_X_ACCESS_TOKEN = nil
9
10
  DEFAULT_BASE_URI = 'https://cloud.digifi.io/api/v2'
10
11
 
11
12
  def initialize
@@ -13,6 +14,7 @@ module DigifiApi
13
14
  @client_public_key = DEFAULT_CLIENT_ID
14
15
  @secret = DEFAULT_SECRET
15
16
  @base_uri = DEFAULT_BASE_URI
17
+ @x_access_token = DEFAULT_X_ACCESS_TOKEN
16
18
  end
17
19
 
18
20
  def configured?
@@ -27,6 +29,7 @@ module DigifiApi
27
29
  @client_public_key = DEFAULT_CLIENT_ID
28
30
  @secret = DEFAULT_SECRET
29
31
  @base_uri = DEFAULT_BASE_URI
32
+ @x_access_token = DEFAULT_X_ACCESS_TOKEN
30
33
  end
31
34
  end
32
35
  end
@@ -1,3 +1,3 @@
1
1
  module DigifiApi
2
- VERSION = "2.0.0"
2
+ VERSION = "2.0.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: digifi_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - 'Justin Lyman
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2018-09-19 00:00:00.000000000 Z
13
+ date: 2019-01-29 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -18,14 +18,14 @@ dependencies:
18
18
  requirements:
19
19
  - - "~>"
20
20
  - !ruby/object:Gem::Version
21
- version: '1.16'
21
+ version: 2.0.1
22
22
  type: :development
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - "~>"
27
27
  - !ruby/object:Gem::Version
28
- version: '1.16'
28
+ version: 2.0.1
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: rake
31
31
  requirement: !ruby/object:Gem::Requirement
@@ -156,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
156
156
  version: '0'
157
157
  requirements: []
158
158
  rubyforge_project:
159
- rubygems_version: 2.7.6
159
+ rubygems_version: 2.5.1
160
160
  signing_key:
161
161
  specification_version: 4
162
162
  summary: DigiFi API wrapper