bouncer-client 0.1 → 0.1.1
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 284e65e35d8e30fe0dd576664e52fe91399a38ad
|
|
4
|
+
data.tar.gz: e03e637d06317538278c9c2b01813e4e592a752b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b51b67910d070fe49117b6862315e37d1693b9421330dbc5a249c626cbf0b86adfce90c19231125fa565581a93aea1c2f0c9c42d0bda3726d62fd1eb8992f050
|
|
7
|
+
data.tar.gz: 88f163cf07fa042db7f8e9905a2d8b7381865898c77e4fb891dc2e6e2e033e8155f03b35d3d34034079c1f159067b8bba382dedee5d7edd8d2cfbeedab6f2912
|
|
@@ -2,6 +2,7 @@ require 'active_support/rescuable'
|
|
|
2
2
|
module Bouncer
|
|
3
3
|
module ControllerMixin
|
|
4
4
|
def current_user
|
|
5
|
+
return nil unless Bouncer::Token.present? request
|
|
5
6
|
@token ||= Bouncer::Token.new(request.headers['authorization'])
|
|
6
7
|
end
|
|
7
8
|
|
|
@@ -15,7 +16,7 @@ module Bouncer
|
|
|
15
16
|
raise UnauthorizedError unless current_user.super_admin?
|
|
16
17
|
end
|
|
17
18
|
|
|
18
|
-
def
|
|
19
|
+
def authenticate_device!
|
|
19
20
|
authenticate_user!
|
|
20
21
|
raise UnauthorizedError unless current_user.device?
|
|
21
22
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bouncer-client
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kurt Nelson
|
|
@@ -212,7 +212,6 @@ files:
|
|
|
212
212
|
- Rakefile
|
|
213
213
|
- bouncer-client.gemspec
|
|
214
214
|
- lib/bouncer-client.rb
|
|
215
|
-
- lib/bouncer-client/.token.rb.swp
|
|
216
215
|
- lib/bouncer-client/client.rb
|
|
217
216
|
- lib/bouncer-client/controller_mixin.rb
|
|
218
217
|
- lib/bouncer-client/errors.rb
|
|
@@ -221,7 +220,6 @@ files:
|
|
|
221
220
|
- lib/bouncer-client/version.rb
|
|
222
221
|
- spec/cassettes/bouncer/valid_admin.yml
|
|
223
222
|
- spec/cassettes/bouncer/valid_device.yml
|
|
224
|
-
- spec/model/.token_spec.rb.swp
|
|
225
223
|
- spec/model/token_spec.rb
|
|
226
224
|
- spec/spec_helper.rb
|
|
227
225
|
homepage: ''
|
|
@@ -251,6 +249,5 @@ summary: Allows Rails to easily use a Bouncer instance for authentication
|
|
|
251
249
|
test_files:
|
|
252
250
|
- spec/cassettes/bouncer/valid_admin.yml
|
|
253
251
|
- spec/cassettes/bouncer/valid_device.yml
|
|
254
|
-
- spec/model/.token_spec.rb.swp
|
|
255
252
|
- spec/model/token_spec.rb
|
|
256
253
|
- spec/spec_helper.rb
|
|
Binary file
|
|
Binary file
|