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 +4 -4
- data/lib/heroku/api/postgres/client.rb +6 -7
- data/lib/heroku/api/postgres/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '068c61e088f38f3f0aabf5e4a5d9778a3385e36f55602b96e284eddba4421529'
|
4
|
+
data.tar.gz: 4dd38fedf703df59c5817fadc0c8aba30ba5f8079fd3aa522229f6ba640a8bc4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 :
|
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 '', @
|
85
|
+
req.basic_auth '', @client_key
|
87
86
|
end
|
88
87
|
|
89
88
|
def start_request(req, url)
|