camping-oauth 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. data/README +3 -0
  2. data/doc/classes/CampingOAuthConsumer.html +145 -0
  3. data/doc/classes/CampingOAuthConsumer.src/M000041.html +19 -0
  4. data/doc/classes/CampingOAuthConsumer/Controllers.html +116 -0
  5. data/doc/classes/CampingOAuthConsumer/Controllers/AccessToken.html +137 -0
  6. data/doc/classes/CampingOAuthConsumer/Controllers/AccessToken.src/M000051.html +32 -0
  7. data/doc/classes/CampingOAuthConsumer/Controllers/AccessTokenAuthorized.html +137 -0
  8. data/doc/classes/CampingOAuthConsumer/Controllers/AccessTokenAuthorized.src/M000050.html +20 -0
  9. data/doc/classes/CampingOAuthConsumer/Controllers/AuthorizeToken.html +137 -0
  10. data/doc/classes/CampingOAuthConsumer/Controllers/AuthorizeToken.src/M000048.html +24 -0
  11. data/doc/classes/CampingOAuthConsumer/Controllers/GetTimeNow.html +137 -0
  12. data/doc/classes/CampingOAuthConsumer/Controllers/GetTimeNow.src/M000049.html +28 -0
  13. data/doc/classes/CampingOAuthConsumer/Controllers/Index.html +137 -0
  14. data/doc/classes/CampingOAuthConsumer/Controllers/Index.src/M000046.html +18 -0
  15. data/doc/classes/CampingOAuthConsumer/Controllers/RequestToken.html +137 -0
  16. data/doc/classes/CampingOAuthConsumer/Controllers/RequestToken.src/M000047.html +24 -0
  17. data/doc/classes/CampingOAuthConsumer/Views.html +176 -0
  18. data/doc/classes/CampingOAuthConsumer/Views.src/M000042.html +42 -0
  19. data/doc/classes/CampingOAuthConsumer/Views.src/M000043.html +41 -0
  20. data/doc/classes/CampingOAuthConsumer/Views.src/M000044.html +18 -0
  21. data/doc/classes/CampingOAuthConsumer/Views.src/M000045.html +19 -0
  22. data/doc/classes/CampingOAuthProvider.html +149 -0
  23. data/doc/classes/CampingOAuthProvider.src/M000052.html +23 -0
  24. data/doc/classes/CampingOAuthProvider/Controllers.html +113 -0
  25. data/doc/classes/CampingOAuthProvider/Controllers/APITimeNow.html +137 -0
  26. data/doc/classes/CampingOAuthProvider/Controllers/APITimeNow.src/M000058.html +23 -0
  27. data/doc/classes/CampingOAuthProvider/Controllers/Index.html +137 -0
  28. data/doc/classes/CampingOAuthProvider/Controllers/Index.src/M000055.html +18 -0
  29. data/doc/classes/CampingOAuthProvider/Controllers/Login.html +152 -0
  30. data/doc/classes/CampingOAuthProvider/Controllers/Login.src/M000056.html +18 -0
  31. data/doc/classes/CampingOAuthProvider/Controllers/Login.src/M000057.html +33 -0
  32. data/doc/classes/CampingOAuthProvider/Helpers.html +112 -0
  33. data/doc/classes/CampingOAuthProvider/Models.html +119 -0
  34. data/doc/classes/CampingOAuthProvider/Models/CreateUserSchema.html +152 -0
  35. data/doc/classes/CampingOAuthProvider/Models/CreateUserSchema.src/M000059.html +26 -0
  36. data/doc/classes/CampingOAuthProvider/Models/CreateUserSchema.src/M000060.html +19 -0
  37. data/doc/classes/CampingOAuthProvider/Models/User.html +111 -0
  38. data/doc/classes/CampingOAuthProvider/Views.html +146 -0
  39. data/doc/classes/CampingOAuthProvider/Views.src/M000053.html +19 -0
  40. data/doc/classes/CampingOAuthProvider/Views.src/M000054.html +27 -0
  41. data/doc/classes/OAuth.html +107 -0
  42. data/doc/classes/OAuth/RequestProxy.html +112 -0
  43. data/doc/classes/OAuth/RequestProxy/Base.html +153 -0
  44. data/doc/classes/OAuth/RequestProxy/Base.src/M000039.html +28 -0
  45. data/doc/classes/OAuth/RequestProxy/Base.src/M000040.html +28 -0
  46. data/doc/classes/OAuth/RequestProxy/RackRequest.html +143 -0
  47. data/doc/classes/OAuth/RequestProxy/RackRequest.src/M000039.html +18 -0
  48. data/doc/classes/OAuthCampingPlugin.html +188 -0
  49. data/doc/classes/OAuthCampingPlugin.src/M000001.html +18 -0
  50. data/doc/classes/OAuthCampingPlugin.src/M000002.html +18 -0
  51. data/doc/classes/OAuthCampingPlugin.src/M000003.html +17 -0
  52. data/doc/classes/OAuthCampingPlugin/Controllers.html +191 -0
  53. data/doc/classes/OAuthCampingPlugin/Controllers.src/M000024.html +18 -0
  54. data/doc/classes/OAuthCampingPlugin/Controllers.src/M000025.html +26 -0
  55. data/doc/classes/OAuthCampingPlugin/Filters.html +161 -0
  56. data/doc/classes/OAuthCampingPlugin/Filters.src/M000034.html +34 -0
  57. data/doc/classes/OAuthCampingPlugin/Helpers.html +283 -0
  58. data/doc/classes/OAuthCampingPlugin/Helpers.src/M000026.html +18 -0
  59. data/doc/classes/OAuthCampingPlugin/Helpers.src/M000027.html +19 -0
  60. data/doc/classes/OAuthCampingPlugin/Helpers.src/M000028.html +20 -0
  61. data/doc/classes/OAuthCampingPlugin/Helpers.src/M000029.html +20 -0
  62. data/doc/classes/OAuthCampingPlugin/Helpers.src/M000030.html +18 -0
  63. data/doc/classes/OAuthCampingPlugin/Helpers.src/M000031.html +18 -0
  64. data/doc/classes/OAuthCampingPlugin/Helpers.src/M000032.html +20 -0
  65. data/doc/classes/OAuthCampingPlugin/Helpers.src/M000033.html +20 -0
  66. data/doc/classes/OAuthCampingPlugin/Models.html +219 -0
  67. data/doc/classes/OAuthCampingPlugin/Models.src/M000035.html +55 -0
  68. data/doc/classes/OAuthCampingPlugin/Models.src/M000036.html +31 -0
  69. data/doc/classes/OAuthCampingPlugin/Models.src/M000037.html +56 -0
  70. data/doc/classes/OAuthCampingPlugin/Models.src/M000038.html +22 -0
  71. data/doc/classes/OAuthCampingPlugin/OAuth.html +407 -0
  72. data/doc/classes/OAuthCampingPlugin/OAuth.src/M000004.html +18 -0
  73. data/doc/classes/OAuthCampingPlugin/OAuth.src/M000005.html +18 -0
  74. data/doc/classes/OAuthCampingPlugin/OAuth.src/M000006.html +20 -0
  75. data/doc/classes/OAuthCampingPlugin/OAuth.src/M000007.html +20 -0
  76. data/doc/classes/OAuthCampingPlugin/OAuth.src/M000008.html +20 -0
  77. data/doc/classes/OAuthCampingPlugin/OAuth.src/M000009.html +24 -0
  78. data/doc/classes/OAuthCampingPlugin/OAuth.src/M000010.html +20 -0
  79. data/doc/classes/OAuthCampingPlugin/OAuth.src/M000011.html +18 -0
  80. data/doc/classes/OAuthCampingPlugin/OAuth.src/M000012.html +19 -0
  81. data/doc/classes/OAuthCampingPlugin/OAuth.src/M000013.html +26 -0
  82. data/doc/classes/OAuthCampingPlugin/OAuth.src/M000014.html +26 -0
  83. data/doc/classes/OAuthCampingPlugin/OAuth.src/M000015.html +33 -0
  84. data/doc/classes/OAuthCampingPlugin/OAuth.src/M000016.html +18 -0
  85. data/doc/classes/OAuthCampingPlugin/OAuth.src/M000017.html +18 -0
  86. data/doc/classes/OAuthCampingPlugin/Views.html +257 -0
  87. data/doc/classes/OAuthCampingPlugin/Views.src/M000018.html +18 -0
  88. data/doc/classes/OAuthCampingPlugin/Views.src/M000019.html +18 -0
  89. data/doc/classes/OAuthCampingPlugin/Views.src/M000020.html +18 -0
  90. data/doc/classes/OAuthCampingPlugin/Views.src/M000021.html +18 -0
  91. data/doc/classes/OAuthCampingPlugin/Views.src/M000022.html +18 -0
  92. data/doc/classes/OAuthCampingPlugin/Views.src/M000023.html +41 -0
  93. data/doc/created.rid +1 -0
  94. data/doc/files/examples/camping-oauth-consumer/camping-oauth-consumer_rb.html +124 -0
  95. data/doc/files/examples/camping-oauth-provider/camping-oauth-provider_rb.html +101 -0
  96. data/doc/files/lib/camping-oauth_rb.html +576 -0
  97. data/doc/fr_class_index.html +56 -0
  98. data/doc/fr_file_index.html +29 -0
  99. data/doc/fr_method_index.html +86 -0
  100. data/doc/index.html +24 -0
  101. data/lib/camping-oauth.rb +1078 -0
  102. 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>current_token (OAuthCampingPlugin::OAuth)</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 466</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">current_token</span>
15
+ <span class="ruby-ivar">@current_token</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_client_application (OAuthCampingPlugin::OAuth)</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 471</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">current_client_application</span>
15
+ <span class="ruby-ivar">@current_client_application</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>client_application_class (OAuthCampingPlugin::OAuth)</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 476</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">client_application_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">&quot;::&quot;</span>).<span class="ruby-identifier">first</span>
16
+ <span class="ruby-identifier">client_application_class_name</span> = <span class="ruby-node">&quot;#{app_module_name}::Models::ClientApplication&quot;</span>
17
+ <span class="ruby-identifier">client_application_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>request_token_class (OAuthCampingPlugin::OAuth)</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 483</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">request_token_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">&quot;::&quot;</span>).<span class="ruby-identifier">first</span>
16
+ <span class="ruby-identifier">request_token_class_name</span> = <span class="ruby-node">&quot;#{app_module_name}::Models::RequestToken&quot;</span>
17
+ <span class="ruby-identifier">request_token_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>access_token_class (OAuthCampingPlugin::OAuth)</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 490</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">access_token_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">&quot;::&quot;</span>).<span class="ruby-identifier">first</span>
16
+ <span class="ruby-identifier">access_token_class_name</span> = <span class="ruby-node">&quot;#{app_module_name}::Models::AccessToken&quot;</span>
17
+ <span class="ruby-identifier">access_token_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,24 @@
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>oauth_header_params (OAuthCampingPlugin::OAuth)</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 498</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">oauth_header_params</span>
15
+ <span class="ruby-identifier">oauth_header</span> = <span class="ruby-ivar">@env</span>[<span class="ruby-value str">'HTTP_AUTHORIZATION'</span>]
16
+ <span class="ruby-comment cmt"># parse the header into a Hash</span>
17
+ <span class="ruby-identifier">oauth_params</span> = <span class="ruby-constant">OAuth</span><span class="ruby-operator">::</span><span class="ruby-constant">Helper</span>.<span class="ruby-identifier">parse_header</span>(<span class="ruby-identifier">oauth_header</span>)
18
+
19
+ <span class="ruby-comment cmt"># remove non-OAuth parameters</span>
20
+ <span class="ruby-identifier">oauth_params</span>.<span class="ruby-identifier">reject!</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">k</span> <span class="ruby-operator">!~</span> <span class="ruby-regexp re">/^oauth_/</span> }
21
+ <span class="ruby-identifier">oauth_params</span>
22
+ <span class="ruby-keyword kw">end</span></pre>
23
+ </body>
24
+ </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>oauthenticate (OAuthCampingPlugin::OAuth)</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 510</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">oauthenticate</span>
15
+ <span class="ruby-identifier">verified</span>=<span class="ruby-identifier">verify_oauth_signature</span>
16
+
17
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">verified</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">current_token</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-identifier">access_token_class</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>oauth? (OAuthCampingPlugin::OAuth)</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 517</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">oauth?</span>
15
+ <span class="ruby-identifier">current_token!</span>=<span class="ruby-keyword kw">nil</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>authorized? (OAuthCampingPlugin::OAuth)</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 522</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">authorized?</span> <span class="ruby-comment cmt"># added by @techarch</span>
15
+ <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">current_token</span>
16
+ <span class="ruby-identifier">current_token</span>.<span class="ruby-identifier">authorized?</span>
17
+ <span class="ruby-keyword kw">end</span></pre>
18
+ </body>
19
+ </html>
@@ -0,0 +1,26 @@
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>oauth_required (OAuthCampingPlugin::OAuth)</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 533</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">oauth_required</span>
15
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">oauthenticate</span>
16
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">authorized?</span>
17
+ <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
18
+ <span class="ruby-keyword kw">else</span>
19
+ <span class="ruby-identifier">invalid_oauth_response</span>
20
+ <span class="ruby-keyword kw">end</span>
21
+ <span class="ruby-keyword kw">else</span>
22
+ <span class="ruby-identifier">invalid_oauth_response</span>
23
+ <span class="ruby-keyword kw">end</span>
24
+ <span class="ruby-keyword kw">end</span></pre>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
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_or_oauth_required (OAuthCampingPlugin::OAuth)</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 553</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">login_or_oauth_required</span>
15
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">oauthenticate</span>
16
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">authorized?</span>
17
+ <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span>
18
+ <span class="ruby-keyword kw">else</span>
19
+ <span class="ruby-identifier">invalid_oauth_response</span>
20
+ <span class="ruby-keyword kw">end</span>
21
+ <span class="ruby-keyword kw">else</span>
22
+ <span class="ruby-identifier">login_required</span>
23
+ <span class="ruby-keyword kw">end</span>
24
+ <span class="ruby-keyword kw">end</span></pre>
25
+ </body>
26
+ </html>
@@ -0,0 +1,33 @@
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_oauth_consumer_signature (OAuthCampingPlugin::OAuth)</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 566</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">verify_oauth_consumer_signature</span>
15
+ <span class="ruby-keyword kw">begin</span>
16
+ <span class="ruby-identifier">valid</span> = <span class="ruby-identifier">client_application_class</span>.<span class="ruby-identifier">verify_request</span>(<span class="ruby-identifier">request</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">request_proxy</span><span class="ruby-operator">|</span>
17
+ <span class="ruby-ivar">@current_client_application</span> = <span class="ruby-identifier">client_application_class</span>.<span class="ruby-identifier">find_by_key</span>(<span class="ruby-identifier">request_proxy</span>.<span class="ruby-identifier">consumer_key</span>)
18
+ <span class="ruby-comment cmt"># Store this temporarily in client_application object for use in request token generation </span>
19
+ <span class="ruby-ivar">@current_client_application</span>.<span class="ruby-identifier">token_callback_url</span>=<span class="ruby-identifier">request_proxy</span>.<span class="ruby-identifier">oauth_callback</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">request_proxy</span>.<span class="ruby-identifier">oauth_callback</span>
20
+
21
+ <span class="ruby-comment cmt"># return the token secret and the consumer secret</span>
22
+ [<span class="ruby-keyword kw">nil</span>, <span class="ruby-ivar">@current_client_application</span>.<span class="ruby-identifier">secret</span>]
23
+ <span class="ruby-keyword kw">end</span>
24
+ <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
25
+ <span class="ruby-identifier">log_debug</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">message</span>
26
+ <span class="ruby-identifier">log_debug</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">backtrace</span>.<span class="ruby-identifier">inspect</span>
27
+ <span class="ruby-identifier">valid</span>=<span class="ruby-keyword kw">false</span>
28
+ <span class="ruby-keyword kw">end</span>
29
+
30
+ <span class="ruby-identifier">invalid_oauth_response</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">valid</span>
31
+ <span class="ruby-keyword kw">end</span></pre>
32
+ </body>
33
+ </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>verify_oauth_request_token (OAuthCampingPlugin::OAuth)</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 586</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">verify_oauth_request_token</span>
15
+ <span class="ruby-identifier">verify_oauth_signature</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">current_token</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-identifier">request_token_class</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>invalid_oauth_response (OAuthCampingPlugin::OAuth)</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 591</span>
14
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">invalid_oauth_response</span>(<span class="ruby-identifier">code</span>=<span class="ruby-value">401</span>,<span class="ruby-identifier">message</span>=<span class="ruby-value str">&quot;Invalid OAuth Request&quot;</span>)
15
+ <span class="ruby-identifier">r</span>(<span class="ruby-identifier">code</span>, {}, <span class="ruby-identifier">message</span>)
16
+ <span class="ruby-keyword kw">end</span></pre>
17
+ </body>
18
+ </html>
@@ -0,0 +1,257 @@
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::Views</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::Views</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="Views.html">Views</a> module for the <a
78
+ href="OAuth.html">OAuth</a> Camping Plugin. The module will be plugged in
79
+ to the main app views module using:
80
+ </p>
81
+ <pre>
82
+ - extend to add class methods to the app views module
83
+ - include_oauth_views to dynamically plugin the common OAuth views (e.g. authorize_view)
84
+ </pre>
85
+ <p>
86
+ Example:
87
+ </p>
88
+ <pre>
89
+ module CampingOAuthProvider::Views
90
+ extend OAuthCampingPlugin::Views
91
+
92
+ # ...
93
+
94
+ include_oauth_views
95
+ end
96
+ </pre>
97
+
98
+ </div>
99
+
100
+
101
+ </div>
102
+
103
+ <div id="method-list">
104
+ <h3 class="section-bar">Methods</h3>
105
+
106
+ <div class="name-list">
107
+ <a href="#M000021">authorize_view</a>&nbsp;&nbsp;
108
+ <a href="#M000018">common_oauth_views</a>&nbsp;&nbsp;
109
+ <a href="#M000023">include_oauth_views</a>&nbsp;&nbsp;
110
+ <a href="#M000019">register_view</a>&nbsp;&nbsp;
111
+ <a href="#M000020">registration_view</a>&nbsp;&nbsp;
112
+ <a href="#M000022">revoke_view</a>&nbsp;&nbsp;
113
+ </div>
114
+ </div>
115
+
116
+ </div>
117
+
118
+
119
+ <!-- if includes -->
120
+
121
+ <div id="section">
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130
+ <!-- if method_list -->
131
+ <div id="methods">
132
+ <h3 class="section-bar">Public Class methods</h3>
133
+
134
+ <div id="method-M000021" class="method-detail">
135
+ <a name="M000021"></a>
136
+
137
+ <div class="method-heading">
138
+ <a href="Views.src/M000021.html" target="Code" class="method-signature"
139
+ onclick="popupCode('Views.src/M000021.html');return false;">
140
+ <span class="method-name">authorize_view</span><span class="method-args">()</span>
141
+ </a>
142
+ </div>
143
+
144
+ <div class="method-description">
145
+ <p>
146
+ Returns the source code for the <a
147
+ href="Views.html#M000021">authorize_view</a>
148
+ </p>
149
+ </div>
150
+ </div>
151
+
152
+ <div id="method-M000018" class="method-detail">
153
+ <a name="M000018"></a>
154
+
155
+ <div class="method-heading">
156
+ <a href="Views.src/M000018.html" target="Code" class="method-signature"
157
+ onclick="popupCode('Views.src/M000018.html');return false;">
158
+ <span class="method-name">common_oauth_views</span><span class="method-args">()</span>
159
+ </a>
160
+ </div>
161
+
162
+ <div class="method-description">
163
+ <p>
164
+ Returns the source code for all common <a href="OAuth.html">OAuth</a> views
165
+ such as error views (e.g. authorize_failure)
166
+ </p>
167
+ </div>
168
+ </div>
169
+
170
+ <div id="method-M000019" class="method-detail">
171
+ <a name="M000019"></a>
172
+
173
+ <div class="method-heading">
174
+ <a href="Views.src/M000019.html" target="Code" class="method-signature"
175
+ onclick="popupCode('Views.src/M000019.html');return false;">
176
+ <span class="method-name">register_view</span><span class="method-args">()</span>
177
+ </a>
178
+ </div>
179
+
180
+ <div class="method-description">
181
+ <p>
182
+ Returns the source code for the <a
183
+ href="Views.html#M000019">register_view</a>
184
+ </p>
185
+ </div>
186
+ </div>
187
+
188
+ <div id="method-M000020" class="method-detail">
189
+ <a name="M000020"></a>
190
+
191
+ <div class="method-heading">
192
+ <a href="Views.src/M000020.html" target="Code" class="method-signature"
193
+ onclick="popupCode('Views.src/M000020.html');return false;">
194
+ <span class="method-name">registration_view</span><span class="method-args">()</span>
195
+ </a>
196
+ </div>
197
+
198
+ <div class="method-description">
199
+ <p>
200
+ Returns the source code for the <a
201
+ href="Views.html#M000020">registration_view</a>
202
+ </p>
203
+ </div>
204
+ </div>
205
+
206
+ <div id="method-M000022" class="method-detail">
207
+ <a name="M000022"></a>
208
+
209
+ <div class="method-heading">
210
+ <a href="Views.src/M000022.html" target="Code" class="method-signature"
211
+ onclick="popupCode('Views.src/M000022.html');return false;">
212
+ <span class="method-name">revoke_view</span><span class="method-args">()</span>
213
+ </a>
214
+ </div>
215
+
216
+ <div class="method-description">
217
+ <p>
218
+ Returns the source code for the <a
219
+ href="Views.html#M000022">revoke_view</a>
220
+ </p>
221
+ </div>
222
+ </div>
223
+
224
+ <h3 class="section-bar">Public Instance methods</h3>
225
+
226
+ <div id="method-M000023" class="method-detail">
227
+ <a name="M000023"></a>
228
+
229
+ <div class="method-heading">
230
+ <a href="Views.src/M000023.html" target="Code" class="method-signature"
231
+ onclick="popupCode('Views.src/M000023.html');return false;">
232
+ <span class="method-name">include_oauth_views</span><span class="method-args">()</span>
233
+ </a>
234
+ </div>
235
+
236
+ <div class="method-description">
237
+ <p>
238
+ Includes all common <a href="OAuth.html">OAuth</a> views inside the views
239
+ module using module_eval (this is why the call must be the last statement
240
+ in the views module)
241
+ </p>
242
+ </div>
243
+ </div>
244
+
245
+
246
+ </div>
247
+
248
+
249
+ </div>
250
+
251
+
252
+ <div id="validator-badges">
253
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
254
+ </div>
255
+
256
+ </body>
257
+ </html>