flipper-ui 0.11.0.beta7 → 0.11.0.beta8
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/docs/ui/README.md +19 -3
- data/lib/flipper/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0591a016ba0727084a82aee75f31b3a2f661dc0b'
|
4
|
+
data.tar.gz: 29b733e6f872bf8c7a81ebeb51d4f598fb164a69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc04a272f7f16641f6bc40baa50cf85b302ee5b3a91df34ca4b0dc0150de0ab6a019883e111419cd15d3cdaa76e473090dd619ebcb23a76a93f3f7353f1bcb0e
|
7
|
+
data.tar.gz: 35e34edc3239d7f44fd7ab97b77da8d0914a633a6e0e13d0d91b90e73a87d00cb2b24f0db7f3005bd561590a3ea716cbd3b15931a28569286b99a4b477a9188c
|
data/docs/ui/README.md
CHANGED
@@ -52,7 +52,24 @@ end
|
|
52
52
|
|
53
53
|
#### Security
|
54
54
|
|
55
|
-
You almost certainly want to limit access when using Flipper::UI in production.
|
55
|
+
You almost certainly want to limit access when using Flipper::UI in production.
|
56
|
+
|
57
|
+
##### Basic Authentication via Rack
|
58
|
+
The `Flipper::UI.app` method yields a builder instance prior to any predefined middleware. You can insert the `Rack::Auth::Basic` middleware, that'll prompt for a username and password when visiting the defined (i.e., `/flipper`) route.
|
59
|
+
|
60
|
+
```ruby
|
61
|
+
# config/routes.rb
|
62
|
+
|
63
|
+
flipper_app = Flipper::UI.app(Flipper.instance) do |builder|
|
64
|
+
builder.use Rack::Auth::Basic do |username, password|
|
65
|
+
# Verify credentials
|
66
|
+
end
|
67
|
+
end
|
68
|
+
mount flipper_app, at: '/flipper'
|
69
|
+
```
|
70
|
+
|
71
|
+
##### Route Constraints
|
72
|
+
It is possible to use [routes constraints](http://guides.rubyonrails.org/routing.html#request-based-constraints) to limit access to routes:
|
56
73
|
|
57
74
|
```ruby
|
58
75
|
# config/routes.rb
|
@@ -63,7 +80,7 @@ constraints flipper_constraint do
|
|
63
80
|
end
|
64
81
|
```
|
65
82
|
|
66
|
-
Another example
|
83
|
+
Another example is to use the `current_user` when using a gem-based authentication system (i.e., [warden](https://github.com/hassox/warden) or [devise](https://github.com/plataformatec/devise)):
|
67
84
|
|
68
85
|
```ruby
|
69
86
|
# initializers/admin_access.rb
|
@@ -82,7 +99,6 @@ constraints CanAccessFlipperUI do
|
|
82
99
|
end
|
83
100
|
```
|
84
101
|
|
85
|
-
|
86
102
|
### Standalone
|
87
103
|
|
88
104
|
Minimal example for Rack:
|
data/lib/flipper/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flipper-ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.0.
|
4
|
+
version: 0.11.0.beta8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Nunemaker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -56,14 +56,14 @@ dependencies:
|
|
56
56
|
requirements:
|
57
57
|
- - "~>"
|
58
58
|
- !ruby/object:Gem::Version
|
59
|
-
version: 0.11.0.
|
59
|
+
version: 0.11.0.beta8
|
60
60
|
type: :runtime
|
61
61
|
prerelease: false
|
62
62
|
version_requirements: !ruby/object:Gem::Requirement
|
63
63
|
requirements:
|
64
64
|
- - "~>"
|
65
65
|
- !ruby/object:Gem::Version
|
66
|
-
version: 0.11.0.
|
66
|
+
version: 0.11.0.beta8
|
67
67
|
- !ruby/object:Gem::Dependency
|
68
68
|
name: erubis
|
69
69
|
requirement: !ruby/object:Gem::Requirement
|