diff options
Diffstat (limited to 'doc/app/Authentication.html')
-rw-r--r-- | doc/app/Authentication.html | 464 |
1 files changed, 0 insertions, 464 deletions
diff --git a/doc/app/Authentication.html b/doc/app/Authentication.html deleted file mode 100644 index e7184d2..0000000 --- a/doc/app/Authentication.html +++ /dev/null @@ -1,464 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head> - <meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> - - <title>Module: Authentication</title> - - <link rel="stylesheet" href="./rdoc.css" type="text/css" media="screen" /> - - <script src="./js/jquery.js" type="text/javascript" charset="utf-8"></script> - <script src="./js/thickbox-compressed.js" type="text/javascript" charset="utf-8"></script> - <script src="./js/quicksearch.js" type="text/javascript" charset="utf-8"></script> - <script src="./js/darkfish.js" type="text/javascript" charset="utf-8"></script> - -</head> -<body id="top" class="module"> - - <div id="metadata"> - <div id="home-metadata"> - <div id="home-section" class="section"> - <h3 class="section-header"> - <a href="./index.html">Home</a> - <a href="./index.html#classes">Classes</a> - <a href="./index.html#methods">Methods</a> - </h3> - </div> - </div> - - <div id="file-metadata"> - <div id="file-list-section" class="section"> - <h3 class="section-header">In Files</h3> - <div class="section-body"> - <ul> - - <li><a href="./lib/authentication_rb.html?TB_iframe=true&height=550&width=785" - class="thickbox" title="lib/authentication.rb">lib/authentication.rb</a></li> - - </ul> - </div> - </div> - - - </div> - - <div id="class-metadata"> - - - - - - - - <!-- Method Quickref --> - <div id="method-list-section" class="section"> - <h3 class="section-header">Methods</h3> - <ul class="link-list"> - - <li><a href="#method-c-included">::included</a></li> - - <li><a href="#method-i-admin_access_required">#admin_access_required</a></li> - - <li><a href="#method-i-current_user">#current_user</a></li> - - <li><a href="#method-i-login_required">#login_required</a></li> - - </ul> - </div> - - - - </div> - - <div id="project-metadata"> - - - <div id="fileindex-section" class="section project-section"> - <h3 class="section-header">Files</h3> - <ul> - - <li class="file"><a href="./doc/README_FOR_APP.html">README_FOR_APP</a></li> - - </ul> - </div> - - - <div id="classindex-section" class="section project-section"> - <h3 class="section-header">Class/Module Index - <span class="search-toggle"><img src="./images/find.png" - height="16" width="16" alt="[+]" - title="show/hide quicksearch" /></span></h3> - <form action="#" method="get" accept-charset="utf-8" class="initially-hidden"> - <fieldset> - <legend>Quicksearch</legend> - <input type="text" name="quicksearch" value="" - class="quicksearch-field" /> - </fieldset> - </form> - - <ul class="link-list"> - - <li><a href="./Glsamaker.html">Glsamaker</a></li> - - <li><a href="./Glsamaker/Bugs.html">Glsamaker::Bugs</a></li> - - <li><a href="./Glsamaker/Bugs/ArchesMixin.html">Glsamaker::Bugs::ArchesMixin</a></li> - - <li><a href="./Glsamaker/Bugs/Bug.html">Glsamaker::Bugs::Bug</a></li> - - <li><a href="./Glsamaker/Bugs/BugReadyMixin.html">Glsamaker::Bugs::BugReadyMixin</a></li> - - <li><a href="./Glsamaker/Bugs/Status.html">Glsamaker::Bugs::Status</a></li> - - <li><a href="./Glsamaker/Bugs/StatusMixin.html">Glsamaker::Bugs::StatusMixin</a></li> - - <li><a href="./Glsamaker/Diff.html">Glsamaker::Diff</a></li> - - <li><a href="./Glsamaker/HTTP.html">Glsamaker::HTTP</a></li> - - <li><a href="./Glsamaker/Helper.html">Glsamaker::Helper</a></li> - - <li><a href="./Glsamaker/Mail.html">Glsamaker::Mail</a></li> - - <li><a href="./Glsamaker/Portage.html">Glsamaker::Portage</a></li> - - <li><a href="./Glsamaker/Portage/Description.html">Glsamaker::Portage::Description</a></li> - - <li><a href="./Glsamaker/XML.html">Glsamaker::XML</a></li> - - <li><a href="./Admin.html">Admin</a></li> - - <li><a href="./Admin/IndexController.html">Admin::IndexController</a></li> - - <li><a href="./Admin/IndexHelper.html">Admin::IndexHelper</a></li> - - <li><a href="./Admin/TemplatesController.html">Admin::TemplatesController</a></li> - - <li><a href="./Admin/TemplatesHelper.html">Admin::TemplatesHelper</a></li> - - <li><a href="./Admin/UsersController.html">Admin::UsersController</a></li> - - <li><a href="./Admin/UsersHelper.html">Admin::UsersHelper</a></li> - - <li><a href="./Bugzilla.html">Bugzilla</a></li> - - <li><a href="./Bugzilla/Bug.html">Bugzilla::Bug</a></li> - - <li><a href="./Bugzilla/Bugzilla.html">Bugzilla::Bugzilla</a></li> - - <li><a href="./Bugzilla/Bugzilla/Bugzilla.html">Bugzilla::Bugzilla::Bugzilla</a></li> - - <li><a href="./Bugzilla/Bugzilla/Bugzilla/Change.html">Bugzilla::Bugzilla::Bugzilla::Change</a></li> - - <li><a href="./Bugzilla/Comment.html">Bugzilla::Comment</a></li> - - <li><a href="./Bugzilla/History.html">Bugzilla::History</a></li> - - <li><a href="./Comment.html">Comment</a></li> - - <li><a href="./Comment/CommentValidator.html">Comment::CommentValidator</a></li> - - <li><a href="./ApplicationController.html">ApplicationController</a></li> - - <li><a href="./ApplicationHelper.html">ApplicationHelper</a></li> - - <li><a href="./Authentication.html">Authentication</a></li> - - <li><a href="./Authorization.html">Authorization</a></li> - - <li><a href="./Bug.html">Bug</a></li> - - <li><a href="./BugController.html">BugController</a></li> - - <li><a href="./BugHelper.html">BugHelper</a></li> - - <li><a href="./BugsController.html">BugsController</a></li> - - <li><a href="./BugsHelper.html">BugsHelper</a></li> - - <li><a href="./CommentsController.html">CommentsController</a></li> - - <li><a href="./CommentsHelper.html">CommentsHelper</a></li> - - <li><a href="./Cpe.html">Cpe</a></li> - - <li><a href="./Cve.html">Cve</a></li> - - <li><a href="./CveAssignment.html">CveAssignment</a></li> - - <li><a href="./CveChange.html">CveChange</a></li> - - <li><a href="./CveComment.html">CveComment</a></li> - - <li><a href="./CveController.html">CveController</a></li> - - <li><a href="./CveHelper.html">CveHelper</a></li> - - <li><a href="./CveReference.html">CveReference</a></li> - - <li><a href="./GLSAReleaseError.html">GLSAReleaseError</a></li> - - <li><a href="./Glsa.html">Glsa</a></li> - - <li><a href="./GlsaController.html">GlsaController</a></li> - - <li><a href="./GlsaHelper.html">GlsaHelper</a></li> - - <li><a href="./GlsaMailer.html">GlsaMailer</a></li> - - <li><a href="./IndexController.html">IndexController</a></li> - - <li><a href="./IndexHelper.html">IndexHelper</a></li> - - <li><a href="./Package.html">Package</a></li> - - <li><a href="./Reference.html">Reference</a></li> - - <li><a href="./Revision.html">Revision</a></li> - - <li><a href="./SearchController.html">SearchController</a></li> - - <li><a href="./SearchHelper.html">SearchHelper</a></li> - - <li><a href="./String.html">String</a></li> - - <li><a href="./Template.html">Template</a></li> - - <li><a href="./ToolsController.html">ToolsController</a></li> - - <li><a href="./ToolsHelper.html">ToolsHelper</a></li> - - <li><a href="./User.html">User</a></li> - - </ul> - <div id="no-class-search-results" style="display: none;">No matching classes.</div> - </div> - - - </div> - </div> - - <div id="documentation"> - <h1 class="module">Authentication</h1> - - <div id="description" class="description"> - -<p><a href="Authentication.html">Authentication</a> module</p> - - </div><!-- description --> - - - - - <div id="5Buntitled-5D" class="documentation-section"> - - - - - - - - - <!-- Methods --> - - <div id="protected-class-method-details" class="method-section section"> - <h3 class="section-header">Protected Class Methods</h3> - - - <div id="included-method" class="method-detail "> - <a name="method-c-included"></a> - - - <div class="method-heading"> - <span class="method-name">included</span><span - class="method-args">(base)</span> - <span class="method-click-advice">click to toggle source</span> - </div> - - - <div class="method-description"> - - <p>Populate user to views, shamelessly stolen from restful auth. ;)</p> - - - - <div class="method-source-code" id="included-source"> -<pre> -<span class="ruby-comment"># File lib/authentication.rb, line 72</span> -<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">included</span>(<span class="ruby-identifier">base</span>) - <span class="ruby-identifier">base</span>.<span class="ruby-identifier">send</span> <span class="ruby-value">:helper_method</span>, <span class="ruby-value">:current_user</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">base</span>.<span class="ruby-identifier">respond_to?</span> <span class="ruby-value">:helper_method</span> -<span class="ruby-keyword">end</span></pre> - </div><!-- included-source --> - - </div> - - - - - </div><!-- included-method --> - - - </div><!-- protected-class-method-details --> - - <div id="protected-instance-method-details" class="method-section section"> - <h3 class="section-header">Protected Instance Methods</h3> - - - <div id="admin_access_required-method" class="method-detail "> - <a name="method-i-admin_access_required"></a> - - - <div class="method-heading"> - <span class="method-name">admin_access_required</span><span - class="method-args">()</span> - <span class="method-click-advice">click to toggle source</span> - </div> - - - <div class="method-description"> - - <p>Filter for admin pages</p> - - - - <div class="method-source-code" id="admin_access_required-source"> -<pre> -<span class="ruby-comment"># File lib/authentication.rb, line 59</span> -<span class="ruby-keyword">def</span> <span class="ruby-identifier">admin_access_required</span> - <span class="ruby-keyword">unless</span> <span class="ruby-identifier">current_user</span>.<span class="ruby-identifier">is_el_jefe?</span> - <span class="ruby-identifier">deny_access</span> <span class="ruby-string">"Admin interface"</span> - <span class="ruby-keyword">false</span> - <span class="ruby-keyword">end</span> -<span class="ruby-keyword">end</span></pre> - </div><!-- admin_access_required-source --> - - </div> - - - - - </div><!-- admin_access_required-method --> - - - <div id="current_user-method" class="method-detail "> - <a name="method-i-current_user"></a> - - - <div class="method-heading"> - <span class="method-name">current_user</span><span - class="method-args">()</span> - <span class="method-click-advice">click to toggle source</span> - </div> - - - <div class="method-description"> - - <p>Returns the ActiveRecord object of the currently logged in user</p> - - - - <div class="method-source-code" id="current_user-source"> -<pre> -<span class="ruby-comment"># File lib/authentication.rb, line 67</span> -<span class="ruby-keyword">def</span> <span class="ruby-identifier">current_user</span> - <span class="ruby-constant">User</span>.<span class="ruby-identifier">find_by_login</span>(<span class="ruby-identifier">user_name</span>) -<span class="ruby-keyword">end</span></pre> - </div><!-- current_user-source --> - - </div> - - - - - </div><!-- current_user-method --> - - - <div id="login_required-method" class="method-detail "> - <a name="method-i-login_required"></a> - - - <div class="method-heading"> - <span class="method-name">login_required</span><span - class="method-args">()</span> - <span class="method-click-advice">click to toggle source</span> - </div> - - - <div class="method-description"> - - <p>Login filter to be applied to <b>all</b> pages on GLSAMaker</p> - - - - <div class="method-source-code" id="login_required-source"> -<pre> -<span class="ruby-comment"># File lib/authentication.rb, line 16</span> -<span class="ruby-keyword">def</span> <span class="ruby-identifier">login_required</span> - <span class="ruby-comment"># Production authentication via REMOTE_USER</span> - <span class="ruby-keyword">if</span> <span class="ruby-constant">Rails</span>.<span class="ruby-identifier">env</span>.<span class="ruby-identifier">production?</span> <span class="ruby-keyword">or</span> <span class="ruby-constant">GLSAMAKER_FORCE_PRODUCTION_AUTH</span> - <span class="ruby-comment"># REMOTE_USER should be there in FCGI or Passenger</span> - <span class="ruby-identifier">env_user_name</span> = <span class="ruby-identifier">user_name</span> - - <span class="ruby-comment"># Autentication system most likely broken</span> - <span class="ruby-keyword">if</span> <span class="ruby-identifier">env_user_name</span>.<span class="ruby-identifier">nil?</span> - <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">warn</span> <span class="ruby-string">"Neither REMOTE_USER nor HTTP_AUTHORIZATION set in environment."</span> - <span class="ruby-identifier">redirect_to</span> <span class="ruby-value">:controller</span> =<span class="ruby-operator">></span> <span class="ruby-string">'index'</span>, <span class="ruby-value">:action</span> =<span class="ruby-operator">></span> <span class="ruby-string">'error'</span>, <span class="ruby-value">:type</span> =<span class="ruby-operator">></span> <span class="ruby-string">'system'</span> - <span class="ruby-keyword">return</span> - <span class="ruby-keyword">end</span> - - <span class="ruby-identifier">user</span> = <span class="ruby-constant">User</span>.<span class="ruby-identifier">find_by_login</span>(<span class="ruby-identifier">env_user_name</span>) - - <span class="ruby-comment"># User not known to GLSAMaker</span> - <span class="ruby-keyword">if</span> <span class="ruby-identifier">user</span> <span class="ruby-operator">==</span> <span class="ruby-keyword">nil</span> - <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">warn</span> <span class="ruby-node">"Unknown user #{env_user_name} tried to log in from #{request.remote_ip}"</span> - <span class="ruby-identifier">redirect_to</span> <span class="ruby-value">:controller</span> =<span class="ruby-operator">></span> <span class="ruby-string">'index'</span>, <span class="ruby-value">:action</span> =<span class="ruby-operator">></span> <span class="ruby-string">'error'</span>, <span class="ruby-value">:type</span> =<span class="ruby-operator">></span> <span class="ruby-string">'user'</span> - <span class="ruby-keyword">return</span> - <span class="ruby-keyword">end</span> - - <span class="ruby-comment"># User is marked as disabled in the DB</span> - <span class="ruby-keyword">if</span> <span class="ruby-identifier">user</span>.<span class="ruby-identifier">disabled</span> - <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">warn</span> <span class="ruby-node">"Disabled user #{env_user_name} tried to log in from #{request.remote_ip}"</span> - <span class="ruby-identifier">redirect_to</span> <span class="ruby-value">:controller</span> =<span class="ruby-operator">></span> <span class="ruby-string">'index'</span>, <span class="ruby-value">:action</span> =<span class="ruby-operator">></span> <span class="ruby-string">'error'</span>, <span class="ruby-value">:type</span> =<span class="ruby-operator">></span> <span class="ruby-string">'disabled'</span> - <span class="ruby-keyword">return</span> - <span class="ruby-keyword">end</span> - - <span class="ruby-comment"># Auth is fine now.</span> - <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">debug</span> <span class="ruby-node">"Environment username: #{env_user_name}"</span> - - <span class="ruby-comment"># For all other environments request, HTTP auth by ourselves</span> - <span class="ruby-comment"># The password can be set in config/initializers/glsamaker.rb</span> - <span class="ruby-keyword">else</span> - <span class="ruby-identifier">authenticate_or_request_with_http_basic</span>(<span class="ruby-string">"GLSAMaker testing environment"</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">username</span>, <span class="ruby-identifier">password</span><span class="ruby-operator">|</span> - <span class="ruby-identifier">logger</span>.<span class="ruby-identifier">debug</span> <span class="ruby-node">"Environment username: #{username}"</span> - <span class="ruby-identifier">check_auth</span>(<span class="ruby-identifier">username</span>, <span class="ruby-identifier">password</span>) - <span class="ruby-keyword">end</span> - <span class="ruby-keyword">end</span> -<span class="ruby-keyword">end</span></pre> - </div><!-- login_required-source --> - - </div> - - - - - </div><!-- login_required-method --> - - - </div><!-- protected-instance-method-details --> - - </div><!-- 5Buntitled-5D --> - - - </div><!-- documentation --> - - <div id="validator-badges"> - <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> - <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish - Rdoc Generator</a> 2</small>.</p> - </div> - -</body> -</html> - |