google-authsub 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. data/Rakefile +0 -15
  2. data/google-authsub.gemspec +7 -69
  3. data/lib/googleauthsub.rb +2 -3
  4. data/spec/googleauthsub_spec.rb +3 -3
  5. metadata +17 -52
  6. data/VERSION +0 -1
  7. data/coverage/-Library-Ruby-Gems-1_8-gems-FakeWeb-1_1_2-lib-fake_net_http_rb.html +0 -679
  8. data/coverage/-Library-Ruby-Gems-1_8-gems-FakeWeb-1_1_2-lib-fake_web_rb.html +0 -843
  9. data/coverage/-Library-Ruby-Gems-1_8-gems-rcov-0_8_1_2_0-lib-rcov_rb.html +0 -1598
  10. data/coverage/index.html +0 -360
  11. data/coverage/lib-googleauthsub_rb.html +0 -877
  12. data/coverage/spec-googleauthsub_spec_rb.html +0 -950
  13. data/coverage/spec-spec_helper_rb.html +0 -640
  14. data/doc/classes/AuthEchoServlet.html +0 -152
  15. data/doc/classes/AuthEchoServlet.src/M000001.html +0 -20
  16. data/doc/classes/AuthEchoServlet.src/M000002.html +0 -18
  17. data/doc/classes/GData/AuthSubError.html +0 -139
  18. data/doc/classes/GData/AuthSubError.src/M000019.html +0 -18
  19. data/doc/classes/GData/Error.html +0 -111
  20. data/doc/classes/GData/GoogleAuthSub.html +0 -521
  21. data/doc/classes/GData/GoogleAuthSub.src/M000001.html +0 -29
  22. data/doc/classes/GData/GoogleAuthSub.src/M000002.html +0 -22
  23. data/doc/classes/GData/GoogleAuthSub.src/M000003.html +0 -29
  24. data/doc/classes/GData/GoogleAuthSub.src/M000004.html +0 -22
  25. data/doc/classes/GData/GoogleAuthSub.src/M000005.html +0 -24
  26. data/doc/classes/GData/GoogleAuthSub.src/M000006.html +0 -19
  27. data/doc/classes/GData/GoogleAuthSub.src/M000007.html +0 -18
  28. data/doc/classes/GData/GoogleAuthSub.src/M000008.html +0 -18
  29. data/doc/classes/GData/GoogleAuthSub.src/M000009.html +0 -24
  30. data/doc/classes/GData/GoogleAuthSub.src/M000010.html +0 -25
  31. data/doc/classes/GData/GoogleAuthSub.src/M000011.html +0 -30
  32. data/doc/classes/GData/GoogleAuthSub.src/M000012.html +0 -18
  33. data/doc/classes/GData/GoogleAuthSub.src/M000013.html +0 -18
  34. data/doc/classes/GData/GoogleAuthSub.src/M000014.html +0 -18
  35. data/doc/classes/GData/GoogleAuthSub.src/M000015.html +0 -18
  36. data/doc/classes/GData/GoogleAuthSub.src/M000016.html +0 -20
  37. data/doc/classes/GData/GoogleAuthSub.src/M000017.html +0 -20
  38. data/doc/classes/GData/GoogleAuthSub.src/M000018.html +0 -19
  39. data/doc/classes/GData.html +0 -162
  40. data/doc/created.rid +0 -1
  41. data/doc/files/googleauthsub_rb.html +0 -140
  42. data/doc/files/lib/googleauthsub_rb.html +0 -140
  43. data/doc/files/spec/googleauthsub_spec_rb.html +0 -146
  44. data/doc/files/spec/googleresponder_rb.html +0 -121
  45. data/doc/files/spec/spec_helper_rb.html +0 -149
  46. data/doc/fr_class_index.html +0 -31
  47. data/doc/fr_file_index.html +0 -30
  48. data/doc/fr_method_index.html +0 -45
  49. data/doc/index.html +0 -24
  50. data/doc/rdoc-style.css +0 -208
  51. data/live test/authsub_test.html +0 -40
  52. data/live test/gastest.rb +0 -90
data/Rakefile CHANGED
@@ -1,19 +1,4 @@
1
1
  require 'rubygems'
2
2
  require 'rake'
3
3
 
4
- begin
5
- require 'jeweler'
6
- Jeweler::Tasks.new do |gemspec|
7
- gemspec.name = "google-authsub"
8
- gemspec.summary = "A ruby implementation of Google Authentication for Web Applications API"
9
- gemspec.description = "GoogleAuthSub provides the Google Authentications for Web Applications API."
10
- gemspec.email = "jstorimer@gmail.com"
11
- gemspec.homepage = "http://github.com/jstorimer/google-authsub"
12
- gemspec.authors = ["Stuart Coyle", "Jesse Storimer"]
13
- end
14
- Jeweler::GemcutterTasks.new
15
- rescue LoadError
16
- puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
17
- end
18
-
19
4
  Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load ext }
@@ -1,17 +1,15 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
1
  # -*- encoding: utf-8 -*-
5
2
 
6
3
  Gem::Specification.new do |s|
7
4
  s.name = %q{google-authsub}
8
- s.version = "0.1.0"
9
-
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
5
+ s.version = "0.2.0"
11
6
  s.authors = ["Stuart Coyle", "Jesse Storimer"]
12
- s.date = %q{2010-01-25}
13
- s.description = %q{GoogleAuthSub provides the Google Authentications for Web Applications API.}
14
- s.email = %q{jstorimer@gmail.com}
7
+ s.summary = "A ruby implementation of Google Authentication for Web Applications API"
8
+ s.description = "GoogleAuthSub provides the Google Authentications for Web Applications API."
9
+ s.homepage = "http://github.com/jstorimer/google-authsub"
10
+
11
+ s.email = "jstorimer@gmail.com"
12
+
15
13
  s.extra_rdoc_files = [
16
14
  "README"
17
15
  ]
@@ -20,55 +18,8 @@ Gem::Specification.new do |s|
20
18
  "MIT-LICENSE",
21
19
  "README",
22
20
  "Rakefile",
23
- "VERSION",
24
- "coverage/-Library-Ruby-Gems-1_8-gems-FakeWeb-1_1_2-lib-fake_net_http_rb.html",
25
- "coverage/-Library-Ruby-Gems-1_8-gems-FakeWeb-1_1_2-lib-fake_web_rb.html",
26
- "coverage/-Library-Ruby-Gems-1_8-gems-rcov-0_8_1_2_0-lib-rcov_rb.html",
27
- "coverage/index.html",
28
- "coverage/lib-googleauthsub_rb.html",
29
- "coverage/spec-googleauthsub_spec_rb.html",
30
- "coverage/spec-spec_helper_rb.html",
31
- "doc/classes/AuthEchoServlet.html",
32
- "doc/classes/AuthEchoServlet.src/M000001.html",
33
- "doc/classes/AuthEchoServlet.src/M000002.html",
34
- "doc/classes/GData.html",
35
- "doc/classes/GData/AuthSubError.html",
36
- "doc/classes/GData/AuthSubError.src/M000019.html",
37
- "doc/classes/GData/Error.html",
38
- "doc/classes/GData/GoogleAuthSub.html",
39
- "doc/classes/GData/GoogleAuthSub.src/M000001.html",
40
- "doc/classes/GData/GoogleAuthSub.src/M000002.html",
41
- "doc/classes/GData/GoogleAuthSub.src/M000003.html",
42
- "doc/classes/GData/GoogleAuthSub.src/M000004.html",
43
- "doc/classes/GData/GoogleAuthSub.src/M000005.html",
44
- "doc/classes/GData/GoogleAuthSub.src/M000006.html",
45
- "doc/classes/GData/GoogleAuthSub.src/M000007.html",
46
- "doc/classes/GData/GoogleAuthSub.src/M000008.html",
47
- "doc/classes/GData/GoogleAuthSub.src/M000009.html",
48
- "doc/classes/GData/GoogleAuthSub.src/M000010.html",
49
- "doc/classes/GData/GoogleAuthSub.src/M000011.html",
50
- "doc/classes/GData/GoogleAuthSub.src/M000012.html",
51
- "doc/classes/GData/GoogleAuthSub.src/M000013.html",
52
- "doc/classes/GData/GoogleAuthSub.src/M000014.html",
53
- "doc/classes/GData/GoogleAuthSub.src/M000015.html",
54
- "doc/classes/GData/GoogleAuthSub.src/M000016.html",
55
- "doc/classes/GData/GoogleAuthSub.src/M000017.html",
56
- "doc/classes/GData/GoogleAuthSub.src/M000018.html",
57
- "doc/created.rid",
58
- "doc/files/googleauthsub_rb.html",
59
- "doc/files/lib/googleauthsub_rb.html",
60
- "doc/files/spec/googleauthsub_spec_rb.html",
61
- "doc/files/spec/googleresponder_rb.html",
62
- "doc/files/spec/spec_helper_rb.html",
63
- "doc/fr_class_index.html",
64
- "doc/fr_file_index.html",
65
- "doc/fr_method_index.html",
66
- "doc/index.html",
67
- "doc/rdoc-style.css",
68
21
  "google-authsub.gemspec",
69
22
  "lib/googleauthsub.rb",
70
- "live test/authsub_test.html",
71
- "live test/gastest.rb",
72
23
  "spec/googleauthsub_spec.rb",
73
24
  "spec/googleresponder.rb",
74
25
  "spec/mock responses/bad_token_info.txt",
@@ -83,25 +34,12 @@ Gem::Specification.new do |s|
83
34
  "spec/spec_helper.rb",
84
35
  "spec/spec_opts"
85
36
  ]
86
- s.homepage = %q{http://github.com/jstorimer/google-authsub}
87
37
  s.rdoc_options = ["--charset=UTF-8"]
88
38
  s.require_paths = ["lib"]
89
- s.rubygems_version = %q{1.3.5}
90
- s.summary = %q{A ruby implementation of Google Authentication for Web Applications API}
91
39
  s.test_files = [
92
40
  "spec/googleauthsub_spec.rb",
93
41
  "spec/googleresponder.rb",
94
42
  "spec/spec_helper.rb"
95
43
  ]
96
-
97
- if s.respond_to? :specification_version then
98
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
99
- s.specification_version = 3
100
-
101
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
102
- else
103
- end
104
- else
105
- end
106
44
  end
107
45
 
data/lib/googleauthsub.rb CHANGED
@@ -97,7 +97,6 @@ class GoogleAuthSub
97
97
  # This returns a URI::HTTPS object which contains the Google url to request a token from.
98
98
  def request_url
99
99
  raise AuthSubError, "Invalid next URL: #{@next_url}" if !full_url?(@next_url)
100
- raise AuthSubError, "Invalid scope URL: #{@scope}" if !full_url?(@scope)
101
100
  query = "next=" << @next_url << "&scope=" << @scope << "&session="<<
102
101
  (session_token? ? '1' : '0')<< "&secure="<< (secure_token? ? '1' : '0')
103
102
  query = URI.encode(query)
@@ -224,7 +223,7 @@ class GoogleAuthSub
224
223
  if method.superclass != Net::HTTPRequest
225
224
  raise AuthSubError, "method must be a Net::HTTPRequest subclass (GET POST PUT DELETE). #{method} received."
226
225
  end
227
- request = method.new(url.path)
226
+ request = method.new(url.path + "?" + url.query.to_s)
228
227
  request['Authorization'] = authorization_header(request, url)
229
228
  connection = Net::HTTP.new(url.host, url.port)
230
229
  connection.use_ssl= (url.scheme == 'https')
@@ -258,7 +257,7 @@ class GoogleAuthSub
258
257
  # First check if it is a bad uri
259
258
  begin
260
259
  u = URI.parse(url)
261
- rescue URI.InvalidURIError
260
+ rescue URI::InvalidURIError
262
261
  return false
263
262
  end
264
263
  return false if u.scheme.nil? || u.host.nil? || u.path.nil?
@@ -109,9 +109,9 @@ describe GoogleAuthSub do
109
109
  @authsub.request_url.to_s.should == @valid_secure_session_url
110
110
  end
111
111
 
112
- it 'should raise an error if the scope URL is not a full path' do
113
- @authsub.scope = "www.google.com/calendar/feeds"
114
- lambda { @authsub.request_url }.should raise_error(AuthSubError)
112
+ it 'should allow multiple scopes' do
113
+ @authsub.scope = "www.google.com/calendar/feeds www.google.com/base/feeds"
114
+ lambda { @authsub.request_url }.should_not raise_error(AuthSubError)
115
115
  end
116
116
 
117
117
  it "should raise an error if the next_url is not a full path" do
metadata CHANGED
@@ -1,7 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-authsub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ hash: 23
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 2
9
+ - 0
10
+ version: 0.2.0
5
11
  platform: ruby
6
12
  authors:
7
13
  - Stuart Coyle
@@ -10,7 +16,7 @@ autorequire:
10
16
  bindir: bin
11
17
  cert_chain: []
12
18
 
13
- date: 2010-01-25 00:00:00 -05:00
19
+ date: 2011-02-16 00:00:00 -05:00
14
20
  default_executable:
15
21
  dependencies: []
16
22
 
@@ -27,55 +33,8 @@ files:
27
33
  - MIT-LICENSE
28
34
  - README
29
35
  - Rakefile
30
- - VERSION
31
- - coverage/-Library-Ruby-Gems-1_8-gems-FakeWeb-1_1_2-lib-fake_net_http_rb.html
32
- - coverage/-Library-Ruby-Gems-1_8-gems-FakeWeb-1_1_2-lib-fake_web_rb.html
33
- - coverage/-Library-Ruby-Gems-1_8-gems-rcov-0_8_1_2_0-lib-rcov_rb.html
34
- - coverage/index.html
35
- - coverage/lib-googleauthsub_rb.html
36
- - coverage/spec-googleauthsub_spec_rb.html
37
- - coverage/spec-spec_helper_rb.html
38
- - doc/classes/AuthEchoServlet.html
39
- - doc/classes/AuthEchoServlet.src/M000001.html
40
- - doc/classes/AuthEchoServlet.src/M000002.html
41
- - doc/classes/GData.html
42
- - doc/classes/GData/AuthSubError.html
43
- - doc/classes/GData/AuthSubError.src/M000019.html
44
- - doc/classes/GData/Error.html
45
- - doc/classes/GData/GoogleAuthSub.html
46
- - doc/classes/GData/GoogleAuthSub.src/M000001.html
47
- - doc/classes/GData/GoogleAuthSub.src/M000002.html
48
- - doc/classes/GData/GoogleAuthSub.src/M000003.html
49
- - doc/classes/GData/GoogleAuthSub.src/M000004.html
50
- - doc/classes/GData/GoogleAuthSub.src/M000005.html
51
- - doc/classes/GData/GoogleAuthSub.src/M000006.html
52
- - doc/classes/GData/GoogleAuthSub.src/M000007.html
53
- - doc/classes/GData/GoogleAuthSub.src/M000008.html
54
- - doc/classes/GData/GoogleAuthSub.src/M000009.html
55
- - doc/classes/GData/GoogleAuthSub.src/M000010.html
56
- - doc/classes/GData/GoogleAuthSub.src/M000011.html
57
- - doc/classes/GData/GoogleAuthSub.src/M000012.html
58
- - doc/classes/GData/GoogleAuthSub.src/M000013.html
59
- - doc/classes/GData/GoogleAuthSub.src/M000014.html
60
- - doc/classes/GData/GoogleAuthSub.src/M000015.html
61
- - doc/classes/GData/GoogleAuthSub.src/M000016.html
62
- - doc/classes/GData/GoogleAuthSub.src/M000017.html
63
- - doc/classes/GData/GoogleAuthSub.src/M000018.html
64
- - doc/created.rid
65
- - doc/files/googleauthsub_rb.html
66
- - doc/files/lib/googleauthsub_rb.html
67
- - doc/files/spec/googleauthsub_spec_rb.html
68
- - doc/files/spec/googleresponder_rb.html
69
- - doc/files/spec/spec_helper_rb.html
70
- - doc/fr_class_index.html
71
- - doc/fr_file_index.html
72
- - doc/fr_method_index.html
73
- - doc/index.html
74
- - doc/rdoc-style.css
75
36
  - google-authsub.gemspec
76
37
  - lib/googleauthsub.rb
77
- - live test/authsub_test.html
78
- - live test/gastest.rb
79
38
  - spec/googleauthsub_spec.rb
80
39
  - spec/googleresponder.rb
81
40
  - spec/mock responses/bad_token_info.txt
@@ -99,21 +58,27 @@ rdoc_options:
99
58
  require_paths:
100
59
  - lib
101
60
  required_ruby_version: !ruby/object:Gem::Requirement
61
+ none: false
102
62
  requirements:
103
63
  - - ">="
104
64
  - !ruby/object:Gem::Version
65
+ hash: 3
66
+ segments:
67
+ - 0
105
68
  version: "0"
106
- version:
107
69
  required_rubygems_version: !ruby/object:Gem::Requirement
70
+ none: false
108
71
  requirements:
109
72
  - - ">="
110
73
  - !ruby/object:Gem::Version
74
+ hash: 3
75
+ segments:
76
+ - 0
111
77
  version: "0"
112
- version:
113
78
  requirements: []
114
79
 
115
80
  rubyforge_project:
116
- rubygems_version: 1.3.5
81
+ rubygems_version: 1.5.0
117
82
  signing_key:
118
83
  specification_version: 3
119
84
  summary: A ruby implementation of Google Authentication for Web Applications API
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.1.0