api_six_client 1.5.0 → 1.5.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e9db8650771e465e6729f39101d19a0e6e79544ab7f4db05cfd8580fb407795f
4
- data.tar.gz: 255a98907f3d462d9a096de7df97e53cb8eb63816b24a4e384a8fc3aa478049d
3
+ metadata.gz: 4770d0b4e1efdb337288881828be1d95b0978e28e08a1035babb505bfad9ebf0
4
+ data.tar.gz: 2e2c2e717f0c7a728183d46f6a0c328d1113284d94a63e69fb2075256aa6f645
5
5
  SHA512:
6
- metadata.gz: ae91577c0f327b5f45b0fb8da7bedcb8542234dff046f6ce8f9b9ab67a12dbfb0da1201c215209e812a14b868a3d99221c2d51b4e1fbd49e897410648708303b
7
- data.tar.gz: 999945912ab69b3853d24a1459af79315171f07ccda65cbe7719dbc98f2d22efc1fab4205c584918884e8e921ba722abeaa37d0e86e4f969eb64faea4db71ddd
6
+ metadata.gz: 45df367a82295b73aedc9d272c878181807a24f2a4f803912096787acb1e29d6d6e6a43706b8424df239eb3c138e862a98832874de58025e326e9d0ebd3e0f12
7
+ data.tar.gz: fe2240087088cc96254a32dbe3cd312b2324fe4d3637ac68fdaa698cdda5dfd7e9ece33e2f466af19931ae11a530873874da5bc55eb2e397d07582e05d1ef95d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- api_six_client (1.5.0)
4
+ api_six_client (1.5.1)
5
5
  faraday (~> 2)
6
6
 
7
7
  GEM
@@ -2,12 +2,15 @@
2
2
 
3
3
  module ApiSixClient
4
4
  class BaseInt < Base
5
+ APP_OUTSIDE_K8S = %w[Grunnbok Brreg]
6
+ SERVICES_OUTSIDE_K8S = %w[gbk_int brg_int olc_int cad_int]
7
+
5
8
  DEFAULT_INTRANET_MAPPING = ->(service_name) {
6
9
  { k8s_service: "http://#{service_name.gsub('_int', '-api')}", api_int_path: 'api_int'}
7
10
  }
8
11
  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' },
12
+ # 'olc_int' => { k8s_service: 'http://core-web:3000', api_int_path: 'api_hiden' },
13
+ # 'cad_int' => { k8s_service: 'http://core-web:3000', api_int_path: 'api_int' },
11
14
  'val' => { k8s_service: 'http://val:8000', api_int_path: 'api' },
12
15
  }.freeze
13
16
 
@@ -35,6 +38,7 @@ module ApiSixClient
35
38
 
36
39
  def intranet_connection?
37
40
  return false if ENV['RAILS_ENV'] == 'development'
41
+ return false if Rails.application.class.to_s.split('::').first.in?(APP_OUTSIDE_K8S)
38
42
 
39
43
  current_service.present?
40
44
  end
@@ -42,6 +46,7 @@ module ApiSixClient
42
46
  private
43
47
  def current_service
44
48
  service_name = self.class.name.demodulize.underscore
49
+ return nil if service_name.in?(SERVICES_OUTSIDE_K8S)
45
50
 
46
51
  INTRANET_MAPPING[service_name] || DEFAULT_INTRANET_MAPPING.call(service_name)
47
52
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ApiSixClient
4
- VERSION = "1.5.0"
4
+ VERSION = "1.5.1"
5
5
  end
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.5.0
4
+ version: 1.5.1
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-02-09 00:00:00.000000000 Z
11
+ date: 2024-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday