omniauth-identity 1.0.0.pr2 → 1.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -1
- data/Gemfile +0 -1
- data/Gemfile.lock +34 -29
- data/lib/omniauth-identity/version.rb +1 -1
- data/lib/omniauth/identity.rb +1 -1
- data/lib/omniauth/identity/models/mongoid.rb +33 -0
- data/omniauth-identity.gemspec +5 -3
- data/spec/omniauth/identity/models/mongoid_spec.rb +18 -0
- metadata +46 -21
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,33 +1,28 @@
|
|
1
|
-
GIT
|
2
|
-
remote: git://github.com/intridea/omniauth.git
|
3
|
-
revision: 5d2c3deb6a767aa2e5366ad9e4533ded8d82cb69
|
4
|
-
specs:
|
5
|
-
omniauth (1.0.0.alpha)
|
6
|
-
hashie
|
7
|
-
rack
|
8
|
-
|
9
1
|
PATH
|
10
2
|
remote: .
|
11
3
|
specs:
|
12
|
-
omniauth-identity (0.0.
|
13
|
-
omniauth (= 1.0.0.
|
4
|
+
omniauth-identity (1.0.0.beta1)
|
5
|
+
omniauth (= 1.0.0.beta1)
|
14
6
|
|
15
7
|
GEM
|
16
8
|
remote: http://rubygems.org/
|
17
9
|
specs:
|
18
|
-
activemodel (3.
|
19
|
-
activesupport (= 3.
|
20
|
-
builder (~>
|
21
|
-
i18n (~> 0.
|
22
|
-
activerecord (3.
|
23
|
-
activemodel (= 3.
|
24
|
-
activesupport (= 3.
|
25
|
-
arel (~> 2.
|
26
|
-
tzinfo (~> 0.3.
|
27
|
-
activesupport (3.
|
28
|
-
|
29
|
-
|
30
|
-
|
10
|
+
activemodel (3.1.1)
|
11
|
+
activesupport (= 3.1.1)
|
12
|
+
builder (~> 3.0.0)
|
13
|
+
i18n (~> 0.6)
|
14
|
+
activerecord (3.1.1)
|
15
|
+
activemodel (= 3.1.1)
|
16
|
+
activesupport (= 3.1.1)
|
17
|
+
arel (~> 2.2.1)
|
18
|
+
tzinfo (~> 0.3.29)
|
19
|
+
activesupport (3.1.1)
|
20
|
+
multi_json (~> 1.0)
|
21
|
+
arel (2.2.1)
|
22
|
+
bcrypt-ruby (3.0.1)
|
23
|
+
bson (1.4.1)
|
24
|
+
bson_ext (1.4.1)
|
25
|
+
builder (3.0.0)
|
31
26
|
diff-lcs (1.1.3)
|
32
27
|
growl (1.0.3)
|
33
28
|
guard (0.8.4)
|
@@ -37,12 +32,21 @@ GEM
|
|
37
32
|
guard (>= 0.2.2)
|
38
33
|
guard-rspec (0.4.5)
|
39
34
|
guard (>= 0.4.0)
|
40
|
-
hashie (1.
|
41
|
-
i18n (0.
|
35
|
+
hashie (1.2.0)
|
36
|
+
i18n (0.6.0)
|
42
37
|
maruku (0.6.0)
|
43
38
|
syntax (>= 1.0.0)
|
39
|
+
mongo (1.4.1)
|
40
|
+
bson (= 1.4.1)
|
41
|
+
mongoid (2.3.2)
|
42
|
+
activemodel (~> 3.1)
|
43
|
+
mongo (~> 1.4)
|
44
|
+
tzinfo (~> 0.3.22)
|
44
45
|
multi_json (1.0.3)
|
45
|
-
|
46
|
+
omniauth (1.0.0.beta1)
|
47
|
+
hashie (~> 1.2)
|
48
|
+
rack
|
49
|
+
rack (1.3.5)
|
46
50
|
rack-test (0.6.1)
|
47
51
|
rack (>= 1.0)
|
48
52
|
rake (0.9.2)
|
@@ -67,14 +71,15 @@ PLATFORMS
|
|
67
71
|
ruby
|
68
72
|
|
69
73
|
DEPENDENCIES
|
70
|
-
activerecord (~> 3.
|
71
|
-
bcrypt-ruby (~>
|
74
|
+
activerecord (~> 3.1)
|
75
|
+
bcrypt-ruby (~> 3.0)
|
76
|
+
bson_ext (~> 1.4)
|
72
77
|
growl
|
73
78
|
guard
|
74
79
|
guard-bundler
|
75
80
|
guard-rspec
|
76
81
|
maruku (~> 0.6)
|
77
|
-
|
82
|
+
mongoid (~> 2.3)
|
78
83
|
omniauth-identity!
|
79
84
|
rack-test (~> 0.5)
|
80
85
|
rake (~> 0.8)
|
data/lib/omniauth/identity.rb
CHANGED
@@ -11,7 +11,7 @@ module OmniAuth
|
|
11
11
|
module Models
|
12
12
|
autoload :ActiveRecord, 'omniauth/identity/models/active_record'
|
13
13
|
# autoload :MongoMapper, 'omniauth/identity/models/mongo_mapper'
|
14
|
-
|
14
|
+
autoload :Mongoid, 'omniauth/identity/models/mongoid'
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'mongoid'
|
2
|
+
|
3
|
+
module OmniAuth
|
4
|
+
module Identity
|
5
|
+
module Models
|
6
|
+
module Mongoid
|
7
|
+
|
8
|
+
def self.included(base)
|
9
|
+
|
10
|
+
base.class_eval do
|
11
|
+
|
12
|
+
include ::OmniAuth::Identity::Model
|
13
|
+
include ::OmniAuth::Identity::SecurePassword
|
14
|
+
|
15
|
+
has_secure_password
|
16
|
+
|
17
|
+
def self.auth_key=(key)
|
18
|
+
super
|
19
|
+
validates_uniqueness_of key, :case_sensitive => false
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.locate(key)
|
23
|
+
where(auth_key => key).first
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
data/omniauth-identity.gemspec
CHANGED
@@ -2,15 +2,17 @@
|
|
2
2
|
require File.dirname(__FILE__) + '/lib/omniauth-identity/version'
|
3
3
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
|
-
gem.add_runtime_dependency 'omniauth', '1.0.0.
|
5
|
+
gem.add_runtime_dependency 'omniauth', '1.0.0.beta1'
|
6
6
|
|
7
7
|
gem.add_development_dependency 'maruku', '~> 0.6'
|
8
8
|
gem.add_development_dependency 'simplecov', '~> 0.4'
|
9
9
|
gem.add_development_dependency 'rack-test', '~> 0.5'
|
10
10
|
gem.add_development_dependency 'rake', '~> 0.8'
|
11
11
|
gem.add_development_dependency 'rspec', '~> 2.5'
|
12
|
-
gem.add_development_dependency 'bcrypt-ruby', '~>
|
13
|
-
gem.add_development_dependency 'activerecord', '~> 3.
|
12
|
+
gem.add_development_dependency 'bcrypt-ruby', '~> 3.0'
|
13
|
+
gem.add_development_dependency 'activerecord', '~> 3.1'
|
14
|
+
gem.add_development_dependency 'mongoid', '~> 2.3'
|
15
|
+
gem.add_development_dependency 'bson_ext', '~> 1.4'
|
14
16
|
|
15
17
|
gem.name = 'omniauth-identity'
|
16
18
|
gem.version = OmniAuth::Identity::VERSION
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe(OmniAuth::Identity::Models::Mongoid, :db => true) do
|
4
|
+
class MongoidTestIdentity
|
5
|
+
include Mongoid::Document
|
6
|
+
include OmniAuth::Identity::Models::Mongoid
|
7
|
+
auth_key :ham_sandwich
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'should locate using the auth key using a where query' do
|
11
|
+
MongoidTestIdentity.should_receive(:where).with('ham_sandwich' => 'open faced').and_return(['wakka'])
|
12
|
+
MongoidTestIdentity.locate('open faced').should == 'wakka'
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'should not use STI rules for its collection name' do
|
16
|
+
MongoidTestIdentity.collection.name.should == 'mongoid_test_identities'
|
17
|
+
end
|
18
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-identity
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.rc1
|
5
5
|
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,22 +9,22 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-10-
|
12
|
+
date: 2011-10-28 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: omniauth
|
16
|
-
requirement: &
|
16
|
+
requirement: &70246506234140 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - =
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 1.0.0.
|
21
|
+
version: 1.0.0.beta1
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70246506234140
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: maruku
|
27
|
-
requirement: &
|
27
|
+
requirement: &70246506233420 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0.6'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70246506233420
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: simplecov
|
38
|
-
requirement: &
|
38
|
+
requirement: &70246506232420 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0.4'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70246506232420
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rack-test
|
49
|
-
requirement: &
|
49
|
+
requirement: &70246506231180 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0.5'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70246506231180
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: rake
|
60
|
-
requirement: &
|
60
|
+
requirement: &70246506230300 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0.8'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70246506230300
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec
|
71
|
-
requirement: &
|
71
|
+
requirement: &70246506229180 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ~>
|
@@ -76,29 +76,51 @@ dependencies:
|
|
76
76
|
version: '2.5'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70246506229180
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: bcrypt-ruby
|
82
|
-
requirement: &
|
82
|
+
requirement: &70246506227740 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ~>
|
86
86
|
- !ruby/object:Gem::Version
|
87
|
-
version:
|
87
|
+
version: '3.0'
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *70246506227740
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: activerecord
|
93
|
-
requirement: &
|
93
|
+
requirement: &70246506226580 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ~>
|
97
97
|
- !ruby/object:Gem::Version
|
98
|
-
version: '3.
|
98
|
+
version: '3.1'
|
99
|
+
type: :development
|
100
|
+
prerelease: false
|
101
|
+
version_requirements: *70246506226580
|
102
|
+
- !ruby/object:Gem::Dependency
|
103
|
+
name: mongoid
|
104
|
+
requirement: &70246506225120 !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ~>
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '2.3'
|
110
|
+
type: :development
|
111
|
+
prerelease: false
|
112
|
+
version_requirements: *70246506225120
|
113
|
+
- !ruby/object:Gem::Dependency
|
114
|
+
name: bson_ext
|
115
|
+
requirement: &70246506224000 !ruby/object:Gem::Requirement
|
116
|
+
none: false
|
117
|
+
requirements:
|
118
|
+
- - ~>
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
version: '1.4'
|
99
121
|
type: :development
|
100
122
|
prerelease: false
|
101
|
-
version_requirements: *
|
123
|
+
version_requirements: *70246506224000
|
102
124
|
description: Internal authentication handlers for OmniAuth.
|
103
125
|
email:
|
104
126
|
- michael@intridea.com
|
@@ -118,11 +140,13 @@ files:
|
|
118
140
|
- lib/omniauth/identity.rb
|
119
141
|
- lib/omniauth/identity/model.rb
|
120
142
|
- lib/omniauth/identity/models/active_record.rb
|
143
|
+
- lib/omniauth/identity/models/mongoid.rb
|
121
144
|
- lib/omniauth/identity/secure_password.rb
|
122
145
|
- lib/omniauth/strategies/identity.rb
|
123
146
|
- omniauth-identity.gemspec
|
124
147
|
- spec/omniauth/identity/model_spec.rb
|
125
148
|
- spec/omniauth/identity/models/active_record_spec.rb
|
149
|
+
- spec/omniauth/identity/models/mongoid_spec.rb
|
126
150
|
- spec/omniauth/identity/secure_password_spec.rb
|
127
151
|
- spec/omniauth/strategies/identity_spec.rb
|
128
152
|
- spec/spec_helper.rb
|
@@ -153,6 +177,7 @@ summary: Internal authentication handlers for OmniAuth.
|
|
153
177
|
test_files:
|
154
178
|
- spec/omniauth/identity/model_spec.rb
|
155
179
|
- spec/omniauth/identity/models/active_record_spec.rb
|
180
|
+
- spec/omniauth/identity/models/mongoid_spec.rb
|
156
181
|
- spec/omniauth/identity/secure_password_spec.rb
|
157
182
|
- spec/omniauth/strategies/identity_spec.rb
|
158
183
|
- spec/spec_helper.rb
|