kinetic_sdk 5.0.1 → 5.0.2.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kinetic_sdk/core/lib/jwt.rb +8 -9
- data/lib/kinetic_sdk/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f9331c7328d2187ea95746a7a2952f44e3ac1b198f8cabf566ea6ff5b58a8ac
|
4
|
+
data.tar.gz: d50e2d48718544ecfe32dd0e20b4abdfa76d4a1eeef00b18067a7c5c64231ac5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90422f1dfed6388eda26173b3b4fbd4a11c0d4accc04339d8a7d26e57230fecddc61cf42f15d5f5b0daeaf3dc2914d4a30f1bd2f28097b252bd002104ec9fde5
|
7
|
+
data.tar.gz: e76f1cd79404430b6c77df063f9f408e498d450fa91e64ffbf90104dd33d9fdd3687bf8f6008eadde20c1bf5b7503704710cac91172cea6e72ce5e4f6d228f8f
|
@@ -7,14 +7,14 @@ module KineticSdk
|
|
7
7
|
# @param client_secret [String] the oauth client secret
|
8
8
|
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
9
9
|
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
10
|
-
def jwt_token(client_id, client_secret, headers=default_headers)
|
10
|
+
def jwt_token(client_id, client_secret, headers = default_headers)
|
11
11
|
# retrieve the jwt code
|
12
12
|
jwt_code = jwt_code(client_id, headers)
|
13
13
|
# retrieve the jwt token
|
14
14
|
@logger.info("Retrieving JWT authorization token")
|
15
15
|
url = "#{@server}/app/oauth/token?grant_type=authorization_code&response_type=token&client_id=#{client_id}&code=#{jwt_code}"
|
16
16
|
token_headers = header_accept_json.merge(header_basic_auth(client_id, client_secret))
|
17
|
-
response = post(url, {}, token_headers
|
17
|
+
response = post(url, {}, token_headers)
|
18
18
|
|
19
19
|
if response.status == 401
|
20
20
|
raise StandardError.new "#{response.message}, the oauth client id and secret are invalid."
|
@@ -29,18 +29,18 @@ module KineticSdk
|
|
29
29
|
#
|
30
30
|
# This method should really never need to be called externally.
|
31
31
|
#
|
32
|
-
# @param client_id [String]
|
32
|
+
# @param client_id [String]
|
33
33
|
# @param headers [Hash] hash of headers to send, default is basic authentication and accept JSON content type
|
34
34
|
# @return [KineticSdk::Utils::KineticHttpResponse] object, with +code+, +message+, +content_string+, and +content+ properties
|
35
|
-
def jwt_code(client_id, headers=default_headers)
|
35
|
+
def jwt_code(client_id, headers = default_headers)
|
36
36
|
@logger.info("Retrieving JWT authorization code")
|
37
37
|
url = "#{@server}/app/oauth/authorize?grant_type=authorization_code&response_type=code&client_id=#{client_id}"
|
38
|
-
response = post(url, {}, headers
|
38
|
+
response = post(url, {}, headers)
|
39
39
|
|
40
40
|
if response.status == 401
|
41
|
-
raise StandardError.new "#{response.message}: #{response.content[
|
41
|
+
raise StandardError.new "#{response.message}: #{response.content["error"]}"
|
42
42
|
elsif response.status == 302
|
43
|
-
location = response.headers[
|
43
|
+
location = response.headers["location"]
|
44
44
|
if location.nil?
|
45
45
|
raise StandardError.new "Unable to retrieve code: #{response.inspect}"
|
46
46
|
else
|
@@ -50,6 +50,5 @@ module KineticSdk
|
|
50
50
|
raise StandardError.new "Unable to retrieve code #{response.inspect}"
|
51
51
|
end
|
52
52
|
end
|
53
|
-
|
54
53
|
end
|
55
|
-
end
|
54
|
+
end
|
data/lib/kinetic_sdk/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kinetic_sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.1
|
4
|
+
version: 5.0.2.beta.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kinetic Data
|
@@ -417,9 +417,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
417
417
|
version: '0'
|
418
418
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
419
419
|
requirements:
|
420
|
-
- - "
|
420
|
+
- - ">"
|
421
421
|
- !ruby/object:Gem::Version
|
422
|
-
version:
|
422
|
+
version: 1.3.1
|
423
423
|
requirements: []
|
424
424
|
rubygems_version: 3.0.6
|
425
425
|
signing_key:
|