exvo-auth 0.10.0 → 0.10.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,7 +16,8 @@ Gem::Specification.new do |s|
16
16
 
17
17
  s.add_dependency "oa-oauth", "~> 0.0.4"
18
18
  s.add_dependency "httparty", "~> 0.6.1"
19
- s.add_dependency "activemodel", "> 3.0.0"
19
+ s.add_dependency "activemodel", "~> 3.0.0"
20
+ s.add_dependency "actionpack", "~> 3.0.0"
20
21
 
21
22
  s.add_development_dependency "mocha", "~> 0.9.8"
22
23
  s.add_development_dependency "test-unit", "~> 2.1.0"
@@ -6,10 +6,11 @@ require 'uri'
6
6
  require 'base64'
7
7
 
8
8
  module ExvoAuth
9
- autoload :Middleware, 'exvo_auth/middleware'
10
- autoload :Config, 'exvo_auth/config'
11
- autoload :Dejavu, 'exvo_auth/dejavu'
12
- autoload :VERSION, 'exvo_auth/version'
9
+ autoload :Middleware, 'exvo_auth/middleware'
10
+ autoload :SessionStore, 'exvo_auth/session_store'
11
+ autoload :Config, 'exvo_auth/config'
12
+ autoload :Dejavu, 'exvo_auth/dejavu'
13
+ autoload :VERSION, 'exvo_auth/version'
13
14
 
14
15
  module Strategies
15
16
  autoload :Base, 'exvo_auth/strategies/base'
@@ -1,5 +1,5 @@
1
1
  # TODO: activemodel with validations
2
- class ExvoAuth::Sharing
2
+ class ExvoAuth::Models::Sharing
3
3
  def self.create(attrs = {})
4
4
  new(attrs).save
5
5
  end
@@ -0,0 +1,37 @@
1
+ require "action_dispatch"
2
+ require 'active_support/core_ext/hash/reverse_merge'
3
+
4
+ # For Merb apps only. This replaces merb sessions with Rails3 sessions. We use this to share sessions between merb and rails apps.
5
+ class ExvoAuth::SessionStore
6
+ def initialize(app, options = {})
7
+ raise "Please configure :secret_token" unless @secret_token = options[:secret_token]
8
+ raise "Please configure :domain" unless @domain = options[:domain]
9
+
10
+ @app = ActionDispatch::Cookies.new(ActionDispatch::Session::CookieStore.new(app, :key => "_exvo_session", :domain => @domain))
11
+ end
12
+ def call(env)
13
+ @app.call(env.reverse_merge!(env_defaults))
14
+ end
15
+ def env_defaults
16
+ @env_defaults ||= {
17
+ "action_dispatch.secret_token" => @secret_token
18
+ }
19
+ end
20
+ def self.replace_merb_sessions_with_rails_3_sessions! # this is crazy
21
+ [Merb::BootLoader::MixinSession, Merb::BootLoader::SetupSession, Merb::BootLoader::Cookies].each do |c|
22
+ c.class_eval do
23
+ def self.run; end
24
+ end
25
+ end
26
+ Merb::Controller.class_eval do
27
+ def session; request.session end
28
+ def cookies; request.cookies end
29
+ end
30
+ Merb::Request.class_eval do
31
+ def session?; true end
32
+ def session; env["rack.session"] ||= {} end
33
+ def cookies; env["action_dispatch.cookies"] ||= {} end
34
+ end
35
+ end
36
+ end
37
+
@@ -1,3 +1,3 @@
1
1
  module ExvoAuth
2
- VERSION = "0.10.0"
2
+ VERSION = "0.10.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: 55
4
+ hash: 53
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 10
9
- - 0
10
- version: 0.10.0
9
+ - 1
10
+ version: 0.10.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: 2010-11-29 00:00:00 +01:00
18
+ date: 2010-12-10 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -56,7 +56,7 @@ dependencies:
56
56
  requirement: &id003 !ruby/object:Gem::Requirement
57
57
  none: false
58
58
  requirements:
59
- - - ">"
59
+ - - ~>
60
60
  - !ruby/object:Gem::Version
61
61
  hash: 7
62
62
  segments:
@@ -67,9 +67,25 @@ dependencies:
67
67
  type: :runtime
68
68
  version_requirements: *id003
69
69
  - !ruby/object:Gem::Dependency
70
- name: mocha
70
+ name: actionpack
71
71
  prerelease: false
72
72
  requirement: &id004 !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ hash: 7
78
+ segments:
79
+ - 3
80
+ - 0
81
+ - 0
82
+ version: 3.0.0
83
+ type: :runtime
84
+ version_requirements: *id004
85
+ - !ruby/object:Gem::Dependency
86
+ name: mocha
87
+ prerelease: false
88
+ requirement: &id005 !ruby/object:Gem::Requirement
73
89
  none: false
74
90
  requirements:
75
91
  - - ~>
@@ -81,11 +97,11 @@ dependencies:
81
97
  - 8
82
98
  version: 0.9.8
83
99
  type: :development
84
- version_requirements: *id004
100
+ version_requirements: *id005
85
101
  - !ruby/object:Gem::Dependency
86
102
  name: test-unit
87
103
  prerelease: false
88
- requirement: &id005 !ruby/object:Gem::Requirement
104
+ requirement: &id006 !ruby/object:Gem::Requirement
89
105
  none: false
90
106
  requirements:
91
107
  - - ~>
@@ -97,11 +113,11 @@ dependencies:
97
113
  - 0
98
114
  version: 2.1.0
99
115
  type: :development
100
- version_requirements: *id005
116
+ version_requirements: *id006
101
117
  - !ruby/object:Gem::Dependency
102
118
  name: bundler
103
119
  prerelease: false
104
- requirement: &id006 !ruby/object:Gem::Requirement
120
+ requirement: &id007 !ruby/object:Gem::Requirement
105
121
  none: false
106
122
  requirements:
107
123
  - - ~>
@@ -113,7 +129,7 @@ dependencies:
113
129
  - 0
114
130
  version: 1.0.0
115
131
  type: :development
116
- version_requirements: *id006
132
+ version_requirements: *id007
117
133
  description: Sign in with Exvo account
118
134
  email:
119
135
  - jacek.becela@gmail.com
@@ -144,8 +160,9 @@ files:
144
160
  - lib/exvo_auth/dejavu.rb
145
161
  - lib/exvo_auth/middleware.rb
146
162
  - lib/exvo_auth/models/message.rb
163
+ - lib/exvo_auth/models/sharing.rb
147
164
  - lib/exvo_auth/oauth2.rb
148
- - lib/exvo_auth/sharing.rb
165
+ - lib/exvo_auth/session_store.rb
149
166
  - lib/exvo_auth/strategies/base.rb
150
167
  - lib/exvo_auth/strategies/interactive.rb
151
168
  - lib/exvo_auth/strategies/non_interactive.rb