ibm_cloud_sdk_core 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ibm_cloud_sdk_core/base_service.rb +2 -2
- data/lib/ibm_cloud_sdk_core/version.rb +1 -1
- data/test/unit/test_base_service.rb +10 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 108f15377b95818aea27fab08b01f262b75612b8d3c5f88a0550599b03d339ee
|
4
|
+
data.tar.gz: 4a41816b4102adb84696cd640c137f9b5b793c646255f5b47c35ee9737bf6df6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2fe5a66306d17e5dccf8696a785c34a2372bae8bc10d9e55999497226a8a1b898c68aa2fae910f7a88a6e55f4e3dcdbbc944b9a9ae6ed23d1f85b72fc0bb55b9
|
7
|
+
data.tar.gz: df65ed052783a7024274de70fd2a939a3e03b0346283eab6dd96a500a9f1d793cce54a19d780813771bd715037e2c8328e386f3f40c414b6d6b35d59ddf72368
|
@@ -68,7 +68,7 @@ module IBMCloudSdkCore
|
|
68
68
|
end
|
69
69
|
|
70
70
|
if @display_name && !@username && !@iam_apikey
|
71
|
-
service_name = @display_name.
|
71
|
+
service_name = @display_name.tr(" ", "_").downcase
|
72
72
|
load_from_credential_file(service_name)
|
73
73
|
@icp_prefix = @password&.start_with?("icp-") || @iam_apikey&.start_with?("icp-") ? true : false
|
74
74
|
end
|
@@ -256,7 +256,7 @@ module IBMCloudSdkCore
|
|
256
256
|
def set_credential_based_on_type(service_name, key, value)
|
257
257
|
return unless key.include?(service_name)
|
258
258
|
|
259
|
-
@iam_apikey = value if key.include?("iam_apikey")
|
259
|
+
@iam_apikey = value if key.include?("iam_apikey") || key.include?("apikey")
|
260
260
|
@iam_url = value if key.include?("iam_url")
|
261
261
|
@url = value if key.include?("url")
|
262
262
|
@username = value if key.include?("username")
|
@@ -68,6 +68,16 @@ class BaseServiceTest < Minitest::Test
|
|
68
68
|
ENV.delete("IBM_CREDENTIALS_FILE")
|
69
69
|
end
|
70
70
|
|
71
|
+
def test_set_credentials_from_path_in_env_nlu
|
72
|
+
file_path = File.join(File.dirname(__FILE__), "../../resources/ibm-credentials.env")
|
73
|
+
ENV["IBM_CREDENTIALS_FILE"] = file_path
|
74
|
+
service = IBMCloudSdkCore::BaseService.new(display_name: "Natural Language Understanding")
|
75
|
+
assert_equal(service.url, "https://gateway.messi.com")
|
76
|
+
assert_equal(service.token_manager.instance_variable_get(:@iam_apikey), "salah")
|
77
|
+
refute_nil(service)
|
78
|
+
ENV.delete("IBM_CREDENTIALS_FILE")
|
79
|
+
end
|
80
|
+
|
71
81
|
def test_vcap_services
|
72
82
|
ENV["VCAP_SERVICES"] = JSON.parse(File.read(Dir.getwd + "/resources/vcap-testing.json")).to_json
|
73
83
|
service = IBMCloudSdkCore::BaseService.new(vcap_services_name: "salah", use_vcap_services: true)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ibm_cloud_sdk_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mamoon Raja
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-08-
|
11
|
+
date: 2019-08-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -265,7 +265,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
265
265
|
- !ruby/object:Gem::Version
|
266
266
|
version: '0'
|
267
267
|
requirements: []
|
268
|
-
|
268
|
+
rubyforge_project:
|
269
|
+
rubygems_version: 2.7.7
|
269
270
|
signing_key:
|
270
271
|
specification_version: 4
|
271
272
|
summary: Official IBM Cloud SDK core library
|