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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c733f127822efd64b509c325d9038b576f158fed
4
- data.tar.gz: 6a7c59cfc1e3d736443a3c7e20e2270a1ba87699
3
+ metadata.gz: 6833a739e7b56cac2f829de64d8bdb55113c7388
4
+ data.tar.gz: 7566ef97d81a1544351940baac9e246d390d30bd
5
5
  SHA512:
6
- metadata.gz: 192f2d7789ea37d404e86fa5379841998f58bc6a59ce57bdfdd8aaf89dfa14008ee25a77eba5a513ec0acbf4efe07dc7693e7281c640101bc40bdd163f4d4127
7
- data.tar.gz: eb3ca5bea7e5c15c58e5070bfc979e68f4ddcab297d61e66582fd86a2ae3ffc69996f8a8f7211f88e6db449ea3096e98ddab29755d852599bf4f2ce1989d890b
6
+ metadata.gz: 61956dbd8fc60f59724290fb3a26da118b1e084b71c4d365ba42b6a35d21bc475c696064d6d3956e5ff305dc7d5fd1e97a9f1fdebe56b7aad295e7286261149a
7
+ data.tar.gz: 222d5772ca4e500e6a24feb6d457313719f537ee2f91f2a9ba2ecd465f34c4676cd40392e2bfa1a01b02cc764c5cd2a90f865464f78b5a23b358d81191562940
data/Gemfile CHANGED
@@ -1,28 +1,10 @@
1
1
  source 'https://rubygems.org'
2
- ruby '2.2.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
@@ -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
- ATTRIBUTES.each do |name|
8
- define_method(name) { attribs[name] }
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
@@ -1,5 +1,5 @@
1
1
  module Warden
2
2
  module Oauthed
3
- VERSION = '0.0.2'
3
+ VERSION = '0.0.3'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: warden-oauthed
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
  - David Jaress