RubyApp 0.0.21 → 0.0.22
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +2 -2
- data/lib/ruby_app/elements/pages/authentication/open_id/authentication_page.rb +3 -46
- data/lib/ruby_app/elements/pages/authentication/open_id/base/base_authentication_page.css.haml +9 -0
- data/lib/ruby_app/elements/pages/authentication/open_id/base/base_authentication_page.html.haml +8 -0
- data/lib/ruby_app/elements/pages/authentication/open_id/base/base_authentication_page.js.haml +1 -0
- data/lib/ruby_app/elements/pages/authentication/open_id/base/base_authentication_page.rb +75 -0
- data/lib/ruby_app/resources/elements/pages/authentication/open_id/base/base_authentication_page.gif +0 -0
- data/lib/ruby_app/themes/mobile.rb +2 -0
- data/lib/ruby_app/themes/mobile/pages/authentication/open_id/authentication_page.css.haml +13 -0
- data/lib/ruby_app/translations/en.yml +3 -3
- data/lib/ruby_app/version.rb +1 -1
- metadata +10 -6
- data/lib/ruby_app/elements/pages/authentication/open_id/authentication_page.css.haml +0 -2
- data/lib/ruby_app/elements/pages/authentication/open_id/authentication_page.js.haml +0 -2
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
RubyApp (0.0.
|
4
|
+
RubyApp (0.0.22)
|
5
5
|
BlueCloth
|
6
6
|
chronic
|
7
7
|
chronic_duration
|
@@ -75,7 +75,7 @@ GEM
|
|
75
75
|
ruby-openid (2.1.8)
|
76
76
|
rubyzip (0.9.5)
|
77
77
|
sass (3.1.11)
|
78
|
-
selenium-webdriver (2.
|
78
|
+
selenium-webdriver (2.15.0)
|
79
79
|
childprocess (>= 0.2.1)
|
80
80
|
ffi (~> 1.0.9)
|
81
81
|
multi_json (~> 1.0.4)
|
@@ -1,8 +1,3 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'bundler/setup'
|
3
|
-
|
4
|
-
require 'openid'
|
5
|
-
|
6
1
|
module RubyApp
|
7
2
|
|
8
3
|
module Elements
|
@@ -12,52 +7,14 @@ module RubyApp
|
|
12
7
|
module Authentication
|
13
8
|
|
14
9
|
module OpenID
|
15
|
-
require 'ruby_app/elements/
|
16
|
-
require 'ruby_app/log'
|
17
|
-
require 'ruby_app/request'
|
18
|
-
require 'ruby_app/session'
|
10
|
+
require 'ruby_app/elements/pages/authentication/open_id/base/base_authentication_page'
|
19
11
|
|
20
|
-
class AuthenticationPage < RubyApp::Elements::
|
12
|
+
class AuthenticationPage < RubyApp::Elements::Pages::Authentication::OpenID::Base::BaseAuthenticationPage
|
21
13
|
|
22
14
|
template_path(:all, File.dirname(__FILE__))
|
23
15
|
|
24
16
|
def initialize(identifier)
|
25
|
-
super()
|
26
|
-
|
27
|
-
self.loaded do |element, event|
|
28
|
-
RubyApp::Session.show(event, RubyApp::Elements::Dialogs::BusyDialog.new(RubyApp::Elements::Pages::Authentication::OpenID::AuthenticationPage.translate.busy_dialog.message)) do |_event|
|
29
|
-
if RubyApp::Request.query.empty?
|
30
|
-
@consumer = ::OpenID::Consumer.new(RubyApp::Session.data, nil)
|
31
|
-
RubyApp::Log.debug("#{self.class}#loaded identifier=#{identifier.inspect}")
|
32
|
-
request = @consumer.begin(identifier)
|
33
|
-
self.process_request(request)
|
34
|
-
_event.go(request.redirect_url(RubyApp::Request.url, RubyApp::Request.url))
|
35
|
-
else
|
36
|
-
response = @consumer.complete(RubyApp::Request.query, RubyApp::Request.url)
|
37
|
-
RubyApp::Log.debug("#{self.class}#loaded response.class=#{response.class}")
|
38
|
-
case response.status
|
39
|
-
when ::OpenID::Consumer::SUCCESS
|
40
|
-
RubyApp::Log.debug("#{self.class}#loaded response.identity_url=#{response.identity_url.inspect}")
|
41
|
-
RubyApp::Session.identity = self.create_identity_from_response(response)
|
42
|
-
RubyApp::Session.pages.pop
|
43
|
-
_event.refresh
|
44
|
-
when ::OpenID::Consumer::CANCEL
|
45
|
-
RubyApp::Session.pages.pop
|
46
|
-
_event.refresh
|
47
|
-
when ::OpenID::Consumer::FAILURE
|
48
|
-
RubyApp::Log.debug("#{self.class}#loaded response=#{response.inspect}")
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
end
|
55
|
-
|
56
|
-
def process_request(request)
|
57
|
-
end
|
58
|
-
|
59
|
-
def create_identity_from_response(response)
|
60
|
-
RubyApp::Session::Identity.new(response.identity_url)
|
17
|
+
super(identifier)
|
61
18
|
end
|
62
19
|
|
63
20
|
end
|
data/lib/ruby_app/elements/pages/authentication/open_id/base/base_authentication_page.html.haml
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
- self.content_for(:body) do
|
2
|
+
/
|
3
|
+
#{__FILE__}
|
4
|
+
%div.wait
|
5
|
+
%div.image
|
6
|
+
%img{:src => '/ruby_app/resources/elements/pages/authentication/open_id/base/base_authentication_page.gif'}
|
7
|
+
%div.content
|
8
|
+
= RubyApp::Elements::Pages::Authentication::OpenID::Base::BaseAuthenticationPage.translate.message
|
@@ -0,0 +1 @@
|
|
1
|
+
= yield
|
@@ -0,0 +1,75 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler/setup'
|
3
|
+
|
4
|
+
require 'openid'
|
5
|
+
|
6
|
+
module RubyApp
|
7
|
+
|
8
|
+
module Elements
|
9
|
+
|
10
|
+
module Pages
|
11
|
+
|
12
|
+
module Authentication
|
13
|
+
|
14
|
+
module OpenID
|
15
|
+
|
16
|
+
module Base
|
17
|
+
require 'ruby_app/elements/page'
|
18
|
+
require 'ruby_app/log'
|
19
|
+
require 'ruby_app/request'
|
20
|
+
require 'ruby_app/session'
|
21
|
+
|
22
|
+
class BaseAuthenticationPage < RubyApp::Elements::Page
|
23
|
+
|
24
|
+
template_path(:all, File.dirname(__FILE__))
|
25
|
+
|
26
|
+
def initialize(identifier)
|
27
|
+
super()
|
28
|
+
|
29
|
+
self.loaded do |element, event|
|
30
|
+
if RubyApp::Request.query.empty?
|
31
|
+
@consumer = ::OpenID::Consumer.new(RubyApp::Session.data, nil)
|
32
|
+
RubyApp::Log.debug("#{self.class}#loaded identifier=#{identifier.inspect}")
|
33
|
+
request = @consumer.begin(identifier)
|
34
|
+
self.process_request(request)
|
35
|
+
event.go(request.redirect_url(RubyApp::Request.url, RubyApp::Request.url))
|
36
|
+
else
|
37
|
+
response = @consumer.complete(RubyApp::Request.query, RubyApp::Request.url)
|
38
|
+
RubyApp::Log.debug("#{self.class}#loaded response.class=#{response.class}")
|
39
|
+
case response.status
|
40
|
+
when ::OpenID::Consumer::SUCCESS
|
41
|
+
RubyApp::Log.debug("#{self.class}#loaded response.identity_url=#{response.identity_url.inspect}")
|
42
|
+
RubyApp::Session.identity = self.create_identity_from_response(response)
|
43
|
+
RubyApp::Session.pages.pop
|
44
|
+
event.refresh
|
45
|
+
when ::OpenID::Consumer::CANCEL
|
46
|
+
RubyApp::Session.pages.pop
|
47
|
+
event.refresh
|
48
|
+
when ::OpenID::Consumer::FAILURE
|
49
|
+
RubyApp::Log.debug("#{self.class}#loaded response=#{response.inspect}")
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
55
|
+
|
56
|
+
def process_request(request)
|
57
|
+
end
|
58
|
+
|
59
|
+
def create_identity_from_response(response)
|
60
|
+
RubyApp::Session::Identity.new(response.identity_url)
|
61
|
+
end
|
62
|
+
|
63
|
+
end
|
64
|
+
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
68
|
+
|
69
|
+
end
|
70
|
+
|
71
|
+
end
|
72
|
+
|
73
|
+
end
|
74
|
+
|
75
|
+
end
|
data/lib/ruby_app/resources/elements/pages/authentication/open_id/base/base_authentication_page.gif
ADDED
Binary file
|
@@ -17,6 +17,7 @@ require 'ruby_app/elements/lists/select'
|
|
17
17
|
require 'ruby_app/elements/markdown'
|
18
18
|
require 'ruby_app/elements/navigation/base/base_breadcrumbs'
|
19
19
|
require 'ruby_app/elements/page'
|
20
|
+
require 'ruby_app/elements/pages/authentication/open_id/authentication_page'
|
20
21
|
require 'ruby_app/elements/pages/base/base_blank_page'
|
21
22
|
require 'ruby_app/elements/pages/blank_page'
|
22
23
|
|
@@ -32,6 +33,7 @@ RubyApp::Elements::Lists::Select.template_path(:css, File.join(File.dirname(__FI
|
|
32
33
|
RubyApp::Elements::Markdown.template_path(:css, File.join(File.dirname(__FILE__), %w[mobile]))
|
33
34
|
RubyApp::Elements::Navigation::Base::BaseBreadcrumbs.template_path(:html, File.join(File.dirname(__FILE__), %w[mobile navigation base]))
|
34
35
|
RubyApp::Elements::Page.template_path(:css, File.join(File.dirname(__FILE__), %w[mobile]))
|
36
|
+
RubyApp::Elements::Pages::Authentication::OpenID::AuthenticationPage.template_path(:css, File.join(File.dirname(__FILE__), %w[mobile pages authentication open_id]))
|
35
37
|
RubyApp::Elements::Pages::Base::BaseBlankPage.template_path(:html, File.join(File.dirname(__FILE__), %w[mobile pages base]))
|
36
38
|
RubyApp::Elements::Pages::Base::BaseBlankPage.template_path(:css, File.join(File.dirname(__FILE__), %w[mobile pages base]))
|
37
39
|
RubyApp::Elements::Pages::BlankPage.template_path(:css, File.join(File.dirname(__FILE__), %w[mobile pages]))
|
@@ -0,0 +1,13 @@
|
|
1
|
+
- self.rendered?(__FILE__) do
|
2
|
+
:sass
|
3
|
+
/* #{__FILE__}
|
4
|
+
@import '#{File.join(File.dirname(__FILE__), %w[.. .. .. colors.sass])}'
|
5
|
+
div.wait
|
6
|
+
background-color: $dialog_background
|
7
|
+
color: $dialog_foreground
|
8
|
+
border-radius: 10px
|
9
|
+
padding: 10px 15px
|
10
|
+
width: 80%
|
11
|
+
> div.image
|
12
|
+
padding-right: 10px
|
13
|
+
= yield
|
@@ -172,9 +172,9 @@ ruby_app:
|
|
172
172
|
Click [here](go_test) to go to the test pages.
|
173
173
|
authentication:
|
174
174
|
open_id:
|
175
|
-
|
176
|
-
|
177
|
-
message:
|
175
|
+
base:
|
176
|
+
base_authentication_page:
|
177
|
+
message: Authenticating ...
|
178
178
|
google_authentication_page:
|
179
179
|
title: Google Authentication
|
180
180
|
my_open_id_authentication_page:
|
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: 51
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 22
|
10
|
+
version: 0.0.22
|
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-12-
|
18
|
+
date: 2011-12-09 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
version_requirements: &id001 !ruby/object:Gem::Requirement
|
@@ -431,10 +431,12 @@ files:
|
|
431
431
|
- lib/ruby_app/elements/navigation/page_link.js.haml
|
432
432
|
- lib/ruby_app/elements/navigation/page_link.rb
|
433
433
|
- lib/ruby_app/elements/page.rb
|
434
|
-
- lib/ruby_app/elements/pages/authentication/open_id/authentication_page.css.haml
|
435
|
-
- lib/ruby_app/elements/pages/authentication/open_id/authentication_page.js.haml
|
436
434
|
- lib/ruby_app/elements/pages/authentication/open_id/authentication_page.rb
|
437
435
|
- lib/ruby_app/elements/pages/authentication/open_id/ax_authentication_page.rb
|
436
|
+
- lib/ruby_app/elements/pages/authentication/open_id/base/base_authentication_page.css.haml
|
437
|
+
- lib/ruby_app/elements/pages/authentication/open_id/base/base_authentication_page.html.haml
|
438
|
+
- lib/ruby_app/elements/pages/authentication/open_id/base/base_authentication_page.js.haml
|
439
|
+
- lib/ruby_app/elements/pages/authentication/open_id/base/base_authentication_page.rb
|
438
440
|
- lib/ruby_app/elements/pages/authentication/open_id/email_authentication_page.rb
|
439
441
|
- lib/ruby_app/elements/pages/authentication/open_id/google_authentication_page.rb
|
440
442
|
- lib/ruby_app/elements/pages/authentication/open_id/my_open_id_authentication_page.rb
|
@@ -509,6 +511,7 @@ files:
|
|
509
511
|
- lib/ruby_app/rack/route.rb
|
510
512
|
- lib/ruby_app/request.rb
|
511
513
|
- lib/ruby_app/resources/elements/dialogs/base/base_busy_dialog.gif
|
514
|
+
- lib/ruby_app/resources/elements/pages/authentication/open_id/base/base_authentication_page.gif
|
512
515
|
- lib/ruby_app/resources/favicon.ico
|
513
516
|
- lib/ruby_app/resources/scripts/jquery-1.7.1.min.js
|
514
517
|
- lib/ruby_app/resources/themes/mobile/base/base_page/icon.png
|
@@ -550,6 +553,7 @@ files:
|
|
550
553
|
- lib/ruby_app/themes/mobile/markdown.css.haml
|
551
554
|
- lib/ruby_app/themes/mobile/navigation/base/base_breadcrumbs.html.haml
|
552
555
|
- lib/ruby_app/themes/mobile/page.css.haml
|
556
|
+
- lib/ruby_app/themes/mobile/pages/authentication/open_id/authentication_page.css.haml
|
553
557
|
- lib/ruby_app/themes/mobile/pages/base/base_blank_page.css.haml
|
554
558
|
- lib/ruby_app/themes/mobile/pages/base/base_blank_page.html.haml
|
555
559
|
- lib/ruby_app/themes/mobile/pages/blank_page.css.haml
|