heroku-api-postgres 0.13.0 → 0.13.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
2
  SHA256:
3
- metadata.gz: 96105ebed19f8f800dfb2dc71a8ce22d58feac51f07e7ea6963b64558c7eaea9
4
- data.tar.gz: 34aea14eb3bf6b0639f3f66f93b9a42862e564e8d106b4c1de7fa8fb00c2561c
3
+ metadata.gz: '068c61e088f38f3f0aabf5e4a5d9778a3385e36f55602b96e284eddba4421529'
4
+ data.tar.gz: 4dd38fedf703df59c5817fadc0c8aba30ba5f8079fd3aa522229f6ba640a8bc4
5
5
  SHA512:
6
- metadata.gz: 9006afb4de11724c4f3b57fb9ecb19cc09b51361cdc1dd9d157fd3123f339f83321bbc8be1ce9f2dc1ee17d2398ca9f23edbe67cec940caa1b8a63bd262568cb
7
- data.tar.gz: 80e566c5ee325a112cec56a3af719ef996759482f165122b059d743389dbf1292b0f30c41d2c70f1625fa09a678778f80f3eca54240fe47c05ff55cdaa527911
6
+ metadata.gz: e213229069ed6becccfb9507a7fab2802bb99fc6011d44d1e38bced810ca4fd2fb95e0ff32a13f7fb4cc7c5d7d4223f91a48301709459e4e24aa51079fb8bd89
7
+ data.tar.gz: 065a0a1a12b149eb87147685de8c9ef013d89dcd4f4d830aec56295c2504d7c6b812b5b8bca0af646b0a0d4df20494022d7666105c327864cd8c666d11dd7b51
@@ -4,15 +4,13 @@ module Heroku
4
4
  module Api
5
5
  module Postgres
6
6
  def self.connect(api_key = ENV.fetch('HEROKU_API_KEY', nil))
7
- Client.new.tap do |c|
8
- c.api_key = api_key
7
+ Client.new(api_key).tap do |c|
9
8
  c.heroku_client = PlatformAPI.connect(api_key)
10
9
  end
11
10
  end
12
11
 
13
12
  def self.connect_oauth(oauth_client_key = ENV.fetch('HEROKU_OAUTH_TOKEN', nil))
14
- Client.new.tap do |c|
15
- c.oauth_client_key = oauth_client_key
13
+ Client.new(oauth_client_key).tap do |c|
16
14
  c.heroku_client = PlatformAPI.connect_oauth(oauth_client_key)
17
15
  end
18
16
  end
@@ -21,9 +19,10 @@ module Heroku
21
19
  STARTER_HOST = 'https://postgres-starter-api.heroku.com'
22
20
  PRO_HOST = 'https://postgres-api.heroku.com'
23
21
 
24
- attr_accessor :api_key, :oauth_client_key, :heroku_client
22
+ attr_accessor :client_key, :heroku_client
25
23
 
26
- def initialize
24
+ def initialize(client_key)
25
+ @client_key = client_key
27
26
  @basic_url = STARTER_HOST
28
27
  end
29
28
 
@@ -83,7 +82,7 @@ module Heroku
83
82
 
84
83
  def add_auth_headers(req)
85
84
  req['Accept'] = 'application/vnd.heroku+json; version=3'
86
- req.basic_auth '', @oauth_client_key
85
+ req.basic_auth '', @client_key
87
86
  end
88
87
 
89
88
  def start_request(req, url)
@@ -3,7 +3,7 @@
3
3
  module Heroku
4
4
  module Api
5
5
  module Postgres
6
- VERSION = '0.13.0'
6
+ VERSION = '0.13.1'
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heroku-api-postgres
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.13.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alessandro Rodi