api_six_client 1.4.16 → 1.5.0
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/Gemfile.lock +8 -8
- data/lib/api_six_client/base.rb +4 -4
- data/lib/api_six_client/base_int.rb +34 -0
- data/lib/api_six_client/version.rb +1 -1
- data/lib/api_six_client.rb +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9db8650771e465e6729f39101d19a0e6e79544ab7f4db05cfd8580fb407795f
|
4
|
+
data.tar.gz: 255a98907f3d462d9a096de7df97e53cb8eb63816b24a4e384a8fc3aa478049d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae91577c0f327b5f45b0fb8da7bedcb8542234dff046f6ce8f9b9ab67a12dbfb0da1201c215209e812a14b868a3d99221c2d51b4e1fbd49e897410648708303b
|
7
|
+
data.tar.gz: 999945912ab69b3853d24a1459af79315171f07ccda65cbe7719dbc98f2d22efc1fab4205c584918884e8e921ba722abeaa37d0e86e4f969eb64faea4db71ddd
|
data/Gemfile.lock
CHANGED
@@ -1,20 +1,20 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
api_six_client (1.
|
4
|
+
api_six_client (1.5.0)
|
5
5
|
faraday (~> 2)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
10
|
+
faraday (2.9.0)
|
11
|
+
faraday-net_http (>= 2.0, < 3.2)
|
12
|
+
faraday-net_http (3.1.0)
|
13
|
+
net-http
|
14
|
+
net-http (0.4.1)
|
15
|
+
uri
|
16
16
|
rake (13.0.6)
|
17
|
-
|
17
|
+
uri (0.13.0)
|
18
18
|
|
19
19
|
PLATFORMS
|
20
20
|
arm64-darwin-21
|
data/lib/api_six_client/base.rb
CHANGED
@@ -47,6 +47,10 @@ module ApiSixClient
|
|
47
47
|
@auth_token ||= ApiSixClient.config.auth_token
|
48
48
|
end
|
49
49
|
|
50
|
+
def service_path
|
51
|
+
self.class.name.demodulize.underscore
|
52
|
+
end
|
53
|
+
|
50
54
|
private
|
51
55
|
|
52
56
|
def validate_config!
|
@@ -54,10 +58,6 @@ module ApiSixClient
|
|
54
58
|
raise Errors::AuthTokenIsEmpty unless @auth_token
|
55
59
|
end
|
56
60
|
|
57
|
-
def service_path
|
58
|
-
self.class.name.demodulize.underscore
|
59
|
-
end
|
60
|
-
|
61
61
|
def request(method, path, params = {}, headers = {})
|
62
62
|
deprecation_msg
|
63
63
|
|
@@ -2,6 +2,21 @@
|
|
2
2
|
|
3
3
|
module ApiSixClient
|
4
4
|
class BaseInt < Base
|
5
|
+
DEFAULT_INTRANET_MAPPING = ->(service_name) {
|
6
|
+
{ k8s_service: "http://#{service_name.gsub('_int', '-api')}", api_int_path: 'api_int'}
|
7
|
+
}
|
8
|
+
INTRANET_MAPPING = {
|
9
|
+
'olc_int' => { k8s_service: 'http://core-web:3000', api_int_path: 'api_hiden' },
|
10
|
+
'cad_int' => { k8s_service: 'http://core-web:3000', api_int_path: 'api_int' },
|
11
|
+
'val' => { k8s_service: 'http://val:8000', api_int_path: 'api' },
|
12
|
+
}.freeze
|
13
|
+
|
14
|
+
def endpoint
|
15
|
+
return super unless intranet_connection?
|
16
|
+
|
17
|
+
current_service[:k8s_service]
|
18
|
+
end
|
19
|
+
|
5
20
|
protected
|
6
21
|
|
7
22
|
def deprecation_msg
|
@@ -11,5 +26,24 @@ module ApiSixClient
|
|
11
26
|
@endpoint = ApiSixClient.config.endpoint_int
|
12
27
|
@auth_token = ApiSixClient.config.auth_token_int
|
13
28
|
end
|
29
|
+
|
30
|
+
def service_path
|
31
|
+
return super unless intranet_connection?
|
32
|
+
|
33
|
+
current_service[:api_int_path]
|
34
|
+
end
|
35
|
+
|
36
|
+
def intranet_connection?
|
37
|
+
return false if ENV['RAILS_ENV'] == 'development'
|
38
|
+
|
39
|
+
current_service.present?
|
40
|
+
end
|
41
|
+
|
42
|
+
private
|
43
|
+
def current_service
|
44
|
+
service_name = self.class.name.demodulize.underscore
|
45
|
+
|
46
|
+
INTRANET_MAPPING[service_name] || DEFAULT_INTRANET_MAPPING.call(service_name)
|
47
|
+
end
|
14
48
|
end
|
15
49
|
end
|
data/lib/api_six_client.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: api_six_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eugene Dobrorodnov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-02-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|