bowtie-io 1.3.2 → 1.3.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/bowtie.rb +6 -5
- data/lib/bowtie/commands/serve.rb +3 -0
- data/lib/bowtie/middleware/named_actions.rb +29 -0
- data/lib/bowtie/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1affda45f65d974b823f4635d4d303bba3e8452
|
4
|
+
data.tar.gz: 33c66f86948db451c4dc09bb671c456329110acd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e9ad3a999dc035e7f6d8b68f15fa058a9202c15ba2683247d33b46d87e8b6fdde1c03a8c66e811a0c72af5d44a280cf371eff0b1ad59423141b59b0d79d197d
|
7
|
+
data.tar.gz: b5af4476f93e6794d9457977c6183091901e9794a6041f7197eb01a57f93d05eac1b7579b8ee241b208c8ed1ee0e710a9c768889522e02d9331d5bfcadf488af
|
data/lib/bowtie.rb
CHANGED
@@ -7,11 +7,12 @@ require 'restclient'
|
|
7
7
|
|
8
8
|
module Bowtie
|
9
9
|
module Middleware
|
10
|
-
autoload :Proxy
|
11
|
-
autoload :Static
|
12
|
-
autoload :
|
13
|
-
autoload :
|
14
|
-
autoload :
|
10
|
+
autoload :Proxy , 'bowtie/middleware/proxy'
|
11
|
+
autoload :Static , 'bowtie/middleware/static'
|
12
|
+
autoload :NamedActions , 'bowtie/middleware/named_actions'
|
13
|
+
autoload :Rewrite , 'bowtie/middleware/rewrite'
|
14
|
+
autoload :PolicyCheck , 'bowtie/middleware/policy_check'
|
15
|
+
autoload :Session , 'bowtie/middleware/session'
|
15
16
|
end
|
16
17
|
|
17
18
|
autoload :Settings, 'bowtie/settings'
|
@@ -35,6 +35,9 @@ module Bowtie
|
|
35
35
|
use Rack::Session::Cookie, key: 'client.session',
|
36
36
|
secret: '_bowtie_client_local'
|
37
37
|
|
38
|
+
# Redirect overrides based on local settings.json
|
39
|
+
use Bowtie::Middleware::NamedActions
|
40
|
+
|
38
41
|
use Bowtie::Middleware::Rewrite, options
|
39
42
|
|
40
43
|
# User management provided by BowTie /users/*
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module Bowtie::Middleware
|
2
|
+
class NamedActions
|
3
|
+
def initialize(app)
|
4
|
+
@app = app
|
5
|
+
end
|
6
|
+
|
7
|
+
def call(env)
|
8
|
+
status, headers, response = @app.call(env)
|
9
|
+
|
10
|
+
action = headers['X-Bowtie-Client-Named-Action']
|
11
|
+
|
12
|
+
if action == 'sign_in'
|
13
|
+
location_override_path = Bowtie::Settings['users']['after_sign_in_path'] rescue nil
|
14
|
+
elsif action == 'sign_up'
|
15
|
+
location_override_path = Bowtie::Settings['users']['after_sign_up_path'] rescue nil
|
16
|
+
elsif action == 'sign_out'
|
17
|
+
location_override_path = Bowtie::Settings['users']['after_sign_out_path'] rescue nil
|
18
|
+
end
|
19
|
+
|
20
|
+
if location_override_path
|
21
|
+
location = URI(headers['Location'])
|
22
|
+
location.path = location_override_path
|
23
|
+
headers.merge!('Location' => location.to_s)
|
24
|
+
end
|
25
|
+
|
26
|
+
[status, headers, response]
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/lib/bowtie/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bowtie-io
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Kassemi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -93,6 +93,7 @@ files:
|
|
93
93
|
- lib/bowtie/command.rb
|
94
94
|
- lib/bowtie/commands/serve.rb
|
95
95
|
- lib/bowtie/errors.rb
|
96
|
+
- lib/bowtie/middleware/named_actions.rb
|
96
97
|
- lib/bowtie/middleware/policy_check.rb
|
97
98
|
- lib/bowtie/middleware/proxy.rb
|
98
99
|
- lib/bowtie/middleware/rewrite.rb
|