google-authsub 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{google-authsub}
5
- s.version = "0.2.0"
5
+ s.version = "0.2.1"
6
6
  s.authors = ["Stuart Coyle", "Jesse Storimer"]
7
7
  s.summary = "A ruby implementation of Google Authentication for Web Applications API"
8
8
  s.description = "GoogleAuthSub provides the Google Authentications for Web Applications API."
data/lib/googleauthsub.rb CHANGED
@@ -30,12 +30,11 @@ require 'cgi'
30
30
  #
31
31
  module GData
32
32
 
33
- GOOGLE_HOST_URL = "www.google.com"
34
- GOOGLE_AUTHSUB_BASE_PATH = "/accounts"
35
- GOOGLE_AUTHSUB_REQUEST_PATH = GOOGLE_AUTHSUB_BASE_PATH + "/AuthSubRequest"
36
- GOOGLE_AUTHSUB_SESSION_TOKEN_PATH = GOOGLE_AUTHSUB_BASE_PATH + "/AuthSubSessionToken"
37
- GOOGLE_AUTHSUB_REVOKE_PATH = GOOGLE_AUTHSUB_BASE_PATH + "/AuthSubRevokeToken"
38
- GOOGLE_AUTHSUB_TOKEN_INFO_PATH = GOOGLE_AUTHSUB_BASE_PATH + "/AuthSubTokenInfo"
33
+ GOOGLE_HOST_URL = "accounts.google.com"
34
+ GOOGLE_AUTHSUB_REQUEST_PATH = "/AuthSubRequest"
35
+ GOOGLE_AUTHSUB_SESSION_TOKEN_PATH = "/AuthSubSessionToken"
36
+ GOOGLE_AUTHSUB_REVOKE_PATH = "/AuthSubRevokeToken"
37
+ GOOGLE_AUTHSUB_TOKEN_INFO_PATH = "/AuthSubTokenInfo"
39
38
 
40
39
  class Error < Exception
41
40
  end
@@ -161,14 +161,14 @@ describe GoogleAuthSub do
161
161
  end
162
162
 
163
163
  it "should generate the correct signature" do
164
- expected_sig = "GET #{@data_request_url} 1204942501 100000000000000"
164
+ expected_sig = "GET #{@data_request_url} 1204996501 100000000000000"
165
165
  sig = @authsub.auth_header(Net::HTTP::Get.new(@data_request_url), @data_request_url).match(/sig=\"([^\"]*)$/)[1]
166
166
  @public_key.public_decrypt(sig.unpack("m").join).should == OpenSSL::Digest::SHA1.new(expected_sig).hexdigest
167
167
  end
168
168
 
169
169
  it "should generate a correct authorization header when secure" do
170
170
  @authsub.auth_header(Net::HTTP::Get.new(@data_request_url), @data_request_url).should ==
171
- "AuthSub token=\"CMScoaHmDxC80Y2pAg\" data=\"GET http://www.google.com/calendar/feeds/default/private/full 1204942501 100000000000000\" sig=\"5H44KRwb+B9dMraK0mxsVv3aSF+gCz1hz7FEMViYdl89rC/BXQkmW7Xb9/Xf\n226E5Q+RPtFd+DaK/mXFxtoOJBqlz7mZgV+QOrr/dxCM6HpjIpxF9Qxo9zCT\nKvz0IS4gxXCVMgEgJOdF3YjqZo2bMgiG/Wjm/774Yitkc2tKhL8=\n\" sigalg=\"rsa-sha1\""
171
+ "AuthSub token=\"CMScoaHmDxC80Y2pAg\" data=\"GET http://www.google.com/calendar/feeds/default/private/full 1204996501 100000000000000\" sig=\"aVyTV9ctcptjVLLelTLmf/UbVUSrfHL3VjE4dDDGrMxFRfLyKC7NBm/zVP8z\nP3Bh7ZJd58CLs9f8NxdIPSsuZg6HClVjfGAskSWNgwtSpjfE7A1fzbBKGwBu\nG6akHJhrgyPKxeoGEDMzdlvbs6zBCytdoPEHDcY0IrP1Sv47L1Y=\n\" sigalg=\"rsa-sha1\""
172
172
  end
173
173
 
174
174
  end
@@ -209,7 +209,7 @@ describe GoogleAuthSub do
209
209
  end
210
210
 
211
211
  it "should make request to correct url" do
212
- @authsub.request_session_token.should be true
212
+ @authsub.request_session_token.should eq "CMScoaHmDxDM9dqPBA"
213
213
  end
214
214
 
215
215
  end
data/spec/spec_helper.rb CHANGED
@@ -9,10 +9,10 @@ INVALID_TOKEN = "CMSdfhfhfjsjskee__d"
9
9
  TOKEN = "CMScoaHmDxC80Y2pAg"
10
10
  SESSION_TOKEN ="CMScoaHmDxDM9dqPBA"
11
11
 
12
- AUTHSUB_REQUEST_URL = "https://www.google.com/accounts/AuthSubRequest"
13
- AUTHSUB_SESSION_TOKEN_URL = "https://www.google.com/accounts/AuthSubSessionToken"
14
- AUTHSUB_REVOKE_TOKEN_URL = "https://www.google.com/accounts/AuthSubRevokeToken"
15
- AUTHSUB_TOKEN_INFO_URL = "https://www.google.com/accounts/AuthSubTokenInfo"
12
+ AUTHSUB_REQUEST_URL = "https://accounts.google.com/AuthSubRequest"
13
+ AUTHSUB_SESSION_TOKEN_URL = "https://accounts.google.com/AuthSubSessionToken"
14
+ AUTHSUB_REVOKE_TOKEN_URL = "https://accounts.google.com/AuthSubRevokeToken"
15
+ AUTHSUB_TOKEN_INFO_URL = "https://accounts.google.com/AuthSubTokenInfo"
16
16
 
17
17
  module GData
18
18
  class GoogleAuthSub
metadata CHANGED
@@ -1,34 +1,25 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: google-authsub
3
- version: !ruby/object:Gem::Version
4
- hash: 23
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.1
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 2
9
- - 0
10
- version: 0.2.0
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Stuart Coyle
14
9
  - Jesse Storimer
15
10
  autorequire:
16
11
  bindir: bin
17
12
  cert_chain: []
18
-
19
- date: 2011-02-16 00:00:00 -05:00
20
- default_executable:
13
+ date: 2013-02-15 00:00:00.000000000 Z
21
14
  dependencies: []
22
-
23
- description: GoogleAuthSub provides the Google Authentications for Web Applications API.
15
+ description: GoogleAuthSub provides the Google Authentications for Web Applications
16
+ API.
24
17
  email: jstorimer@gmail.com
25
18
  executables: []
26
-
27
19
  extensions: []
28
-
29
- extra_rdoc_files:
20
+ extra_rdoc_files:
30
21
  - README
31
- files:
22
+ files:
32
23
  - .gitignore
33
24
  - MIT-LICENSE
34
25
  - README
@@ -48,41 +39,33 @@ files:
48
39
  - spec/mock_certs/test_public_key.pem
49
40
  - spec/spec_helper.rb
50
41
  - spec/spec_opts
51
- has_rdoc: true
52
42
  homepage: http://github.com/jstorimer/google-authsub
53
43
  licenses: []
54
-
55
44
  post_install_message:
56
- rdoc_options:
45
+ rdoc_options:
57
46
  - --charset=UTF-8
58
- require_paths:
47
+ require_paths:
59
48
  - lib
60
- required_ruby_version: !ruby/object:Gem::Requirement
49
+ required_ruby_version: !ruby/object:Gem::Requirement
61
50
  none: false
62
- requirements:
63
- - - ">="
64
- - !ruby/object:Gem::Version
65
- hash: 3
66
- segments:
67
- - 0
68
- version: "0"
69
- required_rubygems_version: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ required_rubygems_version: !ruby/object:Gem::Requirement
70
56
  none: false
71
- requirements:
72
- - - ">="
73
- - !ruby/object:Gem::Version
74
- hash: 3
75
- segments:
76
- - 0
77
- version: "0"
57
+ requirements:
58
+ - - ! '>='
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
78
61
  requirements: []
79
-
80
62
  rubyforge_project:
81
- rubygems_version: 1.5.0
63
+ rubygems_version: 1.8.23
82
64
  signing_key:
83
65
  specification_version: 3
84
66
  summary: A ruby implementation of Google Authentication for Web Applications API
85
- test_files:
67
+ test_files:
86
68
  - spec/googleauthsub_spec.rb
87
69
  - spec/googleresponder.rb
88
70
  - spec/spec_helper.rb
71
+ has_rdoc: