camping-oauth 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README +3 -0
- data/doc/classes/CampingOAuthConsumer.html +145 -0
- data/doc/classes/CampingOAuthConsumer.src/M000041.html +19 -0
- data/doc/classes/CampingOAuthConsumer/Controllers.html +116 -0
- data/doc/classes/CampingOAuthConsumer/Controllers/AccessToken.html +137 -0
- data/doc/classes/CampingOAuthConsumer/Controllers/AccessToken.src/M000051.html +32 -0
- data/doc/classes/CampingOAuthConsumer/Controllers/AccessTokenAuthorized.html +137 -0
- data/doc/classes/CampingOAuthConsumer/Controllers/AccessTokenAuthorized.src/M000050.html +20 -0
- data/doc/classes/CampingOAuthConsumer/Controllers/AuthorizeToken.html +137 -0
- data/doc/classes/CampingOAuthConsumer/Controllers/AuthorizeToken.src/M000048.html +24 -0
- data/doc/classes/CampingOAuthConsumer/Controllers/GetTimeNow.html +137 -0
- data/doc/classes/CampingOAuthConsumer/Controllers/GetTimeNow.src/M000049.html +28 -0
- data/doc/classes/CampingOAuthConsumer/Controllers/Index.html +137 -0
- data/doc/classes/CampingOAuthConsumer/Controllers/Index.src/M000046.html +18 -0
- data/doc/classes/CampingOAuthConsumer/Controllers/RequestToken.html +137 -0
- data/doc/classes/CampingOAuthConsumer/Controllers/RequestToken.src/M000047.html +24 -0
- data/doc/classes/CampingOAuthConsumer/Views.html +176 -0
- data/doc/classes/CampingOAuthConsumer/Views.src/M000042.html +42 -0
- data/doc/classes/CampingOAuthConsumer/Views.src/M000043.html +41 -0
- data/doc/classes/CampingOAuthConsumer/Views.src/M000044.html +18 -0
- data/doc/classes/CampingOAuthConsumer/Views.src/M000045.html +19 -0
- data/doc/classes/CampingOAuthProvider.html +149 -0
- data/doc/classes/CampingOAuthProvider.src/M000052.html +23 -0
- data/doc/classes/CampingOAuthProvider/Controllers.html +113 -0
- data/doc/classes/CampingOAuthProvider/Controllers/APITimeNow.html +137 -0
- data/doc/classes/CampingOAuthProvider/Controllers/APITimeNow.src/M000058.html +23 -0
- data/doc/classes/CampingOAuthProvider/Controllers/Index.html +137 -0
- data/doc/classes/CampingOAuthProvider/Controllers/Index.src/M000055.html +18 -0
- data/doc/classes/CampingOAuthProvider/Controllers/Login.html +152 -0
- data/doc/classes/CampingOAuthProvider/Controllers/Login.src/M000056.html +18 -0
- data/doc/classes/CampingOAuthProvider/Controllers/Login.src/M000057.html +33 -0
- data/doc/classes/CampingOAuthProvider/Helpers.html +112 -0
- data/doc/classes/CampingOAuthProvider/Models.html +119 -0
- data/doc/classes/CampingOAuthProvider/Models/CreateUserSchema.html +152 -0
- data/doc/classes/CampingOAuthProvider/Models/CreateUserSchema.src/M000059.html +26 -0
- data/doc/classes/CampingOAuthProvider/Models/CreateUserSchema.src/M000060.html +19 -0
- data/doc/classes/CampingOAuthProvider/Models/User.html +111 -0
- data/doc/classes/CampingOAuthProvider/Views.html +146 -0
- data/doc/classes/CampingOAuthProvider/Views.src/M000053.html +19 -0
- data/doc/classes/CampingOAuthProvider/Views.src/M000054.html +27 -0
- data/doc/classes/OAuth.html +107 -0
- data/doc/classes/OAuth/RequestProxy.html +112 -0
- data/doc/classes/OAuth/RequestProxy/Base.html +153 -0
- data/doc/classes/OAuth/RequestProxy/Base.src/M000039.html +28 -0
- data/doc/classes/OAuth/RequestProxy/Base.src/M000040.html +28 -0
- data/doc/classes/OAuth/RequestProxy/RackRequest.html +143 -0
- data/doc/classes/OAuth/RequestProxy/RackRequest.src/M000039.html +18 -0
- data/doc/classes/OAuthCampingPlugin.html +188 -0
- data/doc/classes/OAuthCampingPlugin.src/M000001.html +18 -0
- data/doc/classes/OAuthCampingPlugin.src/M000002.html +18 -0
- data/doc/classes/OAuthCampingPlugin.src/M000003.html +17 -0
- data/doc/classes/OAuthCampingPlugin/Controllers.html +191 -0
- data/doc/classes/OAuthCampingPlugin/Controllers.src/M000024.html +18 -0
- data/doc/classes/OAuthCampingPlugin/Controllers.src/M000025.html +26 -0
- data/doc/classes/OAuthCampingPlugin/Filters.html +161 -0
- data/doc/classes/OAuthCampingPlugin/Filters.src/M000034.html +34 -0
- data/doc/classes/OAuthCampingPlugin/Helpers.html +283 -0
- data/doc/classes/OAuthCampingPlugin/Helpers.src/M000026.html +18 -0
- data/doc/classes/OAuthCampingPlugin/Helpers.src/M000027.html +19 -0
- data/doc/classes/OAuthCampingPlugin/Helpers.src/M000028.html +20 -0
- data/doc/classes/OAuthCampingPlugin/Helpers.src/M000029.html +20 -0
- data/doc/classes/OAuthCampingPlugin/Helpers.src/M000030.html +18 -0
- data/doc/classes/OAuthCampingPlugin/Helpers.src/M000031.html +18 -0
- data/doc/classes/OAuthCampingPlugin/Helpers.src/M000032.html +20 -0
- data/doc/classes/OAuthCampingPlugin/Helpers.src/M000033.html +20 -0
- data/doc/classes/OAuthCampingPlugin/Models.html +219 -0
- data/doc/classes/OAuthCampingPlugin/Models.src/M000035.html +55 -0
- data/doc/classes/OAuthCampingPlugin/Models.src/M000036.html +31 -0
- data/doc/classes/OAuthCampingPlugin/Models.src/M000037.html +56 -0
- data/doc/classes/OAuthCampingPlugin/Models.src/M000038.html +22 -0
- data/doc/classes/OAuthCampingPlugin/OAuth.html +407 -0
- data/doc/classes/OAuthCampingPlugin/OAuth.src/M000004.html +18 -0
- data/doc/classes/OAuthCampingPlugin/OAuth.src/M000005.html +18 -0
- data/doc/classes/OAuthCampingPlugin/OAuth.src/M000006.html +20 -0
- data/doc/classes/OAuthCampingPlugin/OAuth.src/M000007.html +20 -0
- data/doc/classes/OAuthCampingPlugin/OAuth.src/M000008.html +20 -0
- data/doc/classes/OAuthCampingPlugin/OAuth.src/M000009.html +24 -0
- data/doc/classes/OAuthCampingPlugin/OAuth.src/M000010.html +20 -0
- data/doc/classes/OAuthCampingPlugin/OAuth.src/M000011.html +18 -0
- data/doc/classes/OAuthCampingPlugin/OAuth.src/M000012.html +19 -0
- data/doc/classes/OAuthCampingPlugin/OAuth.src/M000013.html +26 -0
- data/doc/classes/OAuthCampingPlugin/OAuth.src/M000014.html +26 -0
- data/doc/classes/OAuthCampingPlugin/OAuth.src/M000015.html +33 -0
- data/doc/classes/OAuthCampingPlugin/OAuth.src/M000016.html +18 -0
- data/doc/classes/OAuthCampingPlugin/OAuth.src/M000017.html +18 -0
- data/doc/classes/OAuthCampingPlugin/Views.html +257 -0
- data/doc/classes/OAuthCampingPlugin/Views.src/M000018.html +18 -0
- data/doc/classes/OAuthCampingPlugin/Views.src/M000019.html +18 -0
- data/doc/classes/OAuthCampingPlugin/Views.src/M000020.html +18 -0
- data/doc/classes/OAuthCampingPlugin/Views.src/M000021.html +18 -0
- data/doc/classes/OAuthCampingPlugin/Views.src/M000022.html +18 -0
- data/doc/classes/OAuthCampingPlugin/Views.src/M000023.html +41 -0
- data/doc/created.rid +1 -0
- data/doc/files/examples/camping-oauth-consumer/camping-oauth-consumer_rb.html +124 -0
- data/doc/files/examples/camping-oauth-provider/camping-oauth-provider_rb.html +101 -0
- data/doc/files/lib/camping-oauth_rb.html +576 -0
- data/doc/fr_class_index.html +56 -0
- data/doc/fr_file_index.html +29 -0
- data/doc/fr_method_index.html +86 -0
- data/doc/index.html +24 -0
- data/lib/camping-oauth.rb +1078 -0
- metadata +172 -0
@@ -0,0 +1,18 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>log_debug (OAuthCampingPlugin::Helpers)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/camping-oauth.rb, line 362</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">log_debug</span>(<span class="ruby-identifier">msg</span>)
|
15
|
+
<span class="ruby-constant">OAuthCampingPlugin</span>.<span class="ruby-identifier">logger</span>.<span class="ruby-identifier">debug</span>(<span class="ruby-identifier">msg</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-constant">OAuthCampingPlugin</span>.<span class="ruby-identifier">logger</span> <span class="ruby-operator">&&</span> <span class="ruby-constant">OAuthCampingPlugin</span>.<span class="ruby-identifier">logger</span>.<span class="ruby-identifier">debug?</span>
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>app_module (OAuthCampingPlugin::Helpers)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/camping-oauth.rb, line 367</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">app_module</span>
|
15
|
+
<span class="ruby-identifier">app_module_name</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">"::"</span>).<span class="ruby-identifier">first</span>
|
16
|
+
<span class="ruby-identifier">app_module</span> = <span class="ruby-identifier">app_module_name</span>.<span class="ruby-identifier">constantize</span>
|
17
|
+
<span class="ruby-keyword kw">end</span></pre>
|
18
|
+
</body>
|
19
|
+
</html>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>user_class (OAuthCampingPlugin::Helpers)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/camping-oauth.rb, line 373</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">user_class</span>
|
15
|
+
<span class="ruby-identifier">app_module_name</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">"::"</span>).<span class="ruby-identifier">first</span>
|
16
|
+
<span class="ruby-identifier">user_class_name</span> = <span class="ruby-node">"#{app_module_name}::Models::User"</span>
|
17
|
+
<span class="ruby-identifier">user_class_name</span>.<span class="ruby-identifier">constantize</span>
|
18
|
+
<span class="ruby-keyword kw">end</span></pre>
|
19
|
+
</body>
|
20
|
+
</html>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>nonce_class (OAuthCampingPlugin::Helpers)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/camping-oauth.rb, line 380</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">nonce_class</span>
|
15
|
+
<span class="ruby-identifier">app_module_name</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">"::"</span>).<span class="ruby-identifier">first</span>
|
16
|
+
<span class="ruby-identifier">nonce_class_name</span> = <span class="ruby-node">"#{app_module_name}::Models::OauthNonce"</span>
|
17
|
+
<span class="ruby-identifier">nonce_class_name</span>.<span class="ruby-identifier">constantize</span>
|
18
|
+
<span class="ruby-keyword kw">end</span></pre>
|
19
|
+
</body>
|
20
|
+
</html>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>set_user (OAuthCampingPlugin::Helpers)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/camping-oauth.rb, line 387</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">set_user</span>
|
15
|
+
<span class="ruby-ivar">@user</span> = <span class="ruby-identifier">user_class</span>.<span class="ruby-identifier">find</span>(<span class="ruby-ivar">@state</span>.<span class="ruby-identifier">user_id</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@user</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@state</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@state</span>.<span class="ruby-identifier">user_id</span>.<span class="ruby-identifier">nil?</span>
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>current_user (OAuthCampingPlugin::Helpers)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/camping-oauth.rb, line 392</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">current_user</span>
|
15
|
+
<span class="ruby-ivar">@user</span>
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>login_required (OAuthCampingPlugin::Helpers)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/camping-oauth.rb, line 401</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">login_required</span>
|
15
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@user</span>
|
16
|
+
<span class="ruby-identifier">access_denied</span>
|
17
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
|
18
|
+
<span class="ruby-keyword kw">end</span></pre>
|
19
|
+
</body>
|
20
|
+
</html>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>access_denied (OAuthCampingPlugin::Helpers)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/camping-oauth.rb, line 408</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">access_denied</span>
|
15
|
+
<span class="ruby-ivar">@state</span>.<span class="ruby-identifier">return_to</span> = <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">url</span>
|
16
|
+
<span class="ruby-ivar">@info</span> = <span class="ruby-value str">'Oops. You need to login before you can view that page.'</span>
|
17
|
+
<span class="ruby-identifier">redirect</span>(<span class="ruby-value str">'/login'</span>)
|
18
|
+
<span class="ruby-keyword kw">end</span></pre>
|
19
|
+
</body>
|
20
|
+
</html>
|
@@ -0,0 +1,219 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Module: OAuthCampingPlugin::Models</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Module</strong></td>
|
53
|
+
<td class="class-name-in-header">OAuthCampingPlugin::Models</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/lib/camping-oauth_rb.html">
|
59
|
+
lib/camping-oauth.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
</table>
|
66
|
+
</div>
|
67
|
+
<!-- banner header -->
|
68
|
+
|
69
|
+
<div id="bodyContent">
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
<div id="contextContent">
|
74
|
+
|
75
|
+
<div id="description">
|
76
|
+
<p>
|
77
|
+
<a href="Models.html">Models</a> module for the <a
|
78
|
+
href="OAuth.html">OAuth</a> Camping Plugin. The module will be plugged in
|
79
|
+
to the main app models module. Example:
|
80
|
+
</p>
|
81
|
+
<pre>
|
82
|
+
module CampingOAuthProvider::Models
|
83
|
+
include OAuthCampingPlugin::Models
|
84
|
+
|
85
|
+
class User < Base;
|
86
|
+
has_many :client_applications
|
87
|
+
has_many :tokens, :class_name=>"OauthToken",:order=>"authorized_at desc",:include=>[:client_application]
|
88
|
+
|
89
|
+
end
|
90
|
+
# ...
|
91
|
+
end
|
92
|
+
</pre>
|
93
|
+
<p>
|
94
|
+
This module requires the oauth-plugin gem to be installed as it will load
|
95
|
+
the following models
|
96
|
+
</p>
|
97
|
+
<pre>
|
98
|
+
- ClientApplication
|
99
|
+
- OauthToken
|
100
|
+
- OathNonce
|
101
|
+
- RequestToken
|
102
|
+
- AccessToken
|
103
|
+
</pre>
|
104
|
+
|
105
|
+
</div>
|
106
|
+
|
107
|
+
|
108
|
+
</div>
|
109
|
+
|
110
|
+
<div id="method-list">
|
111
|
+
<h3 class="section-bar">Methods</h3>
|
112
|
+
|
113
|
+
<div class="name-list">
|
114
|
+
<a href="#M000038">down</a>
|
115
|
+
<a href="#M000035">included</a>
|
116
|
+
<a href="#M000037">up</a>
|
117
|
+
<a href="#M000036">verify_request</a>
|
118
|
+
</div>
|
119
|
+
</div>
|
120
|
+
|
121
|
+
</div>
|
122
|
+
|
123
|
+
|
124
|
+
<!-- if includes -->
|
125
|
+
|
126
|
+
<div id="section">
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
<!-- if method_list -->
|
136
|
+
<div id="methods">
|
137
|
+
<h3 class="section-bar">Public Class methods</h3>
|
138
|
+
|
139
|
+
<div id="method-M000038" class="method-detail">
|
140
|
+
<a name="M000038"></a>
|
141
|
+
|
142
|
+
<div class="method-heading">
|
143
|
+
<a href="Models.src/M000038.html" target="Code" class="method-signature"
|
144
|
+
onclick="popupCode('Models.src/M000038.html');return false;">
|
145
|
+
<span class="method-name">down</span><span class="method-args">()</span>
|
146
|
+
</a>
|
147
|
+
</div>
|
148
|
+
|
149
|
+
<div class="method-description">
|
150
|
+
<p>
|
151
|
+
Down-migrates the schema definition for the 5 <a
|
152
|
+
href="OAuth.html">OAuth</a> models
|
153
|
+
</p>
|
154
|
+
</div>
|
155
|
+
</div>
|
156
|
+
|
157
|
+
<div id="method-M000035" class="method-detail">
|
158
|
+
<a name="M000035"></a>
|
159
|
+
|
160
|
+
<div class="method-heading">
|
161
|
+
<a href="Models.src/M000035.html" target="Code" class="method-signature"
|
162
|
+
onclick="popupCode('Models.src/M000035.html');return false;">
|
163
|
+
<span class="method-name">included</span><span class="method-args">(mod)</span>
|
164
|
+
</a>
|
165
|
+
</div>
|
166
|
+
|
167
|
+
<div class="method-description">
|
168
|
+
<p>
|
169
|
+
Loads the 5 standard <a href="OAuth.html">OAuth</a> models defined in the
|
170
|
+
oauth-plugin gem
|
171
|
+
</p>
|
172
|
+
</div>
|
173
|
+
</div>
|
174
|
+
|
175
|
+
<div id="method-M000037" class="method-detail">
|
176
|
+
<a name="M000037"></a>
|
177
|
+
|
178
|
+
<div class="method-heading">
|
179
|
+
<a href="Models.src/M000037.html" target="Code" class="method-signature"
|
180
|
+
onclick="popupCode('Models.src/M000037.html');return false;">
|
181
|
+
<span class="method-name">up</span><span class="method-args">()</span>
|
182
|
+
</a>
|
183
|
+
</div>
|
184
|
+
|
185
|
+
<div class="method-description">
|
186
|
+
<p>
|
187
|
+
Up-migrates the schema definition for the 5 <a href="OAuth.html">OAuth</a>
|
188
|
+
models
|
189
|
+
</p>
|
190
|
+
</div>
|
191
|
+
</div>
|
192
|
+
|
193
|
+
<div id="method-M000036" class="method-detail">
|
194
|
+
<a name="M000036"></a>
|
195
|
+
|
196
|
+
<div class="method-heading">
|
197
|
+
<a href="Models.src/M000036.html" target="Code" class="method-signature"
|
198
|
+
onclick="popupCode('Models.src/M000036.html');return false;">
|
199
|
+
<span class="method-name">verify_request</span><span class="method-args">(request, options = {}, &block)</span>
|
200
|
+
</a>
|
201
|
+
</div>
|
202
|
+
|
203
|
+
<div class="method-description">
|
204
|
+
</div>
|
205
|
+
</div>
|
206
|
+
|
207
|
+
|
208
|
+
</div>
|
209
|
+
|
210
|
+
|
211
|
+
</div>
|
212
|
+
|
213
|
+
|
214
|
+
<div id="validator-badges">
|
215
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
216
|
+
</div>
|
217
|
+
|
218
|
+
</body>
|
219
|
+
</html>
|
@@ -0,0 +1,55 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>included (OAuthCampingPlugin::Models)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/camping-oauth.rb, line 655</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">included</span>(<span class="ruby-identifier">mod</span>)
|
15
|
+
<span class="ruby-identifier">oauth_plugin_gem</span> = <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-identifier">loaded_specs</span>[<span class="ruby-value str">'oauth-plugin'</span>]
|
16
|
+
<span class="ruby-identifier">oauth_plugin_path</span> = <span class="ruby-identifier">oauth_plugin_gem</span>.<span class="ruby-identifier">full_gem_path</span>
|
17
|
+
<span class="ruby-identifier">provider_template_path</span> = <span class="ruby-identifier">oauth_plugin_path</span> <span class="ruby-operator">+</span> <span class="ruby-value str">'/generators/oauth_provider/templates'</span>
|
18
|
+
|
19
|
+
<span class="ruby-node">%w(
|
20
|
+
client_application.rb
|
21
|
+
oauth_token.rb
|
22
|
+
oauth_nonce.rb
|
23
|
+
request_token.rb
|
24
|
+
access_token.rb
|
25
|
+
)</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">lib</span><span class="ruby-operator">|</span> <span class="ruby-identifier">mod</span>.<span class="ruby-identifier">module_eval</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-node">"#{provider_template_path}/#{lib}"</span>)) }
|
26
|
+
|
27
|
+
<span class="ruby-comment cmt"># @techarch : Reset the table names back to pre-Camping</span>
|
28
|
+
<span class="ruby-identifier">mod</span>.<span class="ruby-identifier">module_eval</span> <span class="ruby-keyword kw">do</span>
|
29
|
+
<span class="ruby-identifier">mod</span><span class="ruby-operator">::</span><span class="ruby-constant">ClientApplication</span>.<span class="ruby-identifier">class_eval</span> { <span class="ruby-identifier">set_table_name</span> <span class="ruby-value str">"client_applications"</span> }
|
30
|
+
|
31
|
+
<span class="ruby-identifier">mod</span><span class="ruby-operator">::</span><span class="ruby-constant">ClientApplication</span>.<span class="ruby-identifier">class_eval</span> <span class="ruby-keyword kw">do</span>
|
32
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">verify_request</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">options</span> = {}, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
33
|
+
<span class="ruby-keyword kw">begin</span>
|
34
|
+
<span class="ruby-identifier">signature</span> = <span class="ruby-constant">OAuth</span><span class="ruby-operator">::</span><span class="ruby-constant">Signature</span>.<span class="ruby-identifier">build</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">options</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
35
|
+
|
36
|
+
<span class="ruby-identifier">app_module_name</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">"::"</span>).<span class="ruby-identifier">first</span>
|
37
|
+
<span class="ruby-identifier">nonce_class_name</span> = <span class="ruby-node">"#{app_module_name}::Models::OauthNonce"</span>
|
38
|
+
<span class="ruby-identifier">nonce_class</span> = <span class="ruby-identifier">nonce_class_name</span>.<span class="ruby-identifier">constantize</span>
|
39
|
+
|
40
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">nonce_class</span>.<span class="ruby-identifier">remember</span>(<span class="ruby-identifier">signature</span>.<span class="ruby-identifier">request</span>.<span class="ruby-identifier">nonce</span>, <span class="ruby-identifier">signature</span>.<span class="ruby-identifier">request</span>.<span class="ruby-identifier">timestamp</span>)
|
41
|
+
|
42
|
+
<span class="ruby-identifier">value</span> = <span class="ruby-identifier">signature</span>.<span class="ruby-identifier">verify</span>
|
43
|
+
<span class="ruby-identifier">value</span>
|
44
|
+
<span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">OAuth</span><span class="ruby-operator">::</span><span class="ruby-constant">Signature</span><span class="ruby-operator">::</span><span class="ruby-constant">UnknownSignatureMethod</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span>
|
45
|
+
<span class="ruby-keyword kw">false</span>
|
46
|
+
<span class="ruby-keyword kw">end</span>
|
47
|
+
<span class="ruby-keyword kw">end</span>
|
48
|
+
<span class="ruby-keyword kw">end</span>
|
49
|
+
|
50
|
+
<span class="ruby-identifier">mod</span><span class="ruby-operator">::</span><span class="ruby-constant">OauthToken</span>.<span class="ruby-identifier">class_eval</span> { <span class="ruby-identifier">set_table_name</span> <span class="ruby-value str">"oauth_tokens"</span> }
|
51
|
+
<span class="ruby-identifier">mod</span><span class="ruby-operator">::</span><span class="ruby-constant">OauthNonce</span>.<span class="ruby-identifier">class_eval</span> { <span class="ruby-identifier">set_table_name</span> <span class="ruby-value str">"oauth_nonces"</span> }
|
52
|
+
<span class="ruby-keyword kw">end</span>
|
53
|
+
<span class="ruby-keyword kw">end</span></pre>
|
54
|
+
</body>
|
55
|
+
</html>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>verify_request (OAuthCampingPlugin::Models)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/camping-oauth.rb, line 673</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">verify_request</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">options</span> = {}, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
15
|
+
<span class="ruby-keyword kw">begin</span>
|
16
|
+
<span class="ruby-identifier">signature</span> = <span class="ruby-constant">OAuth</span><span class="ruby-operator">::</span><span class="ruby-constant">Signature</span>.<span class="ruby-identifier">build</span>(<span class="ruby-identifier">request</span>, <span class="ruby-identifier">options</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
17
|
+
|
18
|
+
<span class="ruby-identifier">app_module_name</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">"::"</span>).<span class="ruby-identifier">first</span>
|
19
|
+
<span class="ruby-identifier">nonce_class_name</span> = <span class="ruby-node">"#{app_module_name}::Models::OauthNonce"</span>
|
20
|
+
<span class="ruby-identifier">nonce_class</span> = <span class="ruby-identifier">nonce_class_name</span>.<span class="ruby-identifier">constantize</span>
|
21
|
+
|
22
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">nonce_class</span>.<span class="ruby-identifier">remember</span>(<span class="ruby-identifier">signature</span>.<span class="ruby-identifier">request</span>.<span class="ruby-identifier">nonce</span>, <span class="ruby-identifier">signature</span>.<span class="ruby-identifier">request</span>.<span class="ruby-identifier">timestamp</span>)
|
23
|
+
|
24
|
+
<span class="ruby-identifier">value</span> = <span class="ruby-identifier">signature</span>.<span class="ruby-identifier">verify</span>
|
25
|
+
<span class="ruby-identifier">value</span>
|
26
|
+
<span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">OAuth</span><span class="ruby-operator">::</span><span class="ruby-constant">Signature</span><span class="ruby-operator">::</span><span class="ruby-constant">UnknownSignatureMethod</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span>
|
27
|
+
<span class="ruby-keyword kw">false</span>
|
28
|
+
<span class="ruby-keyword kw">end</span>
|
29
|
+
<span class="ruby-keyword kw">end</span></pre>
|
30
|
+
</body>
|
31
|
+
</html>
|