navi_client 1.1.6 → 1.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cloud/navi_cloud_client.rb +2 -3
- data/lib/http_service/naviai.rb +2 -2
- data/lib/local/navi_local_client.rb +2 -1
- data/lib/navi_client/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: 77d9a804a7dfe610613f578bf9b1c0f20b4c9456292532a5dc3a6a2056ad9193
|
4
|
+
data.tar.gz: c8ccdbb6a82dee0d807049024bb9af985fb0fd95fecd08bc8b15caa647669217
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eeb3417a1638e21dc767101cfc01872d508c288b42d7359068ae4a661543bb98d6d0b2318f05fa6b725250a0cb0929709436377440fdee0d3ed13c0df124eca2
|
7
|
+
data.tar.gz: baaeb601a245008e72e24b3f8a25764ebb1851d535651acdc4046b1421bb26b4a268af5013b581974d7eadca03454eaa2de9c34c7f7d5706246628049e31fd9f
|
@@ -3,7 +3,7 @@ require Gem::Specification.find_by_name("navi_client").gem_dir+"/lib/client"
|
|
3
3
|
module NaviClient
|
4
4
|
class Cloud
|
5
5
|
include Client
|
6
|
-
def initialize(sso_web_url = "http://localhost:3008/"
|
6
|
+
def initialize(sso_web_url = "http://localhost:3008/")
|
7
7
|
# flag to print Ruby library debug info (very detailed)
|
8
8
|
@net_imap_debug = false
|
9
9
|
|
@@ -19,7 +19,6 @@ module NaviClient
|
|
19
19
|
@sso_web_url = sso_web_url
|
20
20
|
# authentication token received from sso_web used to authenticate the request to database_api
|
21
21
|
@token = nil
|
22
|
-
@current_user = current_user
|
23
22
|
|
24
23
|
# client_type
|
25
24
|
@client_type = "cloud"
|
@@ -44,7 +43,7 @@ module NaviClient
|
|
44
43
|
filepath = download_path + "/inputs/" + (Time.now.to_f * 1000).to_s
|
45
44
|
filename = upload_to_s3(filepath, in_filenames.join("\n"))
|
46
45
|
|
47
|
-
HTTPService::NaviAI.start(filename, @client_type, @token
|
46
|
+
HTTPService::NaviAI.start(filename, @client_type, @token)
|
48
47
|
end
|
49
48
|
end
|
50
49
|
|
data/lib/http_service/naviai.rb
CHANGED
@@ -3,12 +3,12 @@ require "httparty"
|
|
3
3
|
module HTTPService
|
4
4
|
class NaviAI
|
5
5
|
|
6
|
-
def self.start(file_path, client_type, token
|
6
|
+
def self.start(file_path, client_type, token)
|
7
7
|
go_url = 'http://localhost:9090/v2/metas'
|
8
8
|
if client_type == 'cloud'
|
9
9
|
go_url = 'http://34.214.134.104:9090/v2/metas'
|
10
10
|
end
|
11
|
-
HTTParty.post(go_url, body: { client_type: client_type, list_meta_path: file_path, token: token
|
11
|
+
HTTParty.post(go_url, body: { client_type: client_type, list_meta_path: file_path, token: token }.to_json)
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
@@ -33,13 +33,14 @@ module NaviClient
|
|
33
33
|
def login
|
34
34
|
url = "#{@sso_web_url}/oauth/token"
|
35
35
|
provider_url = url
|
36
|
-
|
36
|
+
token = HTTParty.post(provider_url,
|
37
37
|
body: {
|
38
38
|
client_id: config["uid"], # get from sso_web application
|
39
39
|
client_secret: config["secret_key"],
|
40
40
|
grant_type: "client_credentials"
|
41
41
|
}
|
42
42
|
)['access_token']
|
43
|
+
@token = "Token: #{token}##{config['username']}"
|
43
44
|
end
|
44
45
|
|
45
46
|
def download(message, custom_uid)
|
data/lib/navi_client/version.rb
CHANGED