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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 53fbc5bf21449f93f01689aaee5cf3fd4e16ed3b
4
- data.tar.gz: c4af878d4ee62d00b5c7502381a31a10c141420a
3
+ metadata.gz: 7fdf29f36672a7e1ef81b0f3c9203d4e2d8e002b
4
+ data.tar.gz: 76f9c607b27caa6c7c82479a5979bc8a3e6bc8a6
5
5
  SHA512:
6
- metadata.gz: 6f4b68f7f6eda877644238e3d958659976e38accb04949a7cea8da455a0176396a2e600bec0bd7eef7db05ca260ba9eb469a626d8c84411b31f16f7ca75497d0
7
- data.tar.gz: 619aed2e59e49bd216d0e67ad6e192f5b4ef24c945e42f308d4bf8bf5d440b9b44dc87033c87bf7b3d5beeb2f8396020d99f944b29eb7443cb366aa51b70b5b8
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
@@ -1,5 +1,5 @@
1
1
  module Proxy
2
2
  class Dynflow
3
- VERSION = '0.1.7'
3
+ VERSION = '0.1.8'
4
4
  end
5
5
  end
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.7
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-08-15 00:00:00.000000000 Z
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.4.5
152
+ rubygems_version: 2.6.12
153
153
  signing_key:
154
154
  specification_version: 4
155
155
  summary: Dynflow runtime for Foreman smart proxy