warden-googleapps 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -5,7 +5,21 @@ A Warden middleware for google apps. It needs a little work but definitely auth
5
5
 
6
6
  Example
7
7
  =======
8
+ Gemfile
9
+ -------
10
+ source :gemcutter
8
11
 
12
+ gem 'haml', '~>2.2.0'
13
+ gem 'sinatra', '~>0.9.4'
14
+ gem 'ruby-openid', :require => 'openid', :git => 'git://github.com/pelle/ruby-openid.git'
15
+ gem 'warden-googleapps', '=0.0.3'
16
+
17
+ group :development do
18
+ gem 'shotgun'
19
+ end
20
+
21
+ app.rb
22
+ ------
9
23
  module DirectoryAdmin
10
24
  class App < Sinatra::Default
11
25
  disable :show_errors
@@ -15,7 +29,8 @@ Example
15
29
  manager.default_strategies :google_apps
16
30
  manager.failure_app = BadAuthentication
17
31
 
18
- manager.config[:google_apps_domain] = 'example.org'
32
+ manager[:google_apps_domain] = 'example.org'
33
+ # manager[:google_apps_endpoint] = 'http://www.google.com/accounts/o8/id' # this is gmail
19
34
  end
20
35
 
21
36
  helpers do
@@ -49,9 +64,12 @@ Example
49
64
  end
50
65
  end
51
66
 
52
-
53
- Enabling on Google
67
+ Enabling on GMail
54
68
  ==================
69
+ It should just work, even for localhost.
70
+
71
+ Enabling on Google Apps for Domains
72
+ ===================================
55
73
  Be sure you have Federated Login using OpenID enabled under your Advanced Settings Tab
56
74
 
57
75
  ![Your Google Apps Admin Dashboard](http://img.skitch.com/20100103-cdjtbyyw2xsbwya92r6gcd47hr.jpg "Check the box to enable")
@@ -59,5 +77,5 @@ Be sure you have Federated Login using OpenID enabled under your Advanced Settin
59
77
  Developing
60
78
  ==========
61
79
  % gem install bundler
62
- % gem bundle
63
- % bin/rake repackage
80
+ % bundle install
81
+ % bundle exec rake repackage
data/Rakefile CHANGED
@@ -14,7 +14,7 @@ Spec::Rake::SpecTask.new do |t|
14
14
  t.spec_opts = %w(-fs --color)
15
15
  t.spec_opts << '--loadby' << 'random'
16
16
 
17
- t.rcov_opts << '--exclude' << 'spec'
17
+ t.rcov_opts << '--exclude' << 'spec,.bundle'
18
18
  t.rcov = ENV.has_key?('NO_RCOV') ? ENV['NO_RCOV'] != 'true' : true
19
19
  t.rcov_opts << '--text-summary'
20
20
  t.rcov_opts << '--sort' << 'coverage' << '--sort-reverse'
@@ -39,10 +39,10 @@ spec = Gem::Specification.new do |s|
39
39
  s.email = EMAIL
40
40
  s.homepage = HOMEPAGE
41
41
 
42
- manifest = Bundler::Dsl.load_gemfile(File.dirname(__FILE__) + '/Gemfile')
43
- manifest.dependencies.each do |d|
44
- next unless d.only && d.only.include?('release')
45
- s.add_dependency(d.name, d.version)
42
+ bundle = Bundler::Definition.from_gemfile('Gemfile')
43
+ bundle.dependencies.each do |dep|
44
+ next unless dep.groups.include?(:runtime)
45
+ s.add_dependency(dep.name, dep.version_requirements.to_s)
46
46
  end
47
47
 
48
48
  s.require_path = 'lib'
@@ -38,12 +38,20 @@ Warden::Strategies.add(:google_apps) do
38
38
  ::OpenID::Store::Filesystem.new("#{Dir.tmpdir}/tmp/openid")
39
39
  end
40
40
 
41
- def domain
41
+ def google_apps_domain
42
42
  env['warden'].config[:google_apps_domain]
43
43
  end
44
44
 
45
+ def domain
46
+ 'https://www.google.com/accounts/o8/site-xrds?hd=%s' % google_apps_domain
47
+ end
48
+
49
+ def endpoint
50
+ env['warden'].config[:google_apps_endpoint]
51
+ end
52
+
45
53
  def open_id_endpoint
46
- 'https://www.google.com/accounts/o8/site-xrds?hd=%s' % domain
54
+ endpoint || domain
47
55
  end
48
56
 
49
57
  def add_ax_fields(open_id_request)
@@ -1,5 +1,5 @@
1
1
  module Warden
2
2
  module GoogleApps
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: warden-googleapps
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Corey Donohoe
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-01-03 00:00:00 -08:00
12
+ date: 2010-02-09 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - ~>
22
22
  - !ruby/object:Gem::Version
23
- version: 0.7.0
23
+ version: 0.9.2
24
24
  version:
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: sinatra
@@ -40,7 +40,7 @@ dependencies:
40
40
  requirements:
41
41
  - - ~>
42
42
  - !ruby/object:Gem::Version
43
- version: 2.1.6
43
+ version: 2.1.7
44
44
  version:
45
45
  description: A warden strategy to use Google's Federated OpenID with Google Apps
46
46
  email: atmos@atmos.org