artsy-rack-auth-admin-only 0.0.2 → 0.0.3

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: ccf1628e27a7f2cffe18ec4af5b342e2dd3de8a1
4
- data.tar.gz: fc304b2236bd98f83593436abab99f142be88a0a
3
+ metadata.gz: e46aa0eb18fb3bd120985a708c5271aa32b880d4
4
+ data.tar.gz: f43d6fc0566d395cb121f88e72c52dc41056b27a
5
5
  SHA512:
6
- metadata.gz: 92e3a3cf629f521c962b2fab8a489468973929a19b8c4500b86075e8a02e6979b7d4e90b84a83424f670259208addf055322dbc301fafa098736325e752c7134
7
- data.tar.gz: ca895fbe978af7e89d4775d4adb8fd3c77a75a961d5ec3568ec979ce70013c81d4ff8f6e201ca701458cc98e6bf1011686ebf07ee9732bf2fa7a146047e37450
6
+ metadata.gz: 9e0ac13838dca9f5adbc08e1d8ccb55bdb6f1a0dcda5beb971d418b804d9c1def39415ad4fefe26fef30ef78541f75d71ae2f08ecde3c4d3c8c5ab675ba3db7a
7
+ data.tar.gz: aa6df5d739a3ef91a2e5eaef725488bd28dfcd062745cd8974160bd80c72604e571d3821190eff934065df8fb94d21bfc5c68182a2054ca399b949c804f32ada
@@ -60,7 +60,7 @@ module ArtsyAuth
60
60
  response = open(url).read
61
61
  json = JSON.parse(response)
62
62
  return authorized(json) if valid_access_token?(json['access_token'])
63
- unauthorized
63
+ not_admin
64
64
  end
65
65
 
66
66
  def authorized(json)
@@ -78,5 +78,9 @@ module ArtsyAuth
78
78
  response.redirect OAUTH_REDIRECT, 307
79
79
  response.finish
80
80
  end
81
+
82
+ def not_admin
83
+ [403, { 'Content-Type' => 'text/plain' }, ['This is an Artsy-admin only page']]
84
+ end
81
85
  end
82
86
  end
@@ -1,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*- #
2
2
 
3
3
  module ArtsyAuth
4
- VERSION = '0.0.2'.freeze
4
+ VERSION = '0.0.3'.freeze
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: artsy-rack-auth-admin-only
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Orta Therox