artsy-auth 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/artsy-auth/application_controller.rb +2 -2
- data/lib/artsy-auth/version.rb +1 -1
- 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: ba8129acee8eb8eac60ecc4aed047f217b45436f
|
4
|
+
data.tar.gz: 947a25949d2e80127eafd392c766f6a264ef9700
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 550df60be40618038c3f43e9272412fe9064b970348649ba84a09f28eac27f31cadf5d9464f5a8feb84900cca3fd838fbb876b256420a01e12d702146abc3bda
|
7
|
+
data.tar.gz: 0667722d66b01375bd12b688d1b7b815986b84f778222aa5ecf05a3b4dbb1d4eb637356d9158413a6b66548e245e966aeafa8215fe96203e1c517451d907384a
|
data/README.md
CHANGED
@@ -39,7 +39,7 @@ class ApplicationController < ArtsyAuth::ApplicationController
|
|
39
39
|
protect_from_forgery with: :exception
|
40
40
|
|
41
41
|
# override applicaiton to decode token and allow only users with `tester` role
|
42
|
-
def
|
42
|
+
def authorized_artsy_token?(token)
|
43
43
|
decoded_token, _headers = JWT.decode(token, 'some-secret')
|
44
44
|
decoded_token['roles'].include? 'tester'
|
45
45
|
end
|
@@ -4,7 +4,7 @@ module ArtsyAuth
|
|
4
4
|
|
5
5
|
def require_artsy_authentication
|
6
6
|
if session[:access_token]
|
7
|
-
head(:forbidden) unless
|
7
|
+
head(:forbidden) unless authorized_artsy_token? session[:access_token]
|
8
8
|
else
|
9
9
|
clear_session_and_reauth! unless session[:access_token]
|
10
10
|
end
|
@@ -16,7 +16,7 @@ module ArtsyAuth
|
|
16
16
|
redirect_to '/auth/artsy'
|
17
17
|
end
|
18
18
|
|
19
|
-
def
|
19
|
+
def authorized_artsy_token?(token)
|
20
20
|
raise NotImplementedError
|
21
21
|
end
|
22
22
|
end
|
data/lib/artsy-auth/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: artsy-auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Artsy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth-oauth2
|