heroku-bouncer 0.4.2 → 0.4.3
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 +4 -4
- data/lib/heroku/bouncer/builder.rb +7 -7
- data/lib/heroku/bouncer/middleware.rb +4 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 415f3f61030a94fb1e1eb0a4481be6fb8d60b5cd
|
4
|
+
data.tar.gz: 7cc105448d3d48f17ac0271ce336bb355245631e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c977a0ea26bdac8fd14863a761a34492f9155b341171f707544bb9a816032f82bc29ba5414f0013168bcab71801a8ef0dcca56f20caea249a9b89eac9f577063
|
7
|
+
data.tar.gz: aa0ce2396d42163f876f37c9f3ae01c7d831250f26e664411a8aa56782101d065582c3351b705256c5bd322d6c99b2cd5a14e0b5a3cb755a5155b98c227d7e20
|
@@ -7,7 +7,7 @@ class Heroku::Bouncer::Builder
|
|
7
7
|
def self.new(app, options = {})
|
8
8
|
builder = Rack::Builder.new
|
9
9
|
id, secret, scope = extract_options!(options)
|
10
|
-
unless
|
10
|
+
unless options[:disabled]
|
11
11
|
builder.use OmniAuth::Builder do
|
12
12
|
provider :heroku, id, secret, :scope => scope
|
13
13
|
end
|
@@ -17,10 +17,10 @@ class Heroku::Bouncer::Builder
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def self.extract_options!(options)
|
20
|
-
oauth = options
|
21
|
-
id = oauth
|
22
|
-
secret = oauth
|
23
|
-
scope = oauth
|
20
|
+
oauth = options[:oauth] || {}
|
21
|
+
id = oauth[:id]
|
22
|
+
secret = oauth[:secret]
|
23
|
+
scope = oauth[:scope] || 'identity'
|
24
24
|
|
25
25
|
if id.nil? && (ENV.has_key?('HEROKU_ID') || ENV.has_key?('HEROKU_OAUTH_ID'))
|
26
26
|
$stderr.puts "[warn] heroku-bouncer: HEROKU_ID or HEROKU_OAUTH_ID detected in environment, please pass in :oauth hash instead"
|
@@ -32,8 +32,8 @@ class Heroku::Bouncer::Builder
|
|
32
32
|
secret = ENV['HEROKU_OAUTH_SECRET'] || ENV['HEROKU_SECRET']
|
33
33
|
end
|
34
34
|
|
35
|
-
if id.nil? || secret.nil?
|
36
|
-
$stderr.puts "[fatal] heroku-bouncer:
|
35
|
+
if id.nil? || secret.nil? || id.empty? || secret.empty?
|
36
|
+
$stderr.puts "[fatal] heroku-bouncer: OAuth ID or secret not set, middleware disabled"
|
37
37
|
options[:disabled] = true
|
38
38
|
end
|
39
39
|
|
@@ -172,8 +172,10 @@ private
|
|
172
172
|
end
|
173
173
|
|
174
174
|
def encrypt_store(env)
|
175
|
-
env["rack.session"]
|
176
|
-
env["rack.session"][:bouncer]
|
175
|
+
if env["rack.session"].key?(:bouncer)
|
176
|
+
env["rack.session"][:bouncer] =
|
177
|
+
env["rack.session"][:bouncer].lock(@cookie_secret)
|
178
|
+
end
|
177
179
|
end
|
178
180
|
|
179
181
|
def store
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: heroku-bouncer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Dance
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth-heroku
|