conjur-asset-proxy 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 33c7c309c97f11b81d0ff2279a45cec58f0abef0
4
- data.tar.gz: 5c822a7b65fa193fccffc608f9ca3efcbf8c3c2e
3
+ metadata.gz: 87499320c6f82f4e78d1ca7583d024b4d58b6b1b
4
+ data.tar.gz: f8c5f5bb289ab695e545192768e45ab799ef1248
5
5
  SHA512:
6
- metadata.gz: 2cc41fa816077395219eb4f4ec575693dca789a25e5d3c61bd363f239e595182b976036f51d824c65b4be712a372b1571b7d289532dfdad43d3451ae9179ab22
7
- data.tar.gz: f2e1905f67c87c30da20df68c12da7a09be88f67af616a4e20e963d194db25539f9d55e31558fc3913079cdd2afc7acef42463e7d35c92afc6dff064aedfb651
6
+ metadata.gz: 21680df0fe95e83e7f0191fba1a7a5e2e204a8765826dc65419793944e694c7e8c896a1bb0cd923ee20d1e79f831a9962f706bb70e37544af63243ccfba39646
7
+ data.tar.gz: 9d0c1edb14946d3b3ae074ed02a837af1ca8eb68935163baafac2d1f81918b1d488910058e5df71d353909d6199a58db8a223b2594fc3877e3d60c4e8a5cd8df
data/Rakefile CHANGED
@@ -1,5 +1,6 @@
1
1
  require "bundler/gem_tasks"
2
2
 
3
+ desc "Update copyright headers"
3
4
  task :headers do
4
5
  require 'rubygems'
5
6
  require 'copyright_header'
@@ -17,3 +18,8 @@ task :headers do
17
18
  command_line = CopyrightHeader::CommandLine.new( args )
18
19
  command_line.execute
19
20
  end
21
+
22
+ task :jenkins do
23
+ # TODO
24
+ puts "No tests, maybe add some specs?"
25
+ end
@@ -23,6 +23,7 @@ Gem::Specification.new do |spec|
23
23
  spec.add_runtime_dependency "rack", "~> 1.5"
24
24
  spec.add_runtime_dependency "rack-streaming-proxy", "~> 2.0"
25
25
  spec.add_runtime_dependency "thin", "~> 1.6"
26
+ spec.add_runtime_dependency "escape_utils", "~> 1.0"
26
27
 
27
28
  spec.add_development_dependency "bundler", "~> 1.6"
28
29
  spec.add_development_dependency "rake"
@@ -21,7 +21,7 @@
21
21
  module Conjur
22
22
  module Asset
23
23
  module Proxy
24
- VERSION = "0.3.2"
24
+ VERSION = "0.3.3"
25
25
  end
26
26
  end
27
27
  end
@@ -41,7 +41,7 @@ terminated.
41
41
 
42
42
  c.switch :k,
43
43
  desc: "Don't verificate HTTPS certificate"
44
-
44
+
45
45
  c.flag :cacert,
46
46
  desc: "Verify SSL using the provided cert file"
47
47
 
@@ -52,6 +52,18 @@ terminated.
52
52
  options[:insecure] = true
53
53
  end
54
54
 
55
+ unless url.start_with?('http://') || url.start_with?('https://')
56
+ url = url.gsub(/^(.+?\:(\/)?(\/)?)?/, 'https://')
57
+ end
58
+
59
+ require 'uri'
60
+
61
+ uri = URI.parse(url)
62
+ uri.path = ''
63
+ uri.query = nil
64
+
65
+ url = uri.to_s
66
+
55
67
  options.slice! :port, :address, :insecure, :cacert
56
68
  options.delete :port unless options[:port].respond_to? :to_i
57
69
 
data/lib/conjur/proxy.rb CHANGED
@@ -40,7 +40,14 @@ module Conjur
40
40
  attr_reader :proxy, :conjur
41
41
 
42
42
  def call env
43
- env["HTTP_AUTHORIZATION"] = conjur.credentials[:headers][:authorization]
43
+ env['HTTP_AUTHORIZATION'] = conjur.credentials[:headers][:authorization]
44
+
45
+ if (env['REQUEST_METHOD'] == 'POST' || env['REQUEST_METHOD'] == 'PUT')
46
+ if !env.include?('CONTENT_LENGTH') && (!env.include?('TRANSFER_ENCODING') ||
47
+ env['TRANSFER_ENCODING'] != 'chunked')
48
+ env['CONTENT_LENGTH'] = '0'
49
+ end
50
+ end
44
51
 
45
52
  ret = proxy.call env
46
53
 
@@ -66,7 +73,7 @@ module Conjur
66
73
  end
67
74
  end
68
75
  end
69
-
76
+
70
77
  if options[:cacert]
71
78
  OpenSSL::SSL::SSLContext::DEFAULT_CERT_STORE.add_file options[:cacert]
72
79
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: conjur-asset-proxy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rafał Rzepecki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-07 00:00:00.000000000 Z
11
+ date: 2014-10-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gli
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - ~>
81
81
  - !ruby/object:Gem::Version
82
82
  version: '1.6'
83
+ - !ruby/object:Gem::Dependency
84
+ name: escape_utils
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ~>
88
+ - !ruby/object:Gem::Version
89
+ version: '1.0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ~>
95
+ - !ruby/object:Gem::Version
96
+ version: '1.0'
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: bundler
85
99
  requirement: !ruby/object:Gem::Requirement