dit3-api 0.0.15 → 0.0.16
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/dit3/api/client.rb +0 -12
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4bbd616577c731488aa58dc33ffc709e3c4e8b26
|
|
4
|
+
data.tar.gz: 1c8590086db711235285c1d3190b806fb6951bac
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a3e980c8ef95c2e7965c28937d328cd00145473a046774f256beabe8505a1676ff9be623dbce7fddc336824e9018bcee03832cee431926158ac676ca44e61282
|
|
7
|
+
data.tar.gz: 9401c96c990bf61f53dc5a162e10a815e1d8ba7f9bf0b22970dc9b879cb088bc445212a9bb0fe93b31f0ef2af7154b415c2e69fa1afcd1a3788dfcc1454abf42
|
data/lib/dit3/api/client.rb
CHANGED
|
@@ -46,24 +46,12 @@ module DIT3::Api
|
|
|
46
46
|
if (!response.kind_of? Net::HTTPSuccess)
|
|
47
47
|
raise ApiError, "Failed to execute POST #{endpoint} request - #{request.code}"
|
|
48
48
|
end
|
|
49
|
-
#if !request.body.nil
|
|
50
|
-
# JSON.parse request.body
|
|
51
|
-
#else
|
|
52
|
-
# nil
|
|
53
|
-
#end
|
|
54
49
|
JSON.parse request.body
|
|
55
50
|
end
|
|
56
51
|
|
|
57
52
|
private
|
|
58
53
|
|
|
59
54
|
def get_token oauth_client, login, password
|
|
60
|
-
# opts = { :params => { :scope => oauth_client.normalize_scope(['platform.tenants.read', 'platform.tenants.write']) }}
|
|
61
|
-
# response = oauth_client.client_credentials.get_token(opts)
|
|
62
|
-
# if (!response.kind_of? Net::HTTPSuccess)
|
|
63
|
-
# raise ApiError, "Failed to get access token: #{response.body}"
|
|
64
|
-
# end
|
|
65
|
-
# response_body = JSON.parse(response.body)
|
|
66
|
-
# response_body['access_token']
|
|
67
55
|
response = oauth_client.password.get_token(login, password)
|
|
68
56
|
if (!response.kind_of? Net::HTTPSuccess)
|
|
69
57
|
raise ApiError, "Failed to get access token: #{response.body}"
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dit3-api
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.16
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Andrew Maraev
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-01-
|
|
11
|
+
date: 2018-01-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: DIT3 API Client
|
|
14
14
|
email: a.maraev@simbirsoft.com
|