smart_proxy_request_forwarder 0.0.2 → 0.0.4

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
  SHA256:
3
- metadata.gz: 60b6caaf7bd2f2c70ded8f6d6954c25c56e2c0d175caa716ace4b0e8a3a052df
4
- data.tar.gz: aeb5594cac42515f02f7f2faa293e4f646847d134b74ec3120fb30b0ccbdec11
3
+ metadata.gz: ff6f468cf17704c29606e810ebfc8d19c3f005953de92d4c4036f31690e58758
4
+ data.tar.gz: 725023a18ac6599f7c698da579d45505de2b12dd6723cc7d640eced24d52f73a
5
5
  SHA512:
6
- metadata.gz: 20bb3570abf04d539151c1d02b186e74c0ef704923c69a3ead11499f4f61513785676d29331dffe66a4f72ec71ea84817f4aa0666b334de4fd970806664096d4
7
- data.tar.gz: d9e5c9e8b0dbefc00d7bfbf4e9dc0c080634e94db7294fe5463d66fc6a6c518bd69c77fa6a8815c6217994e5fbfcb61c6596f0ab1a1eb9aededfec3c3a4602fb
6
+ metadata.gz: d1569a81c9fe5808304a23e3de4264c46f67d31578c745fac1639f512adb96616e61220820932c2e28942f4e76cffea5b01ec05cc5aec98c9aeef5674c145b1e
7
+ data.tar.gz: 54975cb6ebab7fc56599c8d6769fb3862ebc85aa1f27bcffff7323b57399209cc23d923058fcd6b7facb8e728882145c88667e3dd47640e2c8b5becac14bd5b2
data/README.md CHANGED
@@ -5,13 +5,12 @@ configuration servers such as Puppet or Salt masters to Foreman.
5
5
 
6
6
  ## Public API
7
7
 
8
- ### POST /request_forwarder/config_reports
8
+ ### POST /api/config_reports
9
9
 
10
- ### POST /request_forwarder/hosts/facts
10
+ ### POST /api/hosts/facts
11
11
 
12
12
  Both API endpoints are forwarded directly to Foreman without further parameter check.
13
13
 
14
-
15
14
  # Installation
16
15
 
17
16
  **Clone smart-proxy**
@@ -3,9 +3,12 @@
3
3
  require 'smart_proxy_request_forwarder/proxy_request'
4
4
 
5
5
  class Proxy::RequestForwarder::Api < Sinatra::Base
6
+ include Sinatra::Authorization::Helpers
7
+
6
8
  post '/*' do
9
+ do_authorize_any
7
10
  case request.path
8
- when '/request_forwarder/hosts/facts', '/request_forwarder/config_reports'
11
+ when '/api/hosts/facts', '/api/config_reports'
9
12
  response = Proxy::RequestForwarder::ProxyRequest.new.foreman_request(request)
10
13
  handle_response(response)
11
14
  else
@@ -2,6 +2,6 @@
2
2
 
3
3
  require 'smart_proxy_request_forwarder/api'
4
4
 
5
- map '/request_forwarder' do
5
+ map '/api' do
6
6
  run Proxy::RequestForwarder::Api
7
7
  end
@@ -5,6 +5,6 @@ module Proxy::RequestForwarder
5
5
  rackup_path File.expand_path('http_config.ru', __dir__)
6
6
 
7
7
  default_settings enabled: true
8
- plugin :request_forwarder, ::Proxy::VERSION
8
+ plugin :request_forwarder, ::Proxy::RequestForwarder::VERSION
9
9
  end
10
10
  end
@@ -6,8 +6,7 @@ module Proxy::RequestForwarder
6
6
  class ProxyRequest < ::Proxy::HttpRequest::ForemanRequest
7
7
  include Proxy::Log
8
8
  def foreman_request(request)
9
- path = "api#{request.path.delete_prefix('/request_forwarder')}"
10
- req = request_factory.create_post(path, request.body.read)
9
+ req = request_factory.create_post(request.path, request.body.read)
11
10
  send_request(req)
12
11
  end
13
12
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Proxy
4
4
  module RequestForwarder
5
- VERSION = '0.0.2'
5
+ VERSION = '0.0.4'
6
6
  end
7
7
  end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'smart_proxy_request_forwarder/version'
4
+ require 'smart_proxy_request_forwarder/plugin'
5
+ require 'smart_proxy_request_forwarder/api'
6
+
7
+ module Proxy
8
+ module RequestForwarder
9
+ end
10
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smart_proxy_request_forwarder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nadja Heitmann
@@ -50,13 +50,14 @@ files:
50
50
  - LICENSE
51
51
  - README.md
52
52
  - bundler.d/request_forwarder.rb
53
+ - lib/smart_proxy_request_forwarder.rb
53
54
  - lib/smart_proxy_request_forwarder/api.rb
54
55
  - lib/smart_proxy_request_forwarder/http_config.ru
55
56
  - lib/smart_proxy_request_forwarder/plugin.rb
56
57
  - lib/smart_proxy_request_forwarder/proxy_request.rb
57
58
  - lib/smart_proxy_request_forwarder/version.rb
58
59
  - settings.d/request_forwarder.yml.example
59
- homepage: https://github.com/theforeman/smart_proxy_request_forwarder
60
+ homepage: https://github.com/ATIX-AG/smart_proxy_request_forwarder
60
61
  licenses:
61
62
  - GPL-3.0-only
62
63
  metadata:
@@ -68,7 +69,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
68
69
  requirements:
69
70
  - - ">="
70
71
  - !ruby/object:Gem::Version
71
- version: '2.7'
72
+ version: '3.0'
72
73
  - - "<"
73
74
  - !ruby/object:Gem::Version
74
75
  version: '4'
@@ -78,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
78
79
  - !ruby/object:Gem::Version
79
80
  version: '0'
80
81
  requirements: []
81
- rubygems_version: 3.6.7
82
+ rubygems_version: 4.0.16
82
83
  specification_version: 4
83
84
  summary: Request forwarder for Foreman smart proxy
84
85
  test_files: []