Skip to content

Commit

Permalink
fix bz1197764
Browse files Browse the repository at this point in the history
  • Loading branch information
lphiri committed Mar 5, 2015
1 parent 4e68993 commit bfedd4f
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 23 deletions.
12 changes: 6 additions & 6 deletions redhat-access/config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
RedhatAccess::Engine.routes.draw do

scope '/proactive_support' do
resources :strata_credentials
end
# scope '/proactive_support' do
# resources :strata_credentials
# end

#API routes
get "configuration" => "configuration#index"
get "logs" => "logs#index"
get "attachments" => "attachments#index"
post "attachments" => "attachments#create"

get "proactive_support/rs/telemetry/api/static/uploader.yaml", to: "telemetry_api#get_ph_conf"
post "proactive_support/rs/telemetry", to: "telemetry_api#upload_sosreport"
# get "proactive_support/rs/telemetry/api/static/uploader.yaml", to: "telemetry_api#get_ph_conf"
# post "proactive_support/rs/telemetry", to: "telemetry_api#upload_sosreport"

#Angular UI routes
get "log_viewer/index" => "log_viewer#index"
get "cases/create"=> "cases#create"
get "cases/index" => "cases#index"
get "search/index" => "search#index"
get "proactive_support", to: "telemetry#index"
# get "proactive_support", to: "telemetry#index"

root :to => "redhat_access#index"

Expand Down
40 changes: 30 additions & 10 deletions redhat-access/lib/redhat_access/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,26 @@ class Engine < ::Rails::Engine
app.config.filter_parameters << :authToken
end

initializer :config_csp_headers do |app|
::SecureHeaders::Configuration.configure do |config|
Rails.logger.info "init config for #{config}"
if config && config.csp
if config.csp[:frame_src]
config.csp[:frame_src] = config.csp[:frame_src] << ' *.redhat.com *.force.com'
end
if config.csp[:connect_src]
config.csp[:connect_src] = config.csp[:connect_src] << ' *.redhat.com'
end
if config.csp[:script_src]
config.csp[:script_src] = config.csp[:script_src] << ' *.redhat.com'
end
if config.csp[:img_src]
config.csp[:img_src] = config.csp[:img_src] << ' *.redhat.com'
end
end
end
end

initializer 'redhat_access.register_gettext', :after => :load_config_initializers do |app|
locale_dir = File.join(File.expand_path('../../..', __FILE__), 'locale')
locale_domain = 'redhat_access'
Expand All @@ -51,16 +71,16 @@ class Engine < ::Rails::Engine
permission :logs, {:"redhat_access/logs" => [:index] }

#Proactive Diagnostics permissions
permission :rh_telemetry_api, { :"redhat_access/telemetry_api" => [:index,:upload_sosreport,:get_ph_conf] }
permission :rh_telemetry_view, { :"redhat_access/telemetry" => [:index] }
permission :rh_telemetry_creds, { :"redhat_access/strata_credentials" => [:index, :destroy, :create] }
# permission :rh_telemetry_api, { :"redhat_access/telemetry_api" => [:index,:upload_sosreport,:get_ph_conf] }
# permission :rh_telemetry_view, { :"redhat_access/telemetry" => [:index] }
# permission :rh_telemetry_creds, { :"redhat_access/strata_credentials" => [:index, :destroy, :create] }

end

#roles section
#role "Red Hat Access", [:view_search,:view_cases,:attachments, :configuration]
role "Red Hat Access Logs", [:logs,:view_log_viewer]
role "Red Hat Proactive Support" , [:rh_telemetry_api, :rh_telemetry_view, :rh_telemetry_creds]
#role "Red Hat Proactive Support" , [:rh_telemetry_api, :rh_telemetry_view, :rh_telemetry_creds]

#menus
sub_menu :header_menu, :redhat_access_menu, :caption=> N_('Red Hat Access') do
Expand All @@ -72,12 +92,12 @@ class Engine < ::Rails::Engine
:LogViewer,
:url_hash => {:controller=> :"redhat_access/log_viewer" , :action=>:index},
:engine => RedhatAccess::Engine,
:caption=> N_('Diagnose')
menu :header_menu,
:Telemetry,
:url_hash => {:controller=> :"redhat_access/telemetry" , :action=>:index},
:caption=> N_('Proactive Support'),
:engine => RedhatAccess::Engine
:caption=> N_('Logs')
# menu :header_menu,
# :Telemetry,
# :url_hash => {:controller=> :"redhat_access/telemetry" , :action=>:index},
# :caption=> N_('Proactive Support'),
# :engine => RedhatAccess::Engine
divider :header_menu, :parent => :redhat_access_menu, :caption => N_('Support')
menu :header_menu,
:mycases,
Expand Down
2 changes: 1 addition & 1 deletion redhat-access/lib/redhat_access/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module RedhatAccess
VERSION = "0.0.7"
VERSION = "0.0.9"
end
20 changes: 14 additions & 6 deletions redhat-access/rubygem-foreman-redhat_access.spec
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
%endif

Name: %{?scl_prefix}rubygem-foreman-%{gem_name}
Version: 0.0.7
Version: 0.0.9
Release: 1%{?dist}
Summary: Foreman engine to access Red Hat knowledge base
Group: Development/Languages
Expand Down Expand Up @@ -105,15 +105,23 @@ cp -pa .%{rubygem_redhat_access_dir}/config/config.yml.example %{buildroot}/etc/
%{foreman_bundlerd_dir}/%{gem_name}.rb
%{foreman_assets_dir}/redhat_access
/etc/redhat_access
/etc/pam.d
/etc/pam.d/foreman-sosreport
/etc/security/console.apps
/usr/sbin
/usr/bin
/usr/sbin/foreman-sosreport-wrapper
/usr/bin/foreman-sosreport

%posttrans
/usr/sbin/foreman-rake db:migrate >/dev/null 2>&1

%changelog
* Wed Mar 4 2015 Lindani Phiri <[email protected]> - 0.0.9-1
- Resolves : bz1197764

* Fri Feb 19 2015 Lindani Phiri <[email protected]> - 0.0.8-2
- Resolves : bz1193672

* Fri Feb 12 2015 Lindani Phiri <[email protected]> - 0.0.8-1
- Removed proactive support
- Resolves : bz1191406

* Mon Dec 12 2014 Lindani Phiri <[email protected]> - 0.0.7-1
- Add proactive support
- Resolves: bz1131538
Expand Down

0 comments on commit bfedd4f

Please sign in to comment.