<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>require_authentication? (DeltacloudTestCommon)</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> </head> <body class="standalone-code"> <pre><span class="ruby-comment cmt"># File tests/common.rb, line 175</span> <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">require_authentication?</span>(<span class="ruby-identifier">uri</span>) <span class="ruby-comment cmt"># We need to make sure we don't have both API_USER and API_PASSWORD</span> <span class="ruby-comment cmt"># set in the environment; otherwise LazyAuth will use those instead</span> <span class="ruby-comment cmt"># of asking for credentials</span> <span class="ruby-identifier">api_user</span> = <span class="ruby-constant">ENV</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-value str">"API_USER"</span>) <span class="ruby-identifier">get</span> <span class="ruby-identifier">uri</span>, {} <span class="ruby-constant">ENV</span>[<span class="ruby-value str">"API_USER"</span>] = <span class="ruby-identifier">api_user</span> <span class="ruby-identifier">last_response</span>.<span class="ruby-identifier">status</span> <span class="ruby-operator">==</span> <span class="ruby-value">401</span> <span class="ruby-keyword kw">end</span></pre> </body> </html>