exvo-auth 0.12.0 → 0.12.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,2 +1,3 @@
1
1
  .bundle
2
- pkg
2
+ pkg
3
+ Gemfile.lock
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
13
13
 
14
14
  s.required_rubygems_version = ">= 1.3.6"
15
15
  s.rubyforge_project = "exvo-auth"
16
-
16
+
17
17
  s.add_dependency "oa-oauth", "~> 0.0.4"
18
18
  s.add_dependency "httparty", "~> 0.6.1"
19
19
  s.add_dependency "activemodel", "~> 3.0.0"
@@ -38,7 +38,7 @@ module ExvoAuth::Controllers::Base
38
38
  redirect_to sign_out_url(return_to)
39
39
  end
40
40
 
41
- def authenticate_app_in_scope!(scope)
41
+ def authenticate_app_in_scope!(scope)
42
42
  raise("SSL not configured. Your api needs to be exposed using https protocol.") unless request.ssl? || ExvoAuth::Config.require_ssl == false
43
43
 
44
44
  send(basic_authentication_method_name) do |app_id, access_token|
@@ -48,24 +48,24 @@ module ExvoAuth::Controllers::Base
48
48
  ).scopes
49
49
 
50
50
  @current_app_id = app_id
51
-
51
+
52
52
  current_scopes.include?(scope.to_s)
53
53
  end
54
54
  end
55
-
55
+
56
56
  def sign_in_path
57
57
  "/auth/interactive"
58
58
  end
59
-
59
+
60
60
  def sign_up_path
61
61
  "/auth/interactive?x_sign_up=true"
62
62
  end
63
-
63
+
64
64
  def current_user
65
65
  return @current_user if defined?(@current_user)
66
66
  @current_user = session[:user_uid] && find_or_create_user_by_uid(session[:user_uid])
67
67
  end
68
-
68
+
69
69
  def current_app_id
70
70
  @current_app_id
71
71
  end
@@ -73,9 +73,9 @@ module ExvoAuth::Controllers::Base
73
73
  def signed_in?
74
74
  !!current_user
75
75
  end
76
-
76
+
77
77
  protected
78
-
78
+
79
79
  def find_or_create_user_by_uid(uid)
80
80
  raise "Implement find_or_create_user_by_uid in a controller"
81
81
  end
@@ -91,7 +91,7 @@ module ExvoAuth::Controllers::Base
91
91
  end
92
92
 
93
93
  def current_request
94
- request.params.reject{ |k, v| ["controller", "action"].include?(k) }.merge(
94
+ request.params.reject{ |k, v| ["controller", "action"].include?(k) || v.nil? }.merge(
95
95
  :_dejavu => {
96
96
  :script_name => request.script_name, # for Rack::Request
97
97
  :path_info => request.path_info, # for Rack::Request
@@ -105,7 +105,7 @@ module ExvoAuth::Controllers::Base
105
105
  def store_request!
106
106
  session[:stored_request] = Base64.encode64(MultiJson.encode(current_request))
107
107
  end
108
-
108
+
109
109
  def request_replay_url
110
110
  if stored_request = session.delete(:stored_request)
111
111
  params = MultiJson.decode(Base64.decode64(stored_request))
@@ -1,3 +1,3 @@
1
1
  module ExvoAuth
2
- VERSION = "0.12.0"
2
+ VERSION = "0.12.1"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exvo-auth
3
3
  version: !ruby/object:Gem::Version
4
- hash: 47
4
+ hash: 45
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 12
9
- - 0
10
- version: 0.12.0
9
+ - 1
10
+ version: 0.12.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jacek Becela
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-01-19 00:00:00 +01:00
18
+ date: 2011-02-14 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency