smart_proxy_abrt 0.0.7 → 0.0.8

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: 44fda87ac645fddf05006c3dc12a6d8013b886f9
4
- data.tar.gz: ca298f25ee58493637179a0012b116735041797d
3
+ metadata.gz: 09dbe529fdddce32c8da1b378b563a997ce3c8e3
4
+ data.tar.gz: 2d4f6b3d711844b98ba5175bd2acc12b7634ccbb
5
5
  SHA512:
6
- metadata.gz: 110755c8734ea992f3b91eebaefcbd486c1346072c5c9df6a886efe7a35a85429f849e10ac2a5fd37a148426beb48df82eb179e5c57b450bb2f6aea54bad0d3e
7
- data.tar.gz: b68cafef498f17ec98f6ce2ee2a035aa8d75c20e4f8daf9252ad13343485a2098ade573a96bb86eb7a8a39c99c8dce496ca0a880ead2393399d4f083ca00e710
6
+ metadata.gz: 52cf54adb841639326998ec48db2a1dc0bdde33d671146cd140b2753e9b6a752f46cf807a5b3102b37c6bc4ae5b9d867f1aee2df00109280eeb70a35f8ce230a
7
+ data.tar.gz: f9b3e52261b6a656141040b38676ad0ab884bc000e1217af41f378711b0fed2749445a5220093f043a12728f1684a7900a22045a6f8b14b4aa45c8e9f232e19a
@@ -9,7 +9,7 @@ $LOAD_PATH.unshift '/usr/share/foreman-proxy/modules'
9
9
  # We rely on the main smart_proxy module to initialize the plugins so that we
10
10
  # can access our module's settings. Also used from smart-proxy code: global
11
11
  # settings, logging, foreman requests.
12
- require 'smart_proxy'
12
+ require 'smart_proxy_main'
13
13
 
14
14
  require 'smart_proxy_abrt'
15
15
  require 'smart_proxy_abrt/abrt_lib'
@@ -24,7 +24,7 @@ end
24
24
  include Proxy::Log
25
25
 
26
26
  # Don't run if ABRT plugin is disabled.
27
- if AbrtProxy::Plugin.settings.enabled != true
27
+ if !AbrtProxy::Plugin.settings.enabled
28
28
  puts "ABRT plugin is disabled - exiting"
29
29
  exit true
30
30
  end
@@ -9,15 +9,19 @@ module AbrtProxy
9
9
  class Api < ::Sinatra::Base
10
10
  include ::Proxy::Log
11
11
  helpers ::Proxy::Helpers
12
- authorize_with_ssl_client
12
+ authorize_with_ssl_client unless AbrtProxy::Plugin.settings.insecure
13
13
 
14
14
  post '/reports/new/' do
15
- begin
16
- names = AbrtProxy::cert_names request
17
- rescue AbrtProxy::Error::Unauthorized => e
18
- log_halt 403, "Client authentication required: #{e.message}"
19
- rescue AbrtProxy::Error::CertificateError => e
20
- log_halt 403, "Could not determine common name from certificate: #{e.message}"
15
+ if AbrtProxy::Plugin.settings.insecure
16
+ names = [request.ip]
17
+ else
18
+ begin
19
+ names = AbrtProxy::cert_names request
20
+ rescue AbrtProxy::Error::Unauthorized => e
21
+ log_halt 403, "Client authentication required: #{e.message}"
22
+ rescue AbrtProxy::Error::CertificateError => e
23
+ log_halt 403, "Could not determine common name from certificate: #{e.message}"
24
+ end
21
25
  end
22
26
 
23
27
  begin
@@ -104,7 +104,7 @@ module AbrtProxy
104
104
 
105
105
  class AbrtRequest < Proxy::HttpRequest::ForemanRequest
106
106
  def post_report(report)
107
- send_request(request_factory.create_post('/api/abrt_reports', report))
107
+ send_request(request_factory.create_post('api/abrt_reports', report))
108
108
  end
109
109
  end
110
110
 
@@ -4,6 +4,7 @@ module AbrtProxy
4
4
  class Plugin < ::Proxy::Plugin
5
5
  plugin :abrt, AbrtProxy::VERSION
6
6
 
7
+ http_rackup_path File.expand_path("http_config.ru", File.expand_path("../", __FILE__))
7
8
  https_rackup_path File.expand_path("http_config.ru", File.expand_path("../", __FILE__))
8
9
 
9
10
  default_settings :spooldir => "/var/spool/foreman-proxy-abrt",
@@ -1,3 +1,3 @@
1
1
  module AbrtProxy
2
- VERSION = '0.0.7'
2
+ VERSION = '0.0.8'
3
3
  end
@@ -24,3 +24,5 @@
24
24
  #:server_ssl_cert: /etc/foreman-proxy/faf_client_cert.pem
25
25
  #:server_ssl_key: /etc/foreman-proxy/faf_cleint_key.pem
26
26
 
27
+ # Ignore SSL (for development only)
28
+ #:insecure: true
metadata CHANGED
@@ -1,69 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smart_proxy_abrt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Milata
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-25 00:00:00.000000000 Z
11
+ date: 2016-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: satyr
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0.1'
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
26
  version: '0.1'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rack-test
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: mocha
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  description: This smart proxy plugin, together with a Foreman plugin, add the capability
@@ -74,27 +74,27 @@ executables:
74
74
  extensions: []
75
75
  extra_rdoc_files: []
76
76
  files:
77
+ - LICENSE
78
+ - README
79
+ - Rakefile
77
80
  - bin/smart-proxy-abrt-send
78
- - lib/smart_proxy_abrt/abrt_plugin.rb
79
- - lib/smart_proxy_abrt/http_config.ru
81
+ - bundler.d/abrt.rb
82
+ - extra/foreman-proxy-abrt-send.cron
83
+ - lib/smart_proxy_abrt.rb
84
+ - lib/smart_proxy_abrt/abrt_api.rb
80
85
  - lib/smart_proxy_abrt/abrt_lib.rb
86
+ - lib/smart_proxy_abrt/abrt_plugin.rb
81
87
  - lib/smart_proxy_abrt/abrt_version.rb
82
- - lib/smart_proxy_abrt/abrt_api.rb
83
- - lib/smart_proxy_abrt.rb
88
+ - lib/smart_proxy_abrt/http_config.ru
84
89
  - settings.d/abrt.yml.example
85
- - bundler.d/abrt.rb
90
+ - test/abrt_api_test.rb
91
+ - test/abrt_test.rb
92
+ - test/fixtures/ureport-ondisk-host1-01
86
93
  - test/fixtures/ureport-ondisk-host1-02
94
+ - test/fixtures/ureport-ondisk-host1-03
87
95
  - test/fixtures/ureport-ondisk-host2-01
88
- - test/fixtures/ureport-ondisk-host1-01
89
96
  - test/fixtures/ureport1.json
90
- - test/fixtures/ureport-ondisk-host1-03
91
97
  - test/test_helper.rb
92
- - test/abrt_api_test.rb
93
- - test/abrt_test.rb
94
- - extra/foreman-proxy-abrt-send.cron
95
- - README
96
- - LICENSE
97
- - Rakefile
98
98
  homepage: http://github.com/theforeman/smart_proxy_abrt
99
99
  licenses:
100
100
  - GPL-3
@@ -105,17 +105,17 @@ require_paths:
105
105
  - lib
106
106
  required_ruby_version: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - '>='
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  required_rubygems_version: !ruby/object:Gem::Requirement
112
112
  requirements:
113
- - - '>='
113
+ - - ">="
114
114
  - !ruby/object:Gem::Version
115
115
  version: '0'
116
116
  requirements: []
117
117
  rubyforge_project:
118
- rubygems_version: 2.1.11
118
+ rubygems_version: 2.4.8
119
119
  signing_key:
120
120
  specification_version: 4
121
121
  summary: Automatic Bug Reporting Tool plugin for Foreman's smart proxy