PageRenderTime 50ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/site/api-docs/Sinatra/LazyAuth.html

https://github.com/bbrowning/deltacloud
HTML | 227 lines | 133 code | 94 blank | 0 comment | 0 complexity | fa6d26cb0bf8ea2baf31c3ef0ed38878 MD5 | raw file
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  4. <head>
  5. <meta name="Content-Type" content="text/html; charset=utf8" />
  6. <title>Module: Sinatra::LazyAuth</title>
  7. <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
  8. <link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />
  9. <script type="text/javascript" charset="utf-8">
  10. relpath = '..';
  11. if (relpath != '') relpath += '/';
  12. </script>
  13. <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
  14. <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
  15. </head>
  16. <body>
  17. <script type="text/javascript" charset="utf-8">
  18. if (window.top.frames.main) document.body.className = 'frames';
  19. </script>
  20. <div id="header">
  21. <div id="menu">
  22. <a href="../_index.html">Index (L)</a> &raquo;
  23. <span class='title'><span class='object_link'><a href="../Sinatra.html" title="Sinatra (module)">Sinatra</a></span></span>
  24. &raquo;
  25. <span class="title">LazyAuth</span>
  26. <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
  27. </div>
  28. <div id="search">
  29. <a id="class_list_link" href="#">Class List</a>
  30. <a id="method_list_link" href="#">Method List</a>
  31. <a id ="file_list_link" href="#">File List</a>
  32. </div>
  33. <div class="clear"></div>
  34. </div>
  35. <iframe id="search_frame"></iframe>
  36. <div id="content"><h1>Module: Sinatra::LazyAuth
  37. </h1>
  38. <dl class="box">
  39. <dt class="r1 last">Defined in:</dt>
  40. <dd class="r1 last">lib/sinatra/lazy_auth.rb</dd>
  41. </dl>
  42. <div class="clear"></div>
  43. <h2>Defined Under Namespace</h2>
  44. <p class="children">
  45. <strong class="classes">Classes:</strong> <span class='object_link'><a href="LazyAuth/LazyCredentials.html" title="Sinatra::LazyAuth::LazyCredentials (class)">LazyCredentials</a></span>
  46. </p>
  47. <h2>
  48. Instance Method Summary
  49. <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
  50. </h2>
  51. <ul class="summary">
  52. <li class="public ">
  53. <span class="summary_signature">
  54. <a href="#authorize%21-instance_method" title="#authorize! (instance method)">- (Object) <strong>authorize!</strong> </a>
  55. </span>
  56. <span class="summary_desc"><div class='inline'></div></span>
  57. </li>
  58. <li class="public ">
  59. <span class="summary_signature">
  60. <a href="#credentials-instance_method" title="#credentials (instance method)">- (Object) <strong>credentials</strong> </a>
  61. </span>
  62. <span class="summary_desc"><div class='inline'><p>
  63. Request the current user&#8217;s credentials.
  64. </p>
  65. </div></span>
  66. </li>
  67. </ul>
  68. <div id="instance_method_details" class="method_details_list">
  69. <h2>Instance Method Details</h2>
  70. <div class="method_details first">
  71. <p class="signature first" id="authorize!-instance_method">
  72. - (<tt>Object</tt>) <strong>authorize!</strong>
  73. </p><table class="source_code">
  74. <tr>
  75. <td>
  76. <pre class="lines">
  77. 42
  78. 43
  79. 44
  80. 45
  81. 46</pre>
  82. </td>
  83. <td>
  84. <pre class="code"><span class="info file"># File 'lib/sinatra/lazy_auth.rb', line 42</span>
  85. <span class='def def kw'>def</span> <span class='authorize! fid id'>authorize!</span>
  86. <span class='r identifier id'>r</span> <span class='assign token'>=</span> <span class='dstring node'>&quot;#{DRIVER}-deltacloud@#{HOSTNAME}&quot;</span>
  87. <span class='response identifier id'>response</span><span class='lbrack token'>[</span><span class='string val'>'WWW-Authenticate'</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='dstring node'>%(Basic realm=&quot;#{r}&quot;)</span>
  88. <span class='throw identifier id'>throw</span><span class='lparen token'>(</span><span class='symbol val'>:halt</span><span class='comma token'>,</span> <span class='lbrack token'>[</span><span class='integer val'>401</span><span class='comma token'>,</span> <span class='string val'>&quot;Not authorized\n&quot;</span><span class='rbrack token'>]</span><span class='rparen token'>)</span>
  89. <span class='end end kw'>end</span>
  90. </pre>
  91. </td>
  92. </tr>
  93. </table>
  94. </div>
  95. <div class="method_details ">
  96. <p class="signature " id="credentials-instance_method">
  97. - (<tt>Object</tt>) <strong>credentials</strong>
  98. </p><div class="docstring">
  99. <div class="discussion">
  100. <p>
  101. Request the current user&#8217;s credentials. Actual credentials are only
  102. requested when an attempt is made to get the user name or password
  103. </p>
  104. </div>
  105. </div>
  106. <div class="tags">
  107. </div><table class="source_code">
  108. <tr>
  109. <td>
  110. <pre class="lines">
  111. 50
  112. 51
  113. 52</pre>
  114. </td>
  115. <td>
  116. <pre class="code"><span class="info file"># File 'lib/sinatra/lazy_auth.rb', line 50</span>
  117. <span class='def def kw'>def</span> <span class='credentials identifier id'>credentials</span>
  118. <span class='LazyCredentials constant id'>LazyCredentials</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='self self kw'>self</span><span class='rparen token'>)</span>
  119. <span class='end end kw'>end</span>
  120. </pre>
  121. </td>
  122. </tr>
  123. </table>
  124. </div>
  125. </div>
  126. </div>
  127. <div id="footer">
  128. Generated on Thu Sep 30 14:44:01 2010 by
  129. <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
  130. 0.6.1 (ruby-1.8.6).
  131. </div>
  132. </body>
  133. </html>