redhat_access 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c5bab54004d88ce1ec7130d84eadd5afd5956b88
4
- data.tar.gz: ecc0e95ad8765e7c36a87240c32892216eec30e6
3
+ metadata.gz: 47d065b4e0e037360599bb40ce34305ced86765b
4
+ data.tar.gz: 4723e3f4898c2dd722591f66d6f5d52312fd9e6d
5
5
  SHA512:
6
- metadata.gz: dbb4c89af2a1b45faabf49edde514595c71f013fe0b6048d1ef72495f06defe1c1f056bfbb1b9523c6ee3801b9956f66c5d412cb105a4595cb9d26a77ee3ad26
7
- data.tar.gz: 73cd36b923ef356914f0eface777a3d071839df9c08cb36cc6dc519421c1fc179d31a14ce7151579e727e2d2f91866491b743bb9e13281af68b66b5de5e4049a
6
+ metadata.gz: 1af2a3ab5854b3ca38fb76c1f5a543d2d9060684c63d289ba9ba0983bfc9f9011fce82fddc7cffb0c6884255df9d0aa81c12cdb12749c49310da715b4f8e4cea
7
+ data.tar.gz: fc5133fb5d6a4ae75ebdfc4dabfd9571a62f777071c795d49b3590a9a7a70d45db1febe99fc6af75f48eb65948793607748a21953ec016c08b2bf45899d77e1a
@@ -1,64 +1,64 @@
1
- (function() {
2
- 'use strict';
3
- angular.module('RedhatAccessInsights', [
4
- 'ui.router',
5
- 'ui.bootstrap',
6
- 'insights',
7
- 'templates'
8
- ])
9
- .config(['$httpProvider', '$stateProvider', '$urlRouterProvider', '$locationProvider', '$provide', 'InsightsConfigProvider', '$injector',
10
- function($httpProvider, $stateProvider, $urlRouterProvider, $locationProvider, $provide, InsightsConfigProvider, $injector) {
11
- $httpProvider.defaults.headers.common = {
12
- 'X-CSRF-TOKEN': $('meta[name=csrf-token]').attr('content')
13
- };
14
- $provide.factory('AuthInterceptor', ['$injector',
15
- function($injector) {
16
- return {
17
- responseError: function(response) {
18
- var $q = $injector.get('$q');
19
- var $window = $injector.get('$window');
20
- if (response.status === 401) {
21
- $window.location.reload();
22
- } else
23
- if (response.status === 403) {
24
- var message = 'You are not authorized to perform this action.';
25
- response.data.errors = [message];
26
- response.data.displayMessage = message;
27
- $window.location.reload();
28
- }
29
- return $q.reject(response);
30
- }
1
+ (function () {
2
+ 'use strict';
3
+ angular.module('RedhatAccessInsights', [
4
+ 'ui.router',
5
+ 'ui.bootstrap',
6
+ 'insights',
7
+ 'templates'
8
+ ]).config(['$httpProvider', '$stateProvider', '$urlRouterProvider', '$locationProvider', '$provide', 'InsightsConfigProvider', '$injector',
9
+ function ($httpProvider, $stateProvider, $urlRouterProvider, $locationProvider, $provide, InsightsConfigProvider, $injector) {
10
+ $httpProvider.defaults.headers.common = {
11
+ 'X-CSRF-TOKEN': $('meta[name=csrf-token]').attr('content')
31
12
  };
32
- }
33
- ]);
34
- $httpProvider.interceptors.push('AuthInterceptor');
35
- $stateProvider.state('manage', {
36
- url: '/manage',
37
- templateUrl: '/redhat_access/insights/templates/configuration', //TODO HACK!
38
- controller: 'ConfigurationCtrl'
39
- });
40
- $stateProvider.state('help', {
41
- url: '/help',
42
- templateUrl: '/redhat_access/insights/templates/help' //TODO HACK
43
- });
44
- $stateProvider.state('serviceerror', {
45
- url: '/proxyerror',
46
- templateUrl: '/redhat_access/insights/templates/error' //TODO HACK
47
- });
48
- $urlRouterProvider.otherwise('/overview');
49
- $locationProvider.html5Mode(true);
13
+ $provide.factory('AuthInterceptor', ['$injector',
14
+ function ($injector) {
15
+ return {
16
+ responseError: function (response) {
17
+ var $q = $injector.get('$q');
18
+ var $window = $injector.get('$window');
19
+ if (response.status === 401) {
20
+ $window.location.reload();
21
+ } else if (response.status === 403) {
22
+ var message = 'You are not authorized to perform this action.';
23
+ response.data.errors = [message];
24
+ response.data.displayMessage = message;
25
+ $window.location.reload();
26
+ }
27
+ return $q.reject(response);
28
+ }
29
+ };
30
+ }
31
+ ]);
32
+ $httpProvider.interceptors.push('AuthInterceptor');
33
+ $stateProvider.state('manage', {
34
+ url: '/manage',
35
+ templateUrl: '/redhat_access/insights/templates/configuration', //TODO HACK!
36
+ controller: 'ConfigurationCtrl'
37
+ });
38
+ $stateProvider.state('help', {
39
+ url: '/help',
40
+ templateUrl: '/redhat_access/insights/templates/help' //TODO HACK
41
+ });
42
+ $stateProvider.state('serviceerror', {
43
+ url: '/proxyerror',
44
+ templateUrl: '/redhat_access/insights/templates/error' //TODO HACK
45
+ });
46
+ $urlRouterProvider.otherwise('/overview');
47
+ $locationProvider.html5Mode(true);
48
+
49
+ // Insights UI configuration
50
+ InsightsConfigProvider.setApiPrefix('/redhat_access/r/insights/view/api/');
51
+ InsightsConfigProvider.setCanUnregisterSystems(REDHAT_ACCESS_SETTINGS.Insights.canUnregisterSystems);
52
+ InsightsConfigProvider.setCanIgnoreRules(REDHAT_ACCESS_SETTINGS.Insights.canIgnoreRules);
53
+ InsightsConfigProvider.setGettingStartedLink('https://access.redhat.com/insights/getting-started/satellite/6/');
54
+ InsightsConfigProvider.setAllowExport(true);
55
+ InsightsConfigProvider.setOverviewKey('overview-satellite6');
50
56
 
51
- // Insights UI configuration
52
- InsightsConfigProvider.setApiPrefix('/redhat_access/r/insights/view/api/');
53
- InsightsConfigProvider.setCanUnregisterSystems(REDHAT_ACCESS_SETTINGS.Insights.canUnregisterSystems);
54
- InsightsConfigProvider.setCanIgnoreRules(REDHAT_ACCESS_SETTINGS.Insights.canIgnoreRules);
55
- InsightsConfigProvider.setGettingStartedLink('https://access.redhat.com/insights/getting-started/satellite/6/');
56
- InsightsConfigProvider.setAllowExport(true);
57
- }
57
+ }
58
58
  ]).value('SAT_CONFIG', {
59
- enableBasicAuth: REDHAT_ACCESS_SETTINGS.Insights.allowBasicAuth,
60
- isOrgSelected: REDHAT_ACCESS_SETTINGS.Insights.isOrgSelected,
61
- isSubscribedToRedhat: REDHAT_ACCESS_SETTINGS.Insights.isSubscribedToRedhat,
62
- isOrgDisconnected: REDHAT_ACCESS_SETTINGS.Insights.isOrgDisconnected,
59
+ enableBasicAuth: REDHAT_ACCESS_SETTINGS.Insights.allowBasicAuth,
60
+ isOrgSelected: REDHAT_ACCESS_SETTINGS.Insights.isOrgSelected,
61
+ isSubscribedToRedhat: REDHAT_ACCESS_SETTINGS.Insights.isSubscribedToRedhat,
62
+ isOrgDisconnected: REDHAT_ACCESS_SETTINGS.Insights.isOrgDisconnected,
63
63
  }).value('currentLocale', REDHAT_ACCESS_SETTINGS.currentLocale);
64
64
  })();
@@ -7,8 +7,6 @@ module RedhatAccess
7
7
  before_filter :session_expiry, :update_activity_time
8
8
  #around_filter :set_timezone
9
9
 
10
- cache_sweeper :topbar_sweeper
11
-
12
10
  respond_to :json
13
11
 
14
12
  def http_error_response(msg,status)
@@ -55,10 +55,6 @@ module RedhatAccess
55
55
  telemetry_enabled?(get_organization(uuid))
56
56
  end
57
57
 
58
- def get_content_host_by_fqdn(name)
59
- Katello::System.first(:conditions => {:name => name})
60
- end
61
-
62
58
  def disconnected_org?(org)
63
59
  if org
64
60
  # TODO: fix hard coding
@@ -102,7 +98,7 @@ module RedhatAccess
102
98
  def get_ssl_options_for_org(org, ca_file)
103
99
  if org
104
100
  verify_peer = REDHAT_ACCESS_CONFIG[:telemetry_ssl_verify_peer] ? OpenSSL::SSL::VERIFY_PEER : OpenSSL::SSL::VERIFY_NONE
105
- ssl_version = REDHAT_ACCESS_CONFIG[:telemetry_ssl_verify_peer] ? REDHAT_ACCESS_CONFIG[:telemetry_ssl_verify_peer] : nil
101
+ ssl_version = REDHAT_ACCESS_CONFIG[:telemetry_ssl_version] ? REDHAT_ACCESS_CONFIG[:telemetry_ssl_version] : nil
106
102
  ca_file = ca_file ? ca_file : get_default_ssl_ca_file
107
103
  Rails.logger.debug("Verify peer #{verify_peer}")
108
104
  if use_basic_auth?
@@ -171,9 +167,8 @@ module RedhatAccess
171
167
 
172
168
  def get_content_hosts(org)
173
169
  if org
174
- org_id = org.id
175
- environment_ids = Organization.find(org_id).kt_environments.pluck(:id)
176
- hosts = Katello::System.readable.where(:environment_id => environment_ids).pluck(:uuid).compact.sort
170
+ Katello::Host::SubscriptionFacet.joins(:host).where(:hosts => {:host_id => ::Host::Managed.authorized('view_hosts', ::Host::Managed)},
171
+ :hosts => {:organization_id => org.id}).pluck(:uuid)
177
172
  else
178
173
  raise(RecordNotFound, 'Organization not found or invalid')
179
174
  end
@@ -21,7 +21,7 @@ module RedhatAccess
21
21
  current_user_map.each do |key,user|
22
22
  begin
23
23
  user_data = weekly_summary_data(user.login)
24
- data.push(user_data) unless user_data.nil? || user_data.total_systems = 0
24
+ data.push(user_data) unless user_data.nil? || user_data[:data].nil? || user_data[:data].total_systems == 0
25
25
  rescue => e
26
26
  Rails.logger.warn("Unable to get weekly email data for user")
27
27
  end
@@ -85,7 +85,7 @@
85
85
  <p>
86
86
  You currently have
87
87
  <a href="<%=@server_url%>/inventory?product=all&amp;utm_source=all_systems_first_paragraph&amp;utm_medium=email&amp;utm_campaign=WeeklyEmail">
88
- <strong><%= @data.total_systems %> systems</strong>
88
+ <strong><%= @data.total_systems %> system(s)</strong>
89
89
  </a>
90
90
  registered with Insights in the <%=@org.name%> organization and
91
91
 
@@ -1,3 +1,3 @@
1
1
  module RedhatAccess
2
- VERSION = "2.0.1"
2
+ VERSION = "2.0.2"
3
3
  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.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lindani Phiri
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-19 00:00:00.000000000 Z
11
+ date: 2017-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redhat_access_lib
@@ -288,61 +288,61 @@ required_rubygems_version: !ruby/object:Gem::Requirement
288
288
  version: '0'
289
289
  requirements: []
290
290
  rubyforge_project:
291
- rubygems_version: 2.5.1
291
+ rubygems_version: 2.6.11
292
292
  signing_key:
293
293
  specification_version: 4
294
294
  summary: Plugin to add Redhat Access to Foreman
295
295
  test_files:
296
- - test/models/redhat_access/telemetry_proxy_credentials_test.rb
297
- - test/redhat_access_test.rb
298
- - test/fixtures/redhat_access/telemetry_configurations.yml
299
- - test/fixtures/redhat_access/telemetry_proxy_credentials.yml
300
- - test/integration/navigation_test.rb
301
- - test/test_helper.rb
302
- - test/unit/helpers/redhat_access/log_viewer_helper_test.rb
303
- - test/unit/helpers/redhat_access/analytics_dashboard_helper_test.rb
304
- - test/unit/helpers/redhat_access/logs_helper_test.rb
305
- - test/unit/helpers/redhat_access/cases_helper_test.rb
306
- - test/unit/helpers/redhat_access/search_helper_test.rb
307
- - test/unit/helpers/redhat_access/redhat_access_helper_test.rb
308
- - test/unit/helpers/redhat_access/telemetry_configuration_helper_test.rb
309
- - test/unit/helpers/redhat_access/attachments_helper_test.rb
310
- - test/unit/redhat_access/telemetry_configuration_test.rb
311
- - test/sos-report-test.rb
312
- - test/functional/redhat_access/redhat_access_controller_test.rb
313
- - test/functional/redhat_access/logs_controller_test.rb
314
- - test/functional/redhat_access/analytics_dashboard_controller_test.rb
315
- - test/functional/redhat_access/attachments_controller_test.rb
316
296
  - test/functional/redhat_access/log_viewer_controller_test.rb
317
- - test/functional/redhat_access/configuration_controller_test.rb
318
- - test/functional/redhat_access/search_controller_test.rb
319
297
  - test/functional/redhat_access/cases_controller_test.rb
298
+ - test/functional/redhat_access/analytics_dashboard_controller_test.rb
299
+ - test/functional/redhat_access/redhat_access_controller_test.rb
300
+ - test/functional/redhat_access/search_controller_test.rb
301
+ - test/functional/redhat_access/configuration_controller_test.rb
320
302
  - test/functional/redhat_access/telemetry_configuration_controller_test.rb
321
- - test/dummy/Rakefile
322
- - test/dummy/config.ru
303
+ - test/functional/redhat_access/logs_controller_test.rb
304
+ - test/functional/redhat_access/attachments_controller_test.rb
305
+ - test/models/redhat_access/telemetry_proxy_credentials_test.rb
306
+ - test/integration/navigation_test.rb
307
+ - test/dummy/README.rdoc
323
308
  - test/dummy/app/controllers/application_controller.rb
324
309
  - test/dummy/app/views/layouts/application.html.erb
325
310
  - test/dummy/app/assets/javascripts/application.js
326
311
  - test/dummy/app/assets/stylesheets/application.css
327
312
  - test/dummy/app/helpers/application_helper.rb
328
- - test/dummy/script/rails
329
- - test/dummy/public/favicon.ico
330
- - test/dummy/public/422.html
331
- - test/dummy/public/404.html
332
- - test/dummy/public/500.html
333
- - test/dummy/config/boot.rb
334
- - test/dummy/config/environment.rb
335
- - test/dummy/config/locales/en.yml
336
313
  - test/dummy/config/application.rb
337
- - test/dummy/config/environments/development.rb
338
314
  - test/dummy/config/environments/production.rb
315
+ - test/dummy/config/environments/development.rb
339
316
  - test/dummy/config/environments/test.rb
317
+ - test/dummy/config/boot.rb
318
+ - test/dummy/config/database.yml
319
+ - test/dummy/config/locales/en.yml
340
320
  - test/dummy/config/routes.rb
321
+ - test/dummy/config/initializers/backtrace_silencers.rb
341
322
  - test/dummy/config/initializers/inflections.rb
342
- - test/dummy/config/initializers/wrap_parameters.rb
343
- - test/dummy/config/initializers/mime_types.rb
344
- - test/dummy/config/initializers/secret_token.rb
345
323
  - test/dummy/config/initializers/session_store.rb
346
- - test/dummy/config/initializers/backtrace_silencers.rb
347
- - test/dummy/config/database.yml
348
- - test/dummy/README.rdoc
324
+ - test/dummy/config/initializers/secret_token.rb
325
+ - test/dummy/config/initializers/mime_types.rb
326
+ - test/dummy/config/initializers/wrap_parameters.rb
327
+ - test/dummy/config/environment.rb
328
+ - test/dummy/Rakefile
329
+ - test/dummy/script/rails
330
+ - test/dummy/config.ru
331
+ - test/dummy/public/404.html
332
+ - test/dummy/public/favicon.ico
333
+ - test/dummy/public/422.html
334
+ - test/dummy/public/500.html
335
+ - test/test_helper.rb
336
+ - test/redhat_access_test.rb
337
+ - test/fixtures/redhat_access/telemetry_configurations.yml
338
+ - test/fixtures/redhat_access/telemetry_proxy_credentials.yml
339
+ - test/sos-report-test.rb
340
+ - test/unit/redhat_access/telemetry_configuration_test.rb
341
+ - test/unit/helpers/redhat_access/cases_helper_test.rb
342
+ - test/unit/helpers/redhat_access/log_viewer_helper_test.rb
343
+ - test/unit/helpers/redhat_access/analytics_dashboard_helper_test.rb
344
+ - test/unit/helpers/redhat_access/logs_helper_test.rb
345
+ - test/unit/helpers/redhat_access/telemetry_configuration_helper_test.rb
346
+ - test/unit/helpers/redhat_access/redhat_access_helper_test.rb
347
+ - test/unit/helpers/redhat_access/search_helper_test.rb
348
+ - test/unit/helpers/redhat_access/attachments_helper_test.rb