redhat_access 2.2.7 → 2.2.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/redhat_access/api/machine_telemetry_api_controller.rb +2 -2
- data/app/controllers/redhat_access/api/telemetry_api_controller.rb +2 -2
- data/app/controllers/redhat_access/telemetry_configurations_controller.rb +1 -1
- data/app/services/redhat_access/telemetry/look_ups.rb +16 -1
- data/app/services/redhat_access/telemetry/messaging_service.rb +1 -1
- data/app/services/redhat_access/telemetry/portal_client.rb +5 -0
- data/config/config.yml.example +3 -0
- data/config/defaults.yml +2 -0
- data/lib/redhat_access/version.rb +1 -1
- data/redhat_access.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06eace60e082178a03ecb70b5e9e074b59de66baf85ff9cdbbd5704ee72c6e26
|
4
|
+
data.tar.gz: 947a47fbdc1da0bfcf31a3ff0e6aaffbb88e08912c72be9ab9f94fc70ca68036
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 512e7a807786b57d014dab005e5a31881f0eb3002aa29ceda6036b9fef68391698374d390a3cb33758825fd4f9916651b982714ed942a2311d3181b4af28ee4c
|
7
|
+
data.tar.gz: 9b93f4a0e89392eb16aa15ef7f5f20df33bace669b62f79c3ce665c5573bddb2d38f9f09ac1b8139e4d59a85e48d9315a0967e3bb4c5564fcf86566654da6a17
|
@@ -36,7 +36,7 @@ module RedhatAccess
|
|
36
36
|
|
37
37
|
def api_connection_test
|
38
38
|
client = get_api_client
|
39
|
-
res = client.call_tapi('GET', '/', nil, nil,
|
39
|
+
res = client.call_tapi('GET', '/', nil, nil, {timeout: get_tapi_timeout})
|
40
40
|
Rails.logger.debug(res[:data])
|
41
41
|
render status: res[:code], json: {}
|
42
42
|
end
|
@@ -61,7 +61,7 @@ module RedhatAccess
|
|
61
61
|
|
62
62
|
client = get_api_client
|
63
63
|
Rails.logger.debug("Proxy upload original_payload : #{original_payload}")
|
64
|
-
res = client.call_tapi(original_method, URI.escape(resource), original_params, original_payload,
|
64
|
+
res = client.call_tapi(original_method, URI.escape(resource), original_params, original_payload, {timeout: get_upload_timeout}, use_subsets)
|
65
65
|
render status: res[:code] , json: res[:data]
|
66
66
|
end
|
67
67
|
|
@@ -65,7 +65,7 @@ module RedhatAccess
|
|
65
65
|
|
66
66
|
def connection_status
|
67
67
|
client = get_api_client
|
68
|
-
res = client.call_tapi('GET', 'me', nil, nil,
|
68
|
+
res = client.call_tapi('GET', 'me', nil, nil, {timeout: get_tapi_timeout})
|
69
69
|
Rails.logger.debug(res[:data])
|
70
70
|
case res[:code]
|
71
71
|
when 200
|
@@ -117,7 +117,7 @@ module RedhatAccess
|
|
117
117
|
end
|
118
118
|
|
119
119
|
client = get_api_client
|
120
|
-
res = client.call_tapi(original_method, URI.escape(resource), original_params, original_payload,
|
120
|
+
res = client.call_tapi(original_method, URI.escape(resource), original_params, original_payload, {timeout: get_tapi_timeout}, use_subsets)
|
121
121
|
#401 erros means our proxy is not configured right.
|
122
122
|
#Change it to 502 to distinguish with local applications 401 errors
|
123
123
|
resp_data = res[:data]
|
@@ -210,7 +210,6 @@ module RedhatAccess
|
|
210
210
|
"#{get_plugin_parent_name}/#{get_plugin_parent_version};#{get_rha_plugin_name}/#{get_rha_plugin_version}"
|
211
211
|
end
|
212
212
|
|
213
|
-
|
214
213
|
def get_http_options(include_user_id = false)
|
215
214
|
headers = {}
|
216
215
|
if include_user_id && User.current
|
@@ -222,6 +221,22 @@ module RedhatAccess
|
|
222
221
|
:headers => headers}
|
223
222
|
end
|
224
223
|
|
224
|
+
# global use_subsets flag - defaults to false to suppress use of subsets to address scalability problems
|
225
|
+
# (subset and branch_id are equivalent for satellite)
|
226
|
+
def use_subsets?
|
227
|
+
REDHAT_ACCESS_CONFIG[:use_subsets] || false
|
228
|
+
end
|
229
|
+
|
230
|
+
# timeout for telemetry api operations
|
231
|
+
def get_tapi_timeout
|
232
|
+
REDHAT_ACCESS_CONFIG[:telemetry_api_timeout_s] || 60
|
233
|
+
end
|
234
|
+
|
235
|
+
# timeout for telemetry uploads
|
236
|
+
def get_upload_timeout
|
237
|
+
REDHAT_ACCESS_CONFIG[:telemetry_upload_timeout_s] || 120
|
238
|
+
end
|
239
|
+
|
225
240
|
def user_login_to_hash(login)
|
226
241
|
Digest::SHA1.hexdigest(login)
|
227
242
|
end
|
@@ -20,6 +20,11 @@ module RedhatAccess
|
|
20
20
|
@context = context
|
21
21
|
end
|
22
22
|
|
23
|
+
# intercept call_tapi() so we can override use of subsets
|
24
|
+
def call_tapi(original_method, resource, original_params, original_payload, extra, use_subsets = true)
|
25
|
+
super(original_method, resource, original_params, original_payload, extra, use_subsets? && use_subsets)
|
26
|
+
end
|
27
|
+
|
23
28
|
# Returns the branch id of the current org/account
|
24
29
|
def get_branch_id
|
25
30
|
organization = get_current_organization
|
data/config/config.yml.example
CHANGED
@@ -6,8 +6,11 @@
|
|
6
6
|
|
7
7
|
:enable_telemetry_basic_auth : false
|
8
8
|
:telemetry_upload_host : "https://cert-api.access.redhat.com"
|
9
|
+
# :telemetry_upload_timeout_s : 120
|
9
10
|
:telemetry_api_host : "https://cert-api.access.redhat.com"
|
11
|
+
# :telemetry_api_timeout_s : 60
|
10
12
|
:telemetry_ssl_verify_peer : true
|
13
|
+
:use_subsets : false
|
11
14
|
|
12
15
|
:diagnostic_logs :
|
13
16
|
- /var/log/foreman/production.log
|
data/config/defaults.yml
CHANGED
data/redhat_access.gemspec
CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
|
|
16
16
|
|
17
17
|
s.files = Dir["{app,config,db,lib,vendor,public,script,ca,locale}/**/*"] + ["LICENSE.txt", "Rakefile", "README.rdoc", "redhat_access.gemspec", "Gemfile"]
|
18
18
|
s.test_files = Dir["test/**/*"]
|
19
|
-
s.add_dependency "redhat_access_lib" , ">=1.1.
|
19
|
+
s.add_dependency "redhat_access_lib" , ">=1.1.5"
|
20
20
|
s.add_dependency "angular-rails-templates", ">=0.0.4"
|
21
21
|
|
22
22
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redhat_access
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lindani Phiri
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redhat_access_lib
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.1.
|
19
|
+
version: 1.1.5
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.1.
|
26
|
+
version: 1.1.5
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: angular-rails-templates
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|