oa-google-openid 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.gitignore +21 -0
- data/LICENSE +20 -0
- data/README.rdoc +46 -0
- data/Rakefile +54 -0
- data/VERSION +1 -0
- data/init.rb +1 -0
- data/lib/oa-google-openid.rb +10 -0
- data/lib/omniauth/strategies/google_open_id.rb +28 -0
- data/oa-google-openid.gemspec +56 -0
- data/test/helper.rb +10 -0
- data/test/test_oa-google-openid.rb +7 -0
- metadata +93 -0
data/.document
ADDED
data/.gitignore
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2009 Danil Pismenny
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
= oa-google-openid
|
2
|
+
|
3
|
+
This is an Omniauth's open_id stretegy with the identifier name setted to 'https://www.google.com/accounts/o8/id'
|
4
|
+
|
5
|
+
You can use it as:
|
6
|
+
|
7
|
+
provider :google_open_id
|
8
|
+
|
9
|
+
= Why?
|
10
|
+
|
11
|
+
Why don't just use 'open_id' strategy with the specified name and the identifier?
|
12
|
+
|
13
|
+
Because Devise, that I like to use, saves providers into the hash with the strategie's name
|
14
|
+
as a key and you can't use two strategies with the same name in the application. Devise remember
|
15
|
+
the last one only.
|
16
|
+
|
17
|
+
Example:
|
18
|
+
|
19
|
+
config.omniauth :open_id, OpenID::Store::Filesystem.new('/tmp')
|
20
|
+
config.omniauth :open_id, nil, :name => 'google', :identifier => 'https://www.google.com/accounts/o8/id'
|
21
|
+
|
22
|
+
Devise forgets about first :open_id and remember the last one with google's identifier only.
|
23
|
+
|
24
|
+
Now it's easy to fix:
|
25
|
+
|
26
|
+
config.omniauth :open_id, OpenID::Store::Filesystem.new('/tmp')
|
27
|
+
config.omniauth :google_open_id
|
28
|
+
|
29
|
+
|
30
|
+
There is now such problem when use Omniauth directly without Devise.
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
== Note on Patches/Pull Requests
|
35
|
+
|
36
|
+
* Fork the project.
|
37
|
+
* Make your feature addition or bug fix.
|
38
|
+
* Add tests for it. This is important so I don't break it in a
|
39
|
+
future version unintentionally.
|
40
|
+
* Commit, do not mess with rakefile, version, or history.
|
41
|
+
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
42
|
+
* Send me a pull request. Bonus points for topic branches.
|
43
|
+
|
44
|
+
== Copyright
|
45
|
+
|
46
|
+
Copyright (c) 2010 Danil Pismenny. See LICENSE for details.
|
data/Rakefile
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
# -*- coding: undecided -*-
|
2
|
+
require 'rubygems'
|
3
|
+
require 'rake'
|
4
|
+
|
5
|
+
begin
|
6
|
+
require 'jeweler'
|
7
|
+
Jeweler::Tasks.new do |gem|
|
8
|
+
gem.name = "oa-google-openid"
|
9
|
+
gem.summary = %Q{Google OpenID strategy for Omniauth.}
|
10
|
+
gem.description = %Q{This is an Omniauth’s open_id stretegy with the identifier name setted to ‘www.google.com/accounts/o8/id‘. We should use instead of plain :open_id when using Devise. Because Devise does not work fine with multiply strategies having the same name.}
|
11
|
+
gem.email = "danil@orionet.ru"
|
12
|
+
gem.homepage = "http://github.com/dapi/oa-google-openid"
|
13
|
+
gem.authors = ["Danil Pismenny"]
|
14
|
+
gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
|
15
|
+
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
16
|
+
end
|
17
|
+
Jeweler::GemcutterTasks.new
|
18
|
+
rescue LoadError
|
19
|
+
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
20
|
+
end
|
21
|
+
|
22
|
+
require 'rake/testtask'
|
23
|
+
Rake::TestTask.new(:test) do |test|
|
24
|
+
test.libs << 'lib' << 'test'
|
25
|
+
test.pattern = 'test/**/test_*.rb'
|
26
|
+
test.verbose = true
|
27
|
+
end
|
28
|
+
|
29
|
+
begin
|
30
|
+
require 'rcov/rcovtask'
|
31
|
+
Rcov::RcovTask.new do |test|
|
32
|
+
test.libs << 'test'
|
33
|
+
test.pattern = 'test/**/test_*.rb'
|
34
|
+
test.verbose = true
|
35
|
+
end
|
36
|
+
rescue LoadError
|
37
|
+
task :rcov do
|
38
|
+
abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
task :test => :check_dependencies
|
43
|
+
|
44
|
+
task :default => :test
|
45
|
+
|
46
|
+
require 'rake/rdoctask'
|
47
|
+
Rake::RDocTask.new do |rdoc|
|
48
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
49
|
+
|
50
|
+
rdoc.rdoc_dir = 'rdoc'
|
51
|
+
rdoc.title = "oa-google-openid #{version}"
|
52
|
+
rdoc.rdoc_files.include('README*')
|
53
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
54
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.0
|
data/init.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'oa-google-openid'
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'omniauth/openid'
|
2
|
+
|
3
|
+
module OmniAuth
|
4
|
+
module Strategies
|
5
|
+
class GoogleOpenID < OmniAuth::Strategies::OpenID
|
6
|
+
|
7
|
+
# OmniAuth::Strategies::GoogleOpenID helps you
|
8
|
+
# to use plain open_id and google open_id both in the same application
|
9
|
+
#
|
10
|
+
# use OmniAuth::Builder do
|
11
|
+
# provider :google_open_id
|
12
|
+
# provider :open_id, OpenID::Store::Filesystem.new('/tmp')
|
13
|
+
# end
|
14
|
+
#
|
15
|
+
|
16
|
+
def initialize(app, store = nil, options = {})
|
17
|
+
options[:name]||='google_open_id'
|
18
|
+
super(app, store, options)
|
19
|
+
end
|
20
|
+
|
21
|
+
|
22
|
+
def identifier
|
23
|
+
'https://www.google.com/accounts/o8/id'
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{oa-google-openid}
|
8
|
+
s.version = "0.1.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Danil Pismenny"]
|
12
|
+
s.date = %q{2010-11-05}
|
13
|
+
s.description = %q{This is an Omniauth’s open_id stretegy with the identifier name setted to ‘www.google.com/accounts/o8/id‘. We should use instead of plain :open_id when using Devise. Because Devise does not work fine with multiply strategies having the same name.}
|
14
|
+
s.email = %q{danil@orionet.ru}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
".gitignore",
|
22
|
+
"LICENSE",
|
23
|
+
"README.rdoc",
|
24
|
+
"Rakefile",
|
25
|
+
"VERSION",
|
26
|
+
"init.rb",
|
27
|
+
"lib/oa-google-openid.rb",
|
28
|
+
"lib/omniauth/strategies/google_open_id.rb",
|
29
|
+
"oa-google-openid.gemspec",
|
30
|
+
"test/helper.rb",
|
31
|
+
"test/test_oa-google-openid.rb"
|
32
|
+
]
|
33
|
+
s.homepage = %q{http://github.com/dapi/oa-google-openid}
|
34
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
35
|
+
s.require_paths = ["lib"]
|
36
|
+
s.rubygems_version = %q{1.3.7}
|
37
|
+
s.summary = %q{Google OpenID strategy for Omniauth.}
|
38
|
+
s.test_files = [
|
39
|
+
"test/test_oa-google-openid.rb",
|
40
|
+
"test/helper.rb"
|
41
|
+
]
|
42
|
+
|
43
|
+
if s.respond_to? :specification_version then
|
44
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
45
|
+
s.specification_version = 3
|
46
|
+
|
47
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
48
|
+
s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
49
|
+
else
|
50
|
+
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
51
|
+
end
|
52
|
+
else
|
53
|
+
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
data/test/helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,93 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: oa-google-openid
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 0
|
10
|
+
version: 0.1.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Danil Pismenny
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2010-11-05 00:00:00 +03:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: thoughtbot-shoulda
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
version: "0"
|
33
|
+
type: :development
|
34
|
+
version_requirements: *id001
|
35
|
+
description: "This is an Omniauth\xE2\x80\x99s open_id stretegy with the identifier name setted to \xE2\x80\x98www.google.com/accounts/o8/id\xE2\x80\x98. We should use instead of plain :open_id when using Devise. Because Devise does not work fine with multiply strategies having the same name."
|
36
|
+
email: danil@orionet.ru
|
37
|
+
executables: []
|
38
|
+
|
39
|
+
extensions: []
|
40
|
+
|
41
|
+
extra_rdoc_files:
|
42
|
+
- LICENSE
|
43
|
+
- README.rdoc
|
44
|
+
files:
|
45
|
+
- .document
|
46
|
+
- .gitignore
|
47
|
+
- LICENSE
|
48
|
+
- README.rdoc
|
49
|
+
- Rakefile
|
50
|
+
- VERSION
|
51
|
+
- init.rb
|
52
|
+
- lib/oa-google-openid.rb
|
53
|
+
- lib/omniauth/strategies/google_open_id.rb
|
54
|
+
- oa-google-openid.gemspec
|
55
|
+
- test/helper.rb
|
56
|
+
- test/test_oa-google-openid.rb
|
57
|
+
has_rdoc: true
|
58
|
+
homepage: http://github.com/dapi/oa-google-openid
|
59
|
+
licenses: []
|
60
|
+
|
61
|
+
post_install_message:
|
62
|
+
rdoc_options:
|
63
|
+
- --charset=UTF-8
|
64
|
+
require_paths:
|
65
|
+
- lib
|
66
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
67
|
+
none: false
|
68
|
+
requirements:
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
hash: 3
|
72
|
+
segments:
|
73
|
+
- 0
|
74
|
+
version: "0"
|
75
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
76
|
+
none: false
|
77
|
+
requirements:
|
78
|
+
- - ">="
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
hash: 3
|
81
|
+
segments:
|
82
|
+
- 0
|
83
|
+
version: "0"
|
84
|
+
requirements: []
|
85
|
+
|
86
|
+
rubyforge_project:
|
87
|
+
rubygems_version: 1.3.7
|
88
|
+
signing_key:
|
89
|
+
specification_version: 3
|
90
|
+
summary: Google OpenID strategy for Omniauth.
|
91
|
+
test_files:
|
92
|
+
- test/test_oa-google-openid.rb
|
93
|
+
- test/helper.rb
|