google-authsub 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/MIT-LICENSE +20 -0
- data/README +98 -0
- data/Rakefile +19 -0
- data/VERSION +1 -0
- data/coverage/-Library-Ruby-Gems-1_8-gems-FakeWeb-1_1_2-lib-fake_net_http_rb.html +679 -0
- data/coverage/-Library-Ruby-Gems-1_8-gems-FakeWeb-1_1_2-lib-fake_web_rb.html +843 -0
- data/coverage/-Library-Ruby-Gems-1_8-gems-rcov-0_8_1_2_0-lib-rcov_rb.html +1598 -0
- data/coverage/index.html +360 -0
- data/coverage/lib-googleauthsub_rb.html +877 -0
- data/coverage/spec-googleauthsub_spec_rb.html +950 -0
- data/coverage/spec-spec_helper_rb.html +640 -0
- data/doc/classes/AuthEchoServlet.html +152 -0
- data/doc/classes/AuthEchoServlet.src/M000001.html +20 -0
- data/doc/classes/AuthEchoServlet.src/M000002.html +18 -0
- data/doc/classes/GData/AuthSubError.html +139 -0
- data/doc/classes/GData/AuthSubError.src/M000019.html +18 -0
- data/doc/classes/GData/Error.html +111 -0
- data/doc/classes/GData/GoogleAuthSub.html +521 -0
- data/doc/classes/GData/GoogleAuthSub.src/M000001.html +29 -0
- data/doc/classes/GData/GoogleAuthSub.src/M000002.html +22 -0
- data/doc/classes/GData/GoogleAuthSub.src/M000003.html +29 -0
- data/doc/classes/GData/GoogleAuthSub.src/M000004.html +22 -0
- data/doc/classes/GData/GoogleAuthSub.src/M000005.html +24 -0
- data/doc/classes/GData/GoogleAuthSub.src/M000006.html +19 -0
- data/doc/classes/GData/GoogleAuthSub.src/M000007.html +18 -0
- data/doc/classes/GData/GoogleAuthSub.src/M000008.html +18 -0
- data/doc/classes/GData/GoogleAuthSub.src/M000009.html +24 -0
- data/doc/classes/GData/GoogleAuthSub.src/M000010.html +25 -0
- data/doc/classes/GData/GoogleAuthSub.src/M000011.html +30 -0
- data/doc/classes/GData/GoogleAuthSub.src/M000012.html +18 -0
- data/doc/classes/GData/GoogleAuthSub.src/M000013.html +18 -0
- data/doc/classes/GData/GoogleAuthSub.src/M000014.html +18 -0
- data/doc/classes/GData/GoogleAuthSub.src/M000015.html +18 -0
- data/doc/classes/GData/GoogleAuthSub.src/M000016.html +20 -0
- data/doc/classes/GData/GoogleAuthSub.src/M000017.html +20 -0
- data/doc/classes/GData/GoogleAuthSub.src/M000018.html +19 -0
- data/doc/classes/GData.html +162 -0
- data/doc/created.rid +1 -0
- data/doc/files/googleauthsub_rb.html +140 -0
- data/doc/files/lib/googleauthsub_rb.html +140 -0
- data/doc/files/spec/googleauthsub_spec_rb.html +146 -0
- data/doc/files/spec/googleresponder_rb.html +121 -0
- data/doc/files/spec/spec_helper_rb.html +149 -0
- data/doc/fr_class_index.html +31 -0
- data/doc/fr_file_index.html +30 -0
- data/doc/fr_method_index.html +45 -0
- data/doc/index.html +24 -0
- data/doc/rdoc-style.css +208 -0
- data/google-authsub-0.0.2.gem +0 -0
- data/google-authsub-0.0.3.gem +0 -0
- data/google-authsub.gemspec +109 -0
- data/lib/googleauthsub.rb +271 -0
- data/live test/authsub_test.html +40 -0
- data/live test/gastest.rb +90 -0
- data/spec/googleauthsub_spec.rb +350 -0
- data/spec/googleresponder.rb +26 -0
- data/spec/mock responses/bad_token_info.txt +11 -0
- data/spec/mock responses/calendar.txt +11 -0
- data/spec/mock responses/revoke_token.txt +7 -0
- data/spec/mock responses/revoked_token.txt +17 -0
- data/spec/mock responses/session_token.txt +9 -0
- data/spec/mock responses/token_info.txt +11 -0
- data/spec/mock responses/unauthorized.txt +18 -0
- data/spec/mock_certs/test_private_key.pem +15 -0
- data/spec/mock_certs/test_public_key.pem +6 -0
- data/spec/spec_helper.rb +30 -0
- data/spec/spec_opts +7 -0
- metadata +125 -0
@@ -0,0 +1,18 @@
|
|
1
|
+
HTTP/1.1 401 Unauthorized
|
2
|
+
Content-Type: text/html; charset=UTF-8
|
3
|
+
WWW-Authenticate: AuthSub realm="https://www.google.com/accounts/AuthSubRequest"
|
4
|
+
Expires: Sat, 15 Mar 2008 00:40:07 GMT
|
5
|
+
Cache-Control: private, max-age=0
|
6
|
+
Content-Length: 147
|
7
|
+
Date: Sat, 15 Mar 2008 00:40:07 GMT
|
8
|
+
Server: GFE/1.3
|
9
|
+
|
10
|
+
<HTML>
|
11
|
+
<HEAD>
|
12
|
+
<TITLE>Unauthorized</TITLE>
|
13
|
+
</HEAD>
|
14
|
+
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
|
15
|
+
<H1>Unauthorized</H1>
|
16
|
+
<H2>Error 401</H2>
|
17
|
+
</BODY>
|
18
|
+
</HTML>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
-----BEGIN RSA PRIVATE KEY-----
|
2
|
+
MIICXgIBAAKBgQDltwLUcWjPlzqAYkrHiAFd0WczL2TbDA3DHNw4fyVAqAvi5upT
|
3
|
+
pC60Zyeu+t0YcU8cg/xsloCnJOwkIx3FVOyvPT1ncZP2b4ZDXKfKTypwwc00EC3i
|
4
|
+
cDo/BOq9bHxoQxflF/6x9eEE+x6tIovF6kGzNe9+RCO9UwWGB6vTl9up1QIDAQAB
|
5
|
+
AoGAQqkLDy8h5SvTdDIR1TkofFsqAXZ9Y/tpevdDCLoMy2h4mo277i20x/EvWN2/
|
6
|
+
jzpCZNoARFqgVuCmDg6Ksxrj26GrHexHB9j/4VAyriniiFeGZfgiYoFUDQjCJzb/
|
7
|
+
ifExVNIvHzpZLOFPIdEqlD6glQTxWcgFxkxNQq1lSfqX5PkCQQD7LhAuP2hzC4vU
|
8
|
+
QHKiiu3kLDV2y4H5NOkk1cDd/NLcGQ3KtOp82GxhownB0ccd9VYE1EULWmKoRFli
|
9
|
+
ZJIcK02zAkEA6h9/3oyGBFgePRpy4nv/ikTSJNyX7YX9et3guxkGi4nI2fSpAR5A
|
10
|
+
bIX2BiEPZIDdzdBDaB8D5ZW1lps7xv22VwJBAM2h/2MtTABrYnVIsdC6NlmHi9mO
|
11
|
+
cACqPXiHelcCRUolRLI//Hxq3gfs5u8DI6U2Fc7sTP4nZ/9jvV2dAjUHipsCQQCG
|
12
|
+
UzZJGHTXzzriMeeSPDR8P0oWbh4Y4BRzxxNmJVCVBKOhMXc5tgKegSmLkLJFJo6b
|
13
|
+
xA64kXrp4UBDPaNJY02XAkEAsITMV2IB4wQVJRWIX25LYrlSWdeYHGRJyN5wo8iq
|
14
|
+
7ALIw27hq0MuvBNCiZmmYrbnNK9LyCr4fN1kYPZrrsCoag==
|
15
|
+
-----END RSA PRIVATE KEY-----
|
@@ -0,0 +1,6 @@
|
|
1
|
+
-----BEGIN PUBLIC KEY-----
|
2
|
+
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDltwLUcWjPlzqAYkrHiAFd0Wcz
|
3
|
+
L2TbDA3DHNw4fyVAqAvi5upTpC60Zyeu+t0YcU8cg/xsloCnJOwkIx3FVOyvPT1n
|
4
|
+
cZP2b4ZDXKfKTypwwc00EC3icDo/BOq9bHxoQxflF/6x9eEE+x6tIovF6kGzNe9+
|
5
|
+
RCO9UwWGB6vTl9up1QIDAQAB
|
6
|
+
-----END PUBLIC KEY-----
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
|
2
|
+
dir = File.dirname(__FILE__)
|
3
|
+
base_dir = "#{dir}/../"
|
4
|
+
lib_dir = "#{base_dir}lib/"
|
5
|
+
require lib_dir + 'googleauthsub.rb'
|
6
|
+
|
7
|
+
# Some constants for testing purposes
|
8
|
+
INVALID_TOKEN = "CMSdfhfhfjsjskee__d"
|
9
|
+
TOKEN = "CMScoaHmDxC80Y2pAg"
|
10
|
+
SESSION_TOKEN ="CMScoaHmDxDM9dqPBA"
|
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"
|
16
|
+
|
17
|
+
module GData
|
18
|
+
class GoogleAuthSub
|
19
|
+
|
20
|
+
# extract signature from header
|
21
|
+
def sig(header)
|
22
|
+
s = header.match(/^.*sig="(.*)"/m)
|
23
|
+
s[1] if !s.nil?
|
24
|
+
end
|
25
|
+
|
26
|
+
def auth_header(request, url)
|
27
|
+
authorization_header(request, url)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
data/spec/spec_opts
ADDED
metadata
ADDED
@@ -0,0 +1,125 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: google-authsub
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.4
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Stuart Coyle
|
8
|
+
- Jesse Storimer
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
|
13
|
+
date: 2010-01-22 00:00:00 -05:00
|
14
|
+
default_executable:
|
15
|
+
dependencies: []
|
16
|
+
|
17
|
+
description: GoogleAuthSub provides the Google Authentications for Web Applications API.
|
18
|
+
email: stuart.coyle@gmail.com
|
19
|
+
executables: []
|
20
|
+
|
21
|
+
extensions: []
|
22
|
+
|
23
|
+
extra_rdoc_files:
|
24
|
+
- README
|
25
|
+
files:
|
26
|
+
- .gitignore
|
27
|
+
- MIT-LICENSE
|
28
|
+
- README
|
29
|
+
- 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
|
+
- google-authsub-0.0.2.gem
|
76
|
+
- google-authsub-0.0.3.gem
|
77
|
+
- google-authsub.gemspec
|
78
|
+
- lib/googleauthsub.rb
|
79
|
+
- live test/authsub_test.html
|
80
|
+
- live test/gastest.rb
|
81
|
+
- spec/googleauthsub_spec.rb
|
82
|
+
- spec/googleresponder.rb
|
83
|
+
- spec/mock responses/bad_token_info.txt
|
84
|
+
- spec/mock responses/calendar.txt
|
85
|
+
- spec/mock responses/revoke_token.txt
|
86
|
+
- spec/mock responses/revoked_token.txt
|
87
|
+
- spec/mock responses/session_token.txt
|
88
|
+
- spec/mock responses/token_info.txt
|
89
|
+
- spec/mock responses/unauthorized.txt
|
90
|
+
- spec/mock_certs/test_private_key.pem
|
91
|
+
- spec/mock_certs/test_public_key.pem
|
92
|
+
- spec/spec_helper.rb
|
93
|
+
- spec/spec_opts
|
94
|
+
has_rdoc: true
|
95
|
+
homepage: http://github.com/stuart/google-authsub/tree/master
|
96
|
+
licenses: []
|
97
|
+
|
98
|
+
post_install_message:
|
99
|
+
rdoc_options:
|
100
|
+
- --charset=UTF-8
|
101
|
+
require_paths:
|
102
|
+
- lib
|
103
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
104
|
+
requirements:
|
105
|
+
- - ">="
|
106
|
+
- !ruby/object:Gem::Version
|
107
|
+
version: "0"
|
108
|
+
version:
|
109
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
110
|
+
requirements:
|
111
|
+
- - ">="
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
version: "0"
|
114
|
+
version:
|
115
|
+
requirements: []
|
116
|
+
|
117
|
+
rubyforge_project:
|
118
|
+
rubygems_version: 1.3.5
|
119
|
+
signing_key:
|
120
|
+
specification_version: 3
|
121
|
+
summary: A ruby implementation of Google Authentication for Web Applications API
|
122
|
+
test_files:
|
123
|
+
- spec/googleauthsub_spec.rb
|
124
|
+
- spec/googleresponder.rb
|
125
|
+
- spec/spec_helper.rb
|