warden-oauthed 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 +4 -4
- data/Gemfile +2 -20
- data/lib/warden-oauthed/user.rb +8 -3
- data/lib/warden-oauthed/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6833a739e7b56cac2f829de64d8bdb55113c7388
|
4
|
+
data.tar.gz: 7566ef97d81a1544351940baac9e246d390d30bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61956dbd8fc60f59724290fb3a26da118b1e084b71c4d365ba42b6a35d21bc475c696064d6d3956e5ff305dc7d5fd1e97a9f1fdebe56b7aad295e7286261149a
|
7
|
+
data.tar.gz: 222d5772ca4e500e6a24feb6d457313719f537ee2f91f2a9ba2ecd465f34c4676cd40392e2bfa1a01b02cc764c5cd2a90f865464f78b5a23b358d81191562940
|
data/Gemfile
CHANGED
@@ -1,28 +1,10 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
|
-
|
3
|
-
|
4
|
-
gem 'multi_json', '~>1.11.2'
|
5
|
-
gem 'json', '~>1.5'
|
6
|
-
gem 'warden', '~>1.0'
|
7
|
-
gem 'oauth2', '~>0.5.2'
|
8
|
-
gem 'rack', '~>1.6.0'
|
9
|
-
gem 'rake'
|
10
|
-
gem 'sinatra'
|
2
|
+
gemspec
|
11
3
|
|
12
4
|
group :development, :test do
|
13
|
-
gem 'rubocop'
|
14
|
-
gem 'rerun'
|
15
5
|
gem 'rspec', '~> 2.7'
|
16
6
|
gem 'guard'
|
17
7
|
gem 'guard-rubocop'
|
18
8
|
gem 'guard-rspec', '4.2.8'
|
19
9
|
gem 'guard-livereload'
|
20
|
-
end
|
21
|
-
|
22
|
-
group :test do
|
23
|
-
gem 'shotgun'
|
24
|
-
gem 'addressable', '~>2.2.0'
|
25
|
-
gem 'rack-test', '~>0.5.3'
|
26
|
-
gem 'webrat'
|
27
|
-
end
|
28
|
-
|
10
|
+
end
|
data/lib/warden-oauthed/user.rb
CHANGED
@@ -2,12 +2,17 @@ module Warden
|
|
2
2
|
module Oauthed
|
3
3
|
module Oauth
|
4
4
|
class User < Struct.new(:attribs, :token)
|
5
|
-
ATTRIBUTES = (ENV['USER_ATTRIBUTES'] || 'id email').split(/\s/).freeze
|
6
5
|
|
7
|
-
|
8
|
-
|
6
|
+
def oauthed_raw_request(path, params = {})
|
7
|
+
puts "#{ENV['API_BASE_URL'] }/#{path}"
|
8
|
+
req = Faraday.new(url: "#{ENV['API_BASE_URL'] }/#{path}")
|
9
|
+
req.authorization :Bearer, token
|
10
|
+
req.get.body
|
9
11
|
end
|
10
12
|
|
13
|
+
def oauthed_request(path, params = {})
|
14
|
+
MultiJson.load(oauthed_raw_request(path, params))
|
15
|
+
end
|
11
16
|
end
|
12
17
|
end
|
13
18
|
end
|