exvo-auth 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.0
1
+ 0.6.1
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{exvo-auth}
8
- s.version = "0.6.0"
8
+ s.version = "0.6.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jacek Becela"]
@@ -8,8 +8,19 @@ module ExvoAuth::Controllers::Merb
8
8
  def authenticate_user!
9
9
  super
10
10
  throw :halt unless signed_in?
11
- end
11
+ end
12
+
13
+ def authenticate_app_in_scope!(scope)
14
+ basic_authentication do |consumer_id, access_token|
15
+ @current_scopes = ExvoAuth::Autonomous::Provider.new(
16
+ :consumer_id => consumer_id,
17
+ :access_token => access_token
18
+ ).scopes
12
19
 
20
+ @current_scopes.include?(scope)
21
+ end
22
+ end
23
+
13
24
  protected
14
25
 
15
26
  def redirect_to(*args)
@@ -6,8 +6,6 @@ module ExvoAuth::Controllers::Rails
6
6
  end
7
7
 
8
8
  module InstanceMethods
9
- protected
10
-
11
9
  def authenticate_app_in_scope!(scope)
12
10
  authenticate_or_request_with_http_basic do |consumer_id, access_token|
13
11
  @current_scopes = ExvoAuth::Autonomous::Provider.new(
@@ -19,6 +17,8 @@ module ExvoAuth::Controllers::Rails
19
17
  end
20
18
  end
21
19
 
20
+ protected
21
+
22
22
  def find_user_by_id(id)
23
23
  User.find(id)
24
24
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 6
8
- - 0
9
- version: 0.6.0
8
+ - 1
9
+ version: 0.6.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Jacek Becela