foreman_cockpit 2.0.2 → 2.0.3

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
  SHA1:
3
- metadata.gz: 7fdaf362cfb67b4ce1ed4b009e78bc1dab6e71ba
4
- data.tar.gz: b8091282c44018675e15269f5c3498815ec29540
3
+ metadata.gz: 93dcc6130c7c7f4b933117ab027d0e3677b143fe
4
+ data.tar.gz: 0dc9311b8863fd4993d3e1c1a543dc8d05444c26
5
5
  SHA512:
6
- metadata.gz: 104cee72dfc7774ae2175ab476bedef07d63a5ad4b0a32ea3b012581e99879c19030d82ada67df635c2f1d372057517147cdedba141671b8fc226bdae34f9b72
7
- data.tar.gz: 950e0c39b6a6544cc39ad11af2f36896aa10bcd212747c2876b084e1e3ae63f73b02318a45450320862634209c2727333ebe301b7b98b05e35ebdf32dd10cd62
6
+ metadata.gz: e71862322f80a250d01706e4033d2a2d249596d3995c7838662bacfa10516a3eb1393260c72d4c97cf8879376e7f502d7f75d608f44dddc1b3a6bf898da42a94
7
+ data.tar.gz: 339dcf2ef621bf8e6c5c00ed447828227dbfd27c2f644deacf72fda165fc7fb8b5bec1fb2ae40167cfba8e584fa73470bd2e4a21500cd27dd10160c258feee21
@@ -4,7 +4,7 @@ module ForemanCockpit
4
4
  extend ActiveSupport::Concern
5
5
 
6
6
  included do
7
- before_filter :allow_cockpit_iframe, :only => :show
7
+ before_action :allow_cockpit_iframe, :only => :show
8
8
  end
9
9
 
10
10
  ForemanCockpit::COCKPIT_ACTIONS.each do |action|
@@ -15,16 +15,14 @@ module ForemanCockpit
15
15
  suburl = ForemanCockpit::COCKPIT_SUBURL[action.to_sym]
16
16
  render :partial => 'foreman_cockpit/hosts/cockpit',
17
17
  :locals => { :fqdn => @host.fqdn, :suburl => suburl,
18
- :protocol => cockpit_protocol }
18
+ :protocol => request.protocol }
19
19
  end
20
20
  end
21
21
 
22
22
  private
23
23
 
24
24
  def allow_cockpit_iframe
25
- response.headers['Content-Security-Policy'].
26
- sub!("frame-src 'self'",
27
- "frame-src 'self' #{cockpit_protocol}://#{@host.fqdn}:9090")
25
+ append_content_security_policy_directives(child_src: ["#{request.protocol}#{@host.fqdn}:9090"])
28
26
  end
29
27
 
30
28
  def action_permission
@@ -35,9 +33,5 @@ module ForemanCockpit
35
33
  super
36
34
  end
37
35
  end
38
-
39
- def cockpit_protocol
40
- request.ssl? ? 'https' : 'http'
41
- end
42
36
  end
43
37
  end
@@ -1,2 +1,2 @@
1
1
  <iframe class='col-md-12' height='600px' frameBorder="0"
2
- src="<%= protocol %>://<%= fqdn %>:9090/cockpit/@localhost/<%= suburl %>"/>
2
+ src="<%= protocol %><%= fqdn %>:9090/cockpit/@localhost/<%= suburl %>"/>
@@ -22,6 +22,14 @@ module ForemanCockpit
22
22
  :before => :finisher_hook) do
23
23
  Foreman::Plugin.register :foreman_cockpit do
24
24
  requires_foreman '>= 1.7'
25
+
26
+ security_block :foreman_cockpit do
27
+ ForemanCockpit::COCKPIT_ACTIONS.each do |action|
28
+ permission :"view_cockpit_#{action.to_s}",
29
+ { :hosts => [action] },
30
+ :resource_type => 'Host'
31
+ end
32
+ end
25
33
  end
26
34
  end
27
35
 
@@ -1,4 +1,4 @@
1
1
  # Specify the version to be picked up in the Gemspec
2
2
  module ForemanCockpit
3
- VERSION = '2.0.2'
3
+ VERSION = '2.0.3'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_cockpit
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Lobato Garcia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-02 00:00:00.000000000 Z
11
+ date: 2017-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: deface
@@ -89,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
89
89
  version: '0'
90
90
  requirements: []
91
91
  rubyforge_project:
92
- rubygems_version: 2.2.2
92
+ rubygems_version: 2.6.12
93
93
  signing_key:
94
94
  specification_version: 4
95
95
  summary: Use your hosts' Cockpit in Foreman.