google-authsub 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +0 -15
- data/google-authsub.gemspec +7 -69
- data/lib/googleauthsub.rb +2 -3
- data/spec/googleauthsub_spec.rb +3 -3
- metadata +17 -52
- data/VERSION +0 -1
- data/coverage/-Library-Ruby-Gems-1_8-gems-FakeWeb-1_1_2-lib-fake_net_http_rb.html +0 -679
- data/coverage/-Library-Ruby-Gems-1_8-gems-FakeWeb-1_1_2-lib-fake_web_rb.html +0 -843
- data/coverage/-Library-Ruby-Gems-1_8-gems-rcov-0_8_1_2_0-lib-rcov_rb.html +0 -1598
- data/coverage/index.html +0 -360
- data/coverage/lib-googleauthsub_rb.html +0 -877
- data/coverage/spec-googleauthsub_spec_rb.html +0 -950
- data/coverage/spec-spec_helper_rb.html +0 -640
- data/doc/classes/AuthEchoServlet.html +0 -152
- data/doc/classes/AuthEchoServlet.src/M000001.html +0 -20
- data/doc/classes/AuthEchoServlet.src/M000002.html +0 -18
- data/doc/classes/GData/AuthSubError.html +0 -139
- data/doc/classes/GData/AuthSubError.src/M000019.html +0 -18
- data/doc/classes/GData/Error.html +0 -111
- data/doc/classes/GData/GoogleAuthSub.html +0 -521
- data/doc/classes/GData/GoogleAuthSub.src/M000001.html +0 -29
- data/doc/classes/GData/GoogleAuthSub.src/M000002.html +0 -22
- data/doc/classes/GData/GoogleAuthSub.src/M000003.html +0 -29
- data/doc/classes/GData/GoogleAuthSub.src/M000004.html +0 -22
- data/doc/classes/GData/GoogleAuthSub.src/M000005.html +0 -24
- data/doc/classes/GData/GoogleAuthSub.src/M000006.html +0 -19
- data/doc/classes/GData/GoogleAuthSub.src/M000007.html +0 -18
- data/doc/classes/GData/GoogleAuthSub.src/M000008.html +0 -18
- data/doc/classes/GData/GoogleAuthSub.src/M000009.html +0 -24
- data/doc/classes/GData/GoogleAuthSub.src/M000010.html +0 -25
- data/doc/classes/GData/GoogleAuthSub.src/M000011.html +0 -30
- data/doc/classes/GData/GoogleAuthSub.src/M000012.html +0 -18
- data/doc/classes/GData/GoogleAuthSub.src/M000013.html +0 -18
- data/doc/classes/GData/GoogleAuthSub.src/M000014.html +0 -18
- data/doc/classes/GData/GoogleAuthSub.src/M000015.html +0 -18
- data/doc/classes/GData/GoogleAuthSub.src/M000016.html +0 -20
- data/doc/classes/GData/GoogleAuthSub.src/M000017.html +0 -20
- data/doc/classes/GData/GoogleAuthSub.src/M000018.html +0 -19
- data/doc/classes/GData.html +0 -162
- data/doc/created.rid +0 -1
- data/doc/files/googleauthsub_rb.html +0 -140
- data/doc/files/lib/googleauthsub_rb.html +0 -140
- data/doc/files/spec/googleauthsub_spec_rb.html +0 -146
- data/doc/files/spec/googleresponder_rb.html +0 -121
- data/doc/files/spec/spec_helper_rb.html +0 -149
- data/doc/fr_class_index.html +0 -31
- data/doc/fr_file_index.html +0 -30
- data/doc/fr_method_index.html +0 -45
- data/doc/index.html +0 -24
- data/doc/rdoc-style.css +0 -208
- data/live test/authsub_test.html +0 -40
- data/live test/gastest.rb +0 -90
data/doc/rdoc-style.css
DELETED
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
body {
|
|
3
|
-
font-family: Verdana,Arial,Helvetica,sans-serif;
|
|
4
|
-
font-size: 90%;
|
|
5
|
-
margin: 0;
|
|
6
|
-
margin-left: 40px;
|
|
7
|
-
padding: 0;
|
|
8
|
-
background: white;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
h1,h2,h3,h4 { margin: 0; color: #efefef; background: transparent; }
|
|
12
|
-
h1 { font-size: 150%; }
|
|
13
|
-
h2,h3,h4 { margin-top: 1em; }
|
|
14
|
-
|
|
15
|
-
a { background: #eef; color: #039; text-decoration: none; }
|
|
16
|
-
a:hover { background: #039; color: #eef; }
|
|
17
|
-
|
|
18
|
-
/* Override the base stylesheet's Anchor inside a table cell */
|
|
19
|
-
td > a {
|
|
20
|
-
background: transparent;
|
|
21
|
-
color: #039;
|
|
22
|
-
text-decoration: none;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/* and inside a section title */
|
|
26
|
-
.section-title > a {
|
|
27
|
-
background: transparent;
|
|
28
|
-
color: #eee;
|
|
29
|
-
text-decoration: none;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/* === Structural elements =================================== */
|
|
33
|
-
|
|
34
|
-
div#index {
|
|
35
|
-
margin: 0;
|
|
36
|
-
margin-left: -40px;
|
|
37
|
-
padding: 0;
|
|
38
|
-
font-size: 90%;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
div#index a {
|
|
43
|
-
margin-left: 0.7em;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
div#index .section-bar {
|
|
47
|
-
margin-left: 0px;
|
|
48
|
-
padding-left: 0.7em;
|
|
49
|
-
background: #ccc;
|
|
50
|
-
font-size: small;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
div#classHeader, div#fileHeader {
|
|
55
|
-
width: auto;
|
|
56
|
-
color: white;
|
|
57
|
-
padding: 0.5em 1.5em 0.5em 1.5em;
|
|
58
|
-
margin: 0;
|
|
59
|
-
margin-left: -40px;
|
|
60
|
-
border-bottom: 3px solid #006;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
div#classHeader a, div#fileHeader a {
|
|
64
|
-
background: inherit;
|
|
65
|
-
color: white;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
div#classHeader td, div#fileHeader td {
|
|
69
|
-
background: inherit;
|
|
70
|
-
color: white;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
div#fileHeader {
|
|
75
|
-
background: #057;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
div#classHeader {
|
|
79
|
-
background: #048;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
.class-name-in-header {
|
|
84
|
-
font-size: 180%;
|
|
85
|
-
font-weight: bold;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
div#bodyContent {
|
|
90
|
-
padding: 0 1.5em 0 1.5em;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
div#description {
|
|
94
|
-
padding: 0.5em 1.5em;
|
|
95
|
-
background: #efefef;
|
|
96
|
-
border: 1px dotted #999;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
div#description h1,h2,h3,h4,h5,h6 {
|
|
100
|
-
color: #125;;
|
|
101
|
-
background: transparent;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
div#validator-badges {
|
|
105
|
-
text-align: center;
|
|
106
|
-
}
|
|
107
|
-
div#validator-badges img { border: 0; }
|
|
108
|
-
|
|
109
|
-
div#copyright {
|
|
110
|
-
color: #333;
|
|
111
|
-
background: #efefef;
|
|
112
|
-
font: 0.75em sans-serif;
|
|
113
|
-
margin-top: 5em;
|
|
114
|
-
margin-bottom: 0;
|
|
115
|
-
padding: 0.5em 2em;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
/* === Classes =================================== */
|
|
120
|
-
|
|
121
|
-
table.header-table {
|
|
122
|
-
color: white;
|
|
123
|
-
font-size: small;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
.type-note {
|
|
127
|
-
font-size: small;
|
|
128
|
-
color: #DEDEDE;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
.xxsection-bar {
|
|
132
|
-
background: #eee;
|
|
133
|
-
color: #333;
|
|
134
|
-
padding: 3px;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
.section-bar {
|
|
138
|
-
color: #333;
|
|
139
|
-
border-bottom: 1px solid #999;
|
|
140
|
-
margin-left: -20px;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
.section-title {
|
|
145
|
-
background: #79a;
|
|
146
|
-
color: #eee;
|
|
147
|
-
padding: 3px;
|
|
148
|
-
margin-top: 2em;
|
|
149
|
-
margin-left: -30px;
|
|
150
|
-
border: 1px solid #999;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
.top-aligned-row { vertical-align: top }
|
|
154
|
-
.bottom-aligned-row { vertical-align: bottom }
|
|
155
|
-
|
|
156
|
-
/* --- Context section classes ----------------------- */
|
|
157
|
-
|
|
158
|
-
.context-row { }
|
|
159
|
-
.context-item-name { font-family: monospace; font-weight: bold; color: black; }
|
|
160
|
-
.context-item-value { font-size: small; color: #448; }
|
|
161
|
-
.context-item-desc { color: #333; padding-left: 2em; }
|
|
162
|
-
|
|
163
|
-
/* --- Method classes -------------------------- */
|
|
164
|
-
.method-detail {
|
|
165
|
-
background: #efefef;
|
|
166
|
-
padding: 0;
|
|
167
|
-
margin-top: 0.5em;
|
|
168
|
-
margin-bottom: 1em;
|
|
169
|
-
border: 1px dotted #ccc;
|
|
170
|
-
}
|
|
171
|
-
.method-heading {
|
|
172
|
-
color: black;
|
|
173
|
-
background: #ccc;
|
|
174
|
-
border-bottom: 1px solid #666;
|
|
175
|
-
padding: 0.2em 0.5em 0 0.5em;
|
|
176
|
-
}
|
|
177
|
-
.method-signature { color: black; background: inherit; }
|
|
178
|
-
.method-name { font-weight: bold; }
|
|
179
|
-
.method-args { font-style: italic; }
|
|
180
|
-
.method-description { padding: 0 0.5em 0 0.5em; }
|
|
181
|
-
|
|
182
|
-
/* --- Source code sections -------------------- */
|
|
183
|
-
|
|
184
|
-
a.source-toggle { font-size: 90%; }
|
|
185
|
-
div.method-source-code {
|
|
186
|
-
background: #262626;
|
|
187
|
-
color: #ffdead;
|
|
188
|
-
margin: 1em;
|
|
189
|
-
padding: 0.5em;
|
|
190
|
-
border: 1px dashed #999;
|
|
191
|
-
overflow: hidden;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
div.method-source-code pre { color: #ffdead; overflow: hidden; }
|
|
195
|
-
|
|
196
|
-
/* --- Ruby keyword styles --------------------- */
|
|
197
|
-
|
|
198
|
-
.standalone-code { background: #221111; color: #ffdead; overflow: hidden; }
|
|
199
|
-
|
|
200
|
-
.ruby-constant { color: #7fffd4; background: transparent; }
|
|
201
|
-
.ruby-keyword { color: #00ffff; background: transparent; }
|
|
202
|
-
.ruby-ivar { color: #eedd82; background: transparent; }
|
|
203
|
-
.ruby-operator { color: #00ffee; background: transparent; }
|
|
204
|
-
.ruby-identifier { color: #ffdead; background: transparent; }
|
|
205
|
-
.ruby-node { color: #ffa07a; background: transparent; }
|
|
206
|
-
.ruby-comment { color: #b22222; font-weight: bold; background: transparent; }
|
|
207
|
-
.ruby-regexp { color: #ffa07a; background: transparent; }
|
|
208
|
-
.ruby-value { color: #7fffd4; background: transparent; }
|
data/live test/authsub_test.html
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
|
2
|
-
"http://www.w3.org/TR/html4/strict.dtd">
|
|
3
|
-
|
|
4
|
-
<html lang="en">
|
|
5
|
-
<head>
|
|
6
|
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
7
|
-
<title>authsub_test</title>
|
|
8
|
-
<meta name="generator" content="TextMate http://macromates.com/">
|
|
9
|
-
<meta name="author" content="stuart">
|
|
10
|
-
<!-- Date: 2008-08-20 -->
|
|
11
|
-
</head>
|
|
12
|
-
<body>
|
|
13
|
-
<h2>Google Authsub Test</h2>
|
|
14
|
-
<p>These pages test the Ruby google-authsub library and explain how to use it.</p>
|
|
15
|
-
<h3>STEP 1: <i>Request a token from Google</i></h3>
|
|
16
|
-
<p>For a web app to access Google's services. We need to get an authorization token from Google.</p>
|
|
17
|
-
|
|
18
|
-
<p>We will create our GoogleAuthSub object something like this:</p>
|
|
19
|
-
<p> <code>auth = GoogleAuthSub.new(:next_url=>"http://www.schedy.com/test2.html, :session=>false, :secure=>false, :scope=>"http://google.com/calendar/feeds")</code>
|
|
20
|
-
</p>
|
|
21
|
-
<p>The url to redirect to is found from <code>auth.request_url</code>. It is then up to the application to perform this redirect.
|
|
22
|
-
</p>
|
|
23
|
-
<p>If the request is successful and the user logs in correctly, the user will be redirected back to the <code>auth.next_url</code>
|
|
24
|
-
</p>
|
|
25
|
-
<p>To try it, use the form below and press 'Continue'</p>
|
|
26
|
-
<form action="authsub_test_2" method="get" accept-charset="utf-8">
|
|
27
|
-
<h3>Google Authsub Token Attributes</h3>
|
|
28
|
-
<b>Token Type</b><p>If session is selected, the token will be able to be exchanged for a session (i.e. multiple use) token.</p><nbsp>
|
|
29
|
-
Session:<input type="radio" name="session" value="true" id="session">
|
|
30
|
-
Single Use:<input type="radio" name="session" value="false" id="session" checked="true"><br/><br/>
|
|
31
|
-
<b>Secure (use https)</b><p>If secure=true, this token will be used for secure exchanges using https. The web application site must be registered with Google and have the correct certificate for this to work.</p><nbsp>
|
|
32
|
-
True<input type="radio" name="secure" value="true" id="session">
|
|
33
|
-
False<input type="radio" name="secure" value="false" id="session" checked="true"><br/><br/>
|
|
34
|
-
<b>Scope:</b>
|
|
35
|
-
<input type="text" name="scope" value="http://google.com/calendar/feeds" id="scope" size="60">
|
|
36
|
-
<p><input type="submit" value="Continue →"></p>
|
|
37
|
-
</form>
|
|
38
|
-
<div id=request_url></div>
|
|
39
|
-
</body>
|
|
40
|
-
</html>
|
data/live test/gastest.rb
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
|
|
3
|
-
#require 'rubygems'
|
|
4
|
-
require '../lib/googleauthsub'
|
|
5
|
-
require 'webrick'
|
|
6
|
-
include WEBrick
|
|
7
|
-
include GData
|
|
8
|
-
|
|
9
|
-
s = HTTPServer.new( :Port => 2000,
|
|
10
|
-
:SSLEnable => true
|
|
11
|
-
)
|
|
12
|
-
|
|
13
|
-
class SimpleAuthServlet < HTTPServlet::AbstractServlet
|
|
14
|
-
def do_GET(req, res)
|
|
15
|
-
@@auth.next_url="http://schedy.com:2000/simpletest"
|
|
16
|
-
@@auth.receive_token(req.request_uri);
|
|
17
|
-
url = @@auth.request_url.to_s
|
|
18
|
-
res.body = << END_RESPONSE
|
|
19
|
-
<html><head></head><body><h2>Google-Authsub Test</h2>
|
|
20
|
-
<p>TOKEN: #{req.query_string.to_s}</p>
|
|
21
|
-
<p><a href= #{url}>Request GoogleAuthsub Token</a></p>
|
|
22
|
-
<p><a href=/tokeninfo>Token Information</a></body></html>
|
|
23
|
-
END_RESPONSE
|
|
24
|
-
res['Content-Type'] = "text/html"
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
class SessionAuthServlet < HTTPServlet::AbstractServlet
|
|
30
|
-
def do_GET(req, res)
|
|
31
|
-
@@auth.session = true
|
|
32
|
-
@@auth.receive_token(req.request_uri)
|
|
33
|
-
@@auth.request_session_token if !@@auth.token.nil?
|
|
34
|
-
url = @@auth.request_url.to_s
|
|
35
|
-
res.body = "<html><head></head><body><h2>Google-Authsub Test</h2><p>Session Token</p><p>TOKEN: "+req.query_string.to_s+
|
|
36
|
-
"</p><p><a href="+ url +
|
|
37
|
-
">Request GoogleAuthsub Token</a></p><p><a href=/tokeninfo>Token Information</a></body></html>"
|
|
38
|
-
res['Content-Type'] = "text/html"
|
|
39
|
-
end
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
class SecureAuthServlet < HTTPServlet::AbstractServlet
|
|
43
|
-
def do_GET(req, res)
|
|
44
|
-
@@auth.next_url="http://schedy.com:2000/sessiontest"
|
|
45
|
-
@@auth.session = true
|
|
46
|
-
@@auth.secure = true
|
|
47
|
-
@@auth.receive_token(req.request_uri);
|
|
48
|
-
url = @@auth.request_url.to_s
|
|
49
|
-
res.body = "<html><head></head><body><h2>Google-Authsub Test</h2><p>Secure Token</p><p>TOKEN: "+req.query_string.to_s+
|
|
50
|
-
"</p><p><a href="+ url +
|
|
51
|
-
">Request GoogleAuthsub Token</a></p><p>INFO:<a href=/tokeninfo>Token Information</a>"
|
|
52
|
-
"</body></html>"
|
|
53
|
-
res['Content-Type'] = "text/html"
|
|
54
|
-
end
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
class TokenInfoServlet < HTTPServlet::AbstractServlet
|
|
58
|
-
def do_GET(req, res)
|
|
59
|
-
info = @@auth.token_info
|
|
60
|
-
res.body = "<html><head></head><body><h2>Google-Authsub Test</h2><p>TOKEN INFORMATION<ul>" +
|
|
61
|
-
"<li>Target: "+ info[:target] + "</li>" +
|
|
62
|
-
"<li>Secure: "+ info[:secure].to_s + "</li>" +
|
|
63
|
-
"<li>Scope: "+ info[:scope] + "</li>" +
|
|
64
|
-
"</ul></ul></p></body></html>"
|
|
65
|
-
res['Content-Type'] = "text/html"
|
|
66
|
-
end
|
|
67
|
-
|
|
68
|
-
class CalendarServlet < HTTPServlet::AbstractServlet
|
|
69
|
-
def do_GET(req, res)
|
|
70
|
-
res = @@auth.get("http://www.google.com/calendar/feeds/default/owncalendars/full")
|
|
71
|
-
res['Content-Type'] = "text/html"
|
|
72
|
-
end
|
|
73
|
-
end
|
|
74
|
-
end
|
|
75
|
-
|
|
76
|
-
@@auth = GoogleAuthSub.new(:scope_url=>"http://www.google.com/calendar/feeds");
|
|
77
|
-
#s.mount("/authsub_test",AuthSub1Servlet)
|
|
78
|
-
#s.mount("/authsub_test_2",AuthSub2Servlet)
|
|
79
|
-
|
|
80
|
-
# Assume we have the private key in the file google.key
|
|
81
|
-
GoogleAuthSub.set_private_key("google.key")
|
|
82
|
-
|
|
83
|
-
s.mount("/simpletest", SimpleAuthServlet)
|
|
84
|
-
s.mount("/tokeninfo",TokenInfoServlet)
|
|
85
|
-
s.mount("/sessiontest", SessionAuthServlet)
|
|
86
|
-
s.mount("/securetest", SecureAuthServlet)
|
|
87
|
-
s.mount("/mycalendars", CalendarServlet)
|
|
88
|
-
|
|
89
|
-
trap("INT"){ s.shutdown }
|
|
90
|
-
s.start
|