RubyApp 0.0.14 → 0.0.15
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/ruby_app/elements/pages/authentication/open_id/authentication_page.rb +1 -5
- data/lib/ruby_app/elements/pages/authentication/open_id/ax_authentication_page.rb +3 -4
- data/lib/ruby_app/elements/pages/authentication/open_id/email_authentication_page.rb +35 -0
- data/lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb +3 -4
- data/lib/ruby_app/session.rb +1 -7
- data/lib/ruby_app/version.rb +1 -1
- metadata +5 -4
data/Gemfile.lock
CHANGED
@@ -57,11 +57,7 @@ module RubyApp
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def create_identity_from_response(response)
|
60
|
-
|
61
|
-
end
|
62
|
-
|
63
|
-
def create_identity_from_url(url, data = {})
|
64
|
-
RubyApp::Session::Identity.new(url, data)
|
60
|
+
RubyApp::Session::Identity.new(response.identity_url)
|
65
61
|
end
|
66
62
|
|
67
63
|
end
|
@@ -12,10 +12,10 @@ module RubyApp
|
|
12
12
|
module Authentication
|
13
13
|
|
14
14
|
module OpenID
|
15
|
-
require 'ruby_app/elements/pages/authentication/open_id/
|
15
|
+
require 'ruby_app/elements/pages/authentication/open_id/email_authentication_page'
|
16
16
|
require 'ruby_app/session'
|
17
17
|
|
18
|
-
class AXAuthenticationPage < RubyApp::Elements::Pages::Authentication::OpenID::
|
18
|
+
class AXAuthenticationPage < RubyApp::Elements::Pages::Authentication::OpenID::EmailAuthenticationPage
|
19
19
|
|
20
20
|
template_path(:all, File.dirname(__FILE__))
|
21
21
|
|
@@ -32,8 +32,7 @@ module RubyApp
|
|
32
32
|
def create_identity_from_response(response)
|
33
33
|
ax_response = ::OpenID::AX::FetchResponse.from_success_response(response)
|
34
34
|
if ax_response
|
35
|
-
self.
|
36
|
-
:email => ax_response.data[self.configure.attributes.email].first)
|
35
|
+
self.create_identity_from_email(ax_response.data[self.configure.attributes.email].first)
|
37
36
|
else
|
38
37
|
super(response)
|
39
38
|
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module RubyApp
|
2
|
+
|
3
|
+
module Elements
|
4
|
+
|
5
|
+
module Pages
|
6
|
+
|
7
|
+
module Authentication
|
8
|
+
|
9
|
+
module OpenID
|
10
|
+
require 'ruby_app/elements/pages/authentication/open_id/authentication_page'
|
11
|
+
require 'ruby_app/session'
|
12
|
+
|
13
|
+
class EmailAuthenticationPage < RubyApp::Elements::Pages::Authentication::OpenID::AuthenticationPage
|
14
|
+
|
15
|
+
template_path(:all, File.dirname(__FILE__))
|
16
|
+
|
17
|
+
def initialize(identifier)
|
18
|
+
super(identifier)
|
19
|
+
end
|
20
|
+
|
21
|
+
def create_identity_from_email(email)
|
22
|
+
RubyApp::Session::Identity.new(email)
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
@@ -12,10 +12,10 @@ module RubyApp
|
|
12
12
|
module Authentication
|
13
13
|
|
14
14
|
module OpenID
|
15
|
-
require 'ruby_app/elements/pages/authentication/open_id/
|
15
|
+
require 'ruby_app/elements/pages/authentication/open_id/email_authentication_page'
|
16
16
|
require 'ruby_app/session'
|
17
17
|
|
18
|
-
class SRegAuthenticationPage < RubyApp::Elements::Pages::Authentication::OpenID::
|
18
|
+
class SRegAuthenticationPage < RubyApp::Elements::Pages::Authentication::OpenID::EmailAuthenticationPage
|
19
19
|
|
20
20
|
template_path(:all, File.dirname(__FILE__))
|
21
21
|
|
@@ -32,8 +32,7 @@ module RubyApp
|
|
32
32
|
def create_identity_from_response(response)
|
33
33
|
sreg_response = ::OpenID::SReg::Response.from_success_response(response)
|
34
34
|
unless sreg_response.empty?
|
35
|
-
|
36
|
-
:email => sreg_response.data['email'])
|
35
|
+
self.create_identity_from_email(sreg_response.data['email'])
|
37
36
|
else
|
38
37
|
super(response)
|
39
38
|
end
|
data/lib/ruby_app/session.rb
CHANGED
@@ -12,17 +12,11 @@ module RubyApp
|
|
12
12
|
extend RubyApp::Mixins::TranslateMixin
|
13
13
|
|
14
14
|
class Identity
|
15
|
-
include RubyApp::Mixins::HashMixin
|
16
15
|
|
17
16
|
attr_reader :url
|
18
17
|
|
19
|
-
def initialize(url
|
18
|
+
def initialize(url)
|
20
19
|
@url = url
|
21
|
-
@data = data
|
22
|
-
end
|
23
|
-
|
24
|
-
def [](key)
|
25
|
-
@data[key]
|
26
20
|
end
|
27
21
|
|
28
22
|
end
|
data/lib/ruby_app/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: RubyApp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 1
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 15
|
10
|
+
version: 0.0.15
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Frank G. Ficnar
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-11-
|
18
|
+
date: 2011-11-29 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
version_requirements: &id001 !ruby/object:Gem::Requirement
|
@@ -421,6 +421,7 @@ files:
|
|
421
421
|
- lib/ruby_app/elements/pages/authentication/open_id/authentication_page.js.haml
|
422
422
|
- lib/ruby_app/elements/pages/authentication/open_id/authentication_page.rb
|
423
423
|
- lib/ruby_app/elements/pages/authentication/open_id/ax_authentication_page.rb
|
424
|
+
- lib/ruby_app/elements/pages/authentication/open_id/email_authentication_page.rb
|
424
425
|
- lib/ruby_app/elements/pages/authentication/open_id/google_authentication_page.rb
|
425
426
|
- lib/ruby_app/elements/pages/authentication/open_id/my_open_id_authentication_page.rb
|
426
427
|
- lib/ruby_app/elements/pages/authentication/open_id/sreg_authentication_page.rb
|