smart_proxy_dynflow 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of smart_proxy_dynflow might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/lib/smart_proxy_dynflow/api.rb +7 -4
- data/lib/smart_proxy_dynflow/callback.rb +2 -0
- data/lib/smart_proxy_dynflow/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7fdf29f36672a7e1ef81b0f3c9203d4e2d8e002b
|
4
|
+
data.tar.gz: 76f9c607b27caa6c7c82479a5979bc8a3e6bc8a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7c84a6a1ef2fd66b804130cf05c83dd77151e6e0fb2541cbc74fe5932bbdd3ce493bfe4385b5af843478773ef9639c3a570f9150b02f9398d3e49aa6abd1f53
|
7
|
+
data.tar.gz: 147474da3ada8c3f12ecbaf128c31fa078006ca7d4b4b9b0bc90a2cdb5d94286d281bfa6cbf2bc94b2a345fa7c0ec84666eb731479012c69e981d900ead5d2b4
|
@@ -1,21 +1,24 @@
|
|
1
1
|
require 'sinatra/base'
|
2
2
|
require 'proxy/helpers'
|
3
3
|
require 'sinatra/authorization'
|
4
|
+
|
4
5
|
module Proxy
|
5
6
|
class Dynflow
|
6
7
|
class Api < ::Sinatra::Base
|
7
8
|
helpers ::Proxy::Helpers
|
8
9
|
helpers ::Proxy::Dynflow::Helpers
|
9
|
-
extend ::Sinatra::Authorization
|
10
|
-
|
11
|
-
authorize_with_trusted_hosts
|
12
|
-
authorize_with_ssl_client
|
13
10
|
|
14
11
|
before do
|
15
12
|
logger = Proxy::LogBuffer::Decorator.instance
|
16
13
|
content_type :json
|
14
|
+
if request.env['HTTP_AUTHORIZATION'] && request.env['PATH_INFO'].end_with?('/done')
|
15
|
+
# Halt running before callbacks if a token is provided and the request is notifying about task being done
|
16
|
+
return
|
17
|
+
end
|
17
18
|
end
|
18
19
|
|
20
|
+
helpers Sinatra::Authorization
|
21
|
+
|
19
22
|
post "/*" do
|
20
23
|
relay_request
|
21
24
|
end
|
@@ -17,6 +17,8 @@ module Proxy
|
|
17
17
|
when 'POST'
|
18
18
|
request_factory.create_post path, request.body.read
|
19
19
|
end
|
20
|
+
req['X-Forwarded-For'] = request.env['HTTP_HOST']
|
21
|
+
req['AUTHORIZATION'] = request.env['HTTP_AUTHORIZATION']
|
20
22
|
response = send_request req
|
21
23
|
Proxy::LogBuffer::Decorator.instance.debug "Proxy request status #{response.code} - #{response}"
|
22
24
|
response
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smart_proxy_dynflow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Nečas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -149,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
149
149
|
version: '0'
|
150
150
|
requirements: []
|
151
151
|
rubyforge_project:
|
152
|
-
rubygems_version: 2.
|
152
|
+
rubygems_version: 2.6.12
|
153
153
|
signing_key:
|
154
154
|
specification_version: 4
|
155
155
|
summary: Dynflow runtime for Foreman smart proxy
|