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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 305fecf03e68be0bdf3318a8fc2101f8c3c0f353
4
- data.tar.gz: 85ee69bbefe9a059e277b7c6e9303a1aee50cf2c
3
+ metadata.gz: ba8129acee8eb8eac60ecc4aed047f217b45436f
4
+ data.tar.gz: 947a25949d2e80127eafd392c766f6a264ef9700
5
5
  SHA512:
6
- metadata.gz: 7f0adf37a1c0c4595c8dcd7f86604ce56f1a842f70b788c0b49d459b7a473da3e8c5f45c57f4fd6e89d13b9a31e6756a6c36a3f52078aadc4ce16030b83204c0
7
- data.tar.gz: 87ff585e1c801ea3d3fec086eea12eb1df5e3b5a1eb04816096ad4ba098f63472519869c09f2b9a9e5474414879c40046d53445004c70f2449907da16830e4ec
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 authorized?(token)
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 authorized? session[:access_token]
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 authorized?(token)
19
+ def authorized_artsy_token?(token)
20
20
  raise NotImplementedError
21
21
  end
22
22
  end
@@ -1,3 +1,3 @@
1
1
  module ArtsyAuth
2
- VERSION = '0.1.6'.freeze
2
+ VERSION = '0.1.7'.freeze
3
3
  end
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.6
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-04 00:00:00.000000000 Z
11
+ date: 2017-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth-oauth2