1
0
mirror of https://github.com/actix/actix-extras.git synced 2024-11-27 17:22:57 +01:00

Deploying to gh-pages from @ 417c06b00e 🚀

This commit is contained in:
robjtede 2022-07-19 00:49:23 +00:00
parent 5b80b12f20
commit 73d640d97b
4 changed files with 32 additions and 26 deletions

View File

@ -5,7 +5,7 @@
</a><h2 class="location"><a href="#">Module middleware</a></h2><div class="sidebar-elems"><section><div class="block"><ul><li><a href="#structs">Structs</a></li></ul></div></section></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../actix_web_httpauth/index.html"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"> </a><h2 class="location"><a href="#">Module middleware</a></h2><div class="sidebar-elems"><section><div class="block"><ul><li><a href="#structs">Structs</a></li></ul></div></section></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../actix_web_httpauth/index.html"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1">
<a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div> <a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div>
</div></form></nav></div><section id="main-content" class="content"><div class="main-heading"> </div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
<h1 class="fqn"><span class="in-band">Module <a href="../index.html">actix_web_httpauth</a>::<wbr><a class="mod" href="#">middleware</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/actix_web_httpauth/middleware.rs.html#1-413">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>HTTP Authentication middleware.</p> <h1 class="fqn"><span class="in-band">Module <a href="../index.html">actix_web_httpauth</a>::<wbr><a class="mod" href="#">middleware</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/actix_web_httpauth/middleware.rs.html#1-416">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>HTTP Authentication middleware.</p>
</div></details><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2> </div></details><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2>
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.HttpAuthentication.html" title="actix_web_httpauth::middleware::HttpAuthentication struct">HttpAuthentication</a></div><div class="item-right docblock-short"><p>Middleware for checking HTTP authentication.</p> <div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.HttpAuthentication.html" title="actix_web_httpauth::middleware::HttpAuthentication struct">HttpAuthentication</a></div><div class="item-right docblock-short"><p>Middleware for checking HTTP authentication.</p>
</div></div></div></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="actix_web_httpauth" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.64.0-nightly (263edd43c 2022-07-17)" ></div> </div></div></div></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="actix_web_httpauth" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.64.0-nightly (263edd43c 2022-07-17)" ></div>

View File

@ -10,9 +10,9 @@
immediately, without calling the <code>F</code> callback.</p> immediately, without calling the <code>F</code> callback.</p>
<p>Otherwise, it will pass both the request and the parsed credentials into it. In case of <p>Otherwise, it will pass both the request and the parsed credentials into it. In case of
successful validation <code>F</code> callback is required to return the <code>ServiceRequest</code> back.</p> successful validation <code>F</code> callback is required to return the <code>ServiceRequest</code> back.</p>
</div></details><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><div id="implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-HttpAuthentication%3CT%2C%20F%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/actix_web_httpauth/middleware.rs.html#38-52">source</a></span><a href="#impl-HttpAuthentication%3CT%2C%20F%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;T, F, O&gt; <a class="struct" href="struct.HttpAuthentication.html" title="struct actix_web_httpauth::middleware::HttpAuthentication">HttpAuthentication</a>&lt;T, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../extractors/trait.AuthExtractor.html" title="trait actix_web_httpauth::extractors::AuthExtractor">AuthExtractor</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(ServiceRequest, T) -&gt; O,<br>&nbsp;&nbsp;&nbsp;&nbsp;O: <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;ServiceRequest, Error&gt;&gt;,&nbsp;</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.with_fn" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../src/actix_web_httpauth/middleware.rs.html#46-51">source</a></span><h4 class="code-header">pub fn <a href="#method.with_fn" class="fnname">with_fn</a>(process_fn: F) -&gt; <a class="struct" href="struct.HttpAuthentication.html" title="struct actix_web_httpauth::middleware::HttpAuthentication">HttpAuthentication</a>&lt;T, F&gt;</h4></section></summary><div class="docblock"><p>Construct <code>HttpAuthentication</code> middleware with the provided auth extractor <code>T</code> and </div></details><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><div id="implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-HttpAuthentication%3CT%2C%20F%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/actix_web_httpauth/middleware.rs.html#38-52">source</a></span><a href="#impl-HttpAuthentication%3CT%2C%20F%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;T, F, O&gt; <a class="struct" href="struct.HttpAuthentication.html" title="struct actix_web_httpauth::middleware::HttpAuthentication">HttpAuthentication</a>&lt;T, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../extractors/trait.AuthExtractor.html" title="trait actix_web_httpauth::extractors::AuthExtractor">AuthExtractor</a>,<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(ServiceRequest, T) -&gt; O,<br>&nbsp;&nbsp;&nbsp;&nbsp;O: <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;ServiceRequest, (Error, ServiceRequest)&gt;&gt;,&nbsp;</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.with_fn" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../src/actix_web_httpauth/middleware.rs.html#46-51">source</a></span><h4 class="code-header">pub fn <a href="#method.with_fn" class="fnname">with_fn</a>(process_fn: F) -&gt; <a class="struct" href="struct.HttpAuthentication.html" title="struct actix_web_httpauth::middleware::HttpAuthentication">HttpAuthentication</a>&lt;T, F&gt;</h4></section></summary><div class="docblock"><p>Construct <code>HttpAuthentication</code> middleware with the provided auth extractor <code>T</code> and
validation callback <code>F</code>.</p> validation callback <code>F</code>.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-HttpAuthentication%3CBasicAuth%2C%20F%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/actix_web_httpauth/middleware.rs.html#54-83">source</a></span><a href="#impl-HttpAuthentication%3CBasicAuth%2C%20F%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;F, O&gt; <a class="struct" href="struct.HttpAuthentication.html" title="struct actix_web_httpauth::middleware::HttpAuthentication">HttpAuthentication</a>&lt;<a class="struct" href="../extractors/basic/struct.BasicAuth.html" title="struct actix_web_httpauth::extractors::basic::BasicAuth">BasicAuth</a>, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(ServiceRequest, <a class="struct" href="../extractors/basic/struct.BasicAuth.html" title="struct actix_web_httpauth::extractors::basic::BasicAuth">BasicAuth</a>) -&gt; O,<br>&nbsp;&nbsp;&nbsp;&nbsp;O: <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;ServiceRequest, Error&gt;&gt;,&nbsp;</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.basic" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../src/actix_web_httpauth/middleware.rs.html#80-82">source</a></span><h4 class="code-header">pub fn <a href="#method.basic" class="fnname">basic</a>(process_fn: F) -&gt; Self</h4></section></summary><div class="docblock"><p>Construct <code>HttpAuthentication</code> middleware for the HTTP “Basic” authentication scheme.</p> </div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-HttpAuthentication%3CBasicAuth%2C%20F%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/actix_web_httpauth/middleware.rs.html#54-83">source</a></span><a href="#impl-HttpAuthentication%3CBasicAuth%2C%20F%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;F, O&gt; <a class="struct" href="struct.HttpAuthentication.html" title="struct actix_web_httpauth::middleware::HttpAuthentication">HttpAuthentication</a>&lt;<a class="struct" href="../extractors/basic/struct.BasicAuth.html" title="struct actix_web_httpauth::extractors::basic::BasicAuth">BasicAuth</a>, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(ServiceRequest, <a class="struct" href="../extractors/basic/struct.BasicAuth.html" title="struct actix_web_httpauth::extractors::basic::BasicAuth">BasicAuth</a>) -&gt; O,<br>&nbsp;&nbsp;&nbsp;&nbsp;O: <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;ServiceRequest, (Error, ServiceRequest)&gt;&gt;,&nbsp;</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.basic" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../src/actix_web_httpauth/middleware.rs.html#80-82">source</a></span><h4 class="code-header">pub fn <a href="#method.basic" class="fnname">basic</a>(process_fn: F) -&gt; Self</h4></section></summary><div class="docblock"><p>Construct <code>HttpAuthentication</code> middleware for the HTTP “Basic” authentication scheme.</p>
<h5 id="example"><a href="#example">Example</a></h5> <h5 id="example"><a href="#example">Example</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="comment">// In this example validator returns immediately, but since it is required to return</span> <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="comment">// In this example validator returns immediately, but since it is required to return</span>
<span class="comment">// anything that implements `IntoFuture` trait, it can be extended to query database or to</span> <span class="comment">// anything that implements `IntoFuture` trait, it can be extended to query database or to</span>
@ -20,15 +20,15 @@ validation callback <code>F</code>.</p>
<span class="kw">async</span> <span class="kw">fn</span> <span class="ident">validator</span>( <span class="kw">async</span> <span class="kw">fn</span> <span class="ident">validator</span>(
<span class="ident">req</span>: <span class="ident">ServiceRequest</span>, <span class="ident">req</span>: <span class="ident">ServiceRequest</span>,
<span class="ident">credentials</span>: <span class="ident">BasicAuth</span>, <span class="ident">credentials</span>: <span class="ident">BasicAuth</span>,
) -&gt; <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">ServiceRequest</span>, <span class="ident">Error</span><span class="op">&gt;</span> { ) -&gt; <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">ServiceRequest</span>, (<span class="ident">Error</span>, <span class="ident">ServiceRequest</span>)<span class="op">&gt;</span> {
<span class="comment">// All users are great and more than welcome!</span> <span class="comment">// All users are great and more than welcome!</span>
<span class="prelude-val">Ok</span>(<span class="ident">req</span>) <span class="prelude-val">Ok</span>(<span class="ident">req</span>)
} }
<span class="kw">let</span> <span class="ident">middleware</span> <span class="op">=</span> <span class="ident">HttpAuthentication::basic</span>(<span class="ident">validator</span>);</code></pre></div> <span class="kw">let</span> <span class="ident">middleware</span> <span class="op">=</span> <span class="ident">HttpAuthentication::basic</span>(<span class="ident">validator</span>);</code></pre></div>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-HttpAuthentication%3CBearerAuth%2C%20F%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/actix_web_httpauth/middleware.rs.html#85-117">source</a></span><a href="#impl-HttpAuthentication%3CBearerAuth%2C%20F%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;F, O&gt; <a class="struct" href="struct.HttpAuthentication.html" title="struct actix_web_httpauth::middleware::HttpAuthentication">HttpAuthentication</a>&lt;<a class="struct" href="../extractors/bearer/struct.BearerAuth.html" title="struct actix_web_httpauth::extractors::bearer::BearerAuth">BearerAuth</a>, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(ServiceRequest, <a class="struct" href="../extractors/bearer/struct.BearerAuth.html" title="struct actix_web_httpauth::extractors::bearer::BearerAuth">BearerAuth</a>) -&gt; O,<br>&nbsp;&nbsp;&nbsp;&nbsp;O: <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;ServiceRequest, Error&gt;&gt;,&nbsp;</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.bearer" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../src/actix_web_httpauth/middleware.rs.html#114-116">source</a></span><h4 class="code-header">pub fn <a href="#method.bearer" class="fnname">bearer</a>(process_fn: F) -&gt; Self</h4></section></summary><div class="docblock"><p>Construct <code>HttpAuthentication</code> middleware for the HTTP “Bearer” authentication scheme.</p> </div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-HttpAuthentication%3CBearerAuth%2C%20F%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/actix_web_httpauth/middleware.rs.html#85-117">source</a></span><a href="#impl-HttpAuthentication%3CBearerAuth%2C%20F%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;F, O&gt; <a class="struct" href="struct.HttpAuthentication.html" title="struct actix_web_httpauth::middleware::HttpAuthentication">HttpAuthentication</a>&lt;<a class="struct" href="../extractors/bearer/struct.BearerAuth.html" title="struct actix_web_httpauth::extractors::bearer::BearerAuth">BearerAuth</a>, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(ServiceRequest, <a class="struct" href="../extractors/bearer/struct.BearerAuth.html" title="struct actix_web_httpauth::extractors::bearer::BearerAuth">BearerAuth</a>) -&gt; O,<br>&nbsp;&nbsp;&nbsp;&nbsp;O: <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;ServiceRequest, (Error, ServiceRequest)&gt;&gt;,&nbsp;</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.bearer" class="method has-srclink"><span class="rightside"><a class="srclink" href="../../src/actix_web_httpauth/middleware.rs.html#114-116">source</a></span><h4 class="code-header">pub fn <a href="#method.bearer" class="fnname">bearer</a>(process_fn: F) -&gt; Self</h4></section></summary><div class="docblock"><p>Construct <code>HttpAuthentication</code> middleware for the HTTP “Bearer” authentication scheme.</p>
<h5 id="example-1"><a href="#example-1">Example</a></h5> <h5 id="example-1"><a href="#example-1">Example</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">async</span> <span class="kw">fn</span> <span class="ident">validator</span>(<span class="ident">req</span>: <span class="ident">ServiceRequest</span>, <span class="ident">credentials</span>: <span class="ident">BearerAuth</span>) -&gt; <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">ServiceRequest</span>, <span class="ident">Error</span><span class="op">&gt;</span> { <div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">async</span> <span class="kw">fn</span> <span class="ident">validator</span>(<span class="ident">req</span>: <span class="ident">ServiceRequest</span>, <span class="ident">credentials</span>: <span class="ident">BearerAuth</span>) -&gt; <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">ServiceRequest</span>, (<span class="ident">Error</span>, <span class="ident">ServiceRequest</span>)<span class="op">&gt;</span> {
<span class="kw">if</span> <span class="ident">credentials</span>.<span class="ident">token</span>() <span class="op">==</span> <span class="string">&quot;mF_9.B5f-4.1JqM&quot;</span> { <span class="kw">if</span> <span class="ident">credentials</span>.<span class="ident">token</span>() <span class="op">==</span> <span class="string">&quot;mF_9.B5f-4.1JqM&quot;</span> {
<span class="prelude-val">Ok</span>(<span class="ident">req</span>) <span class="prelude-val">Ok</span>(<span class="ident">req</span>)
} <span class="kw">else</span> { } <span class="kw">else</span> {
@ -37,7 +37,7 @@ validation callback <code>F</code>.</p>
.<span class="ident">unwrap_or_else</span>(<span class="ident">Default::default</span>) .<span class="ident">unwrap_or_else</span>(<span class="ident">Default::default</span>)
.<span class="ident">scope</span>(<span class="string">&quot;urn:example:channel=HBO&amp;urn:example:rating=G,PG-13&quot;</span>); .<span class="ident">scope</span>(<span class="string">&quot;urn:example:channel=HBO&amp;urn:example:rating=G,PG-13&quot;</span>);
<span class="prelude-val">Err</span>(<span class="ident">AuthenticationError::from</span>(<span class="ident">config</span>).<span class="ident">into</span>()) <span class="prelude-val">Err</span>((<span class="ident">AuthenticationError::from</span>(<span class="ident">config</span>).<span class="ident">into</span>(), <span class="ident">req</span>))
} }
} }
@ -45,7 +45,7 @@ validation callback <code>F</code>.</p>
</div></details></div></details></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Clone-for-HttpAuthentication%3CT%2C%20F%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/actix_web_httpauth/middleware.rs.html#29">source</a></span><a href="#impl-Clone-for-HttpAuthentication%3CT%2C%20F%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, F:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="struct.HttpAuthentication.html" title="struct actix_web_httpauth::middleware::HttpAuthentication">HttpAuthentication</a>&lt;T, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../extractors/trait.AuthExtractor.html" title="trait actix_web_httpauth::extractors::AuthExtractor">AuthExtractor</a>,&nbsp;</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/actix_web_httpauth/middleware.rs.html#29">source</a></span><a href="#method.clone" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&amp;self) -&gt; <a class="struct" href="struct.HttpAuthentication.html" title="struct actix_web_httpauth::middleware::HttpAuthentication">HttpAuthentication</a>&lt;T, F&gt;</h4></section></summary><div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p> </div></details></div></details></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Clone-for-HttpAuthentication%3CT%2C%20F%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/actix_web_httpauth/middleware.rs.html#29">source</a></span><a href="#impl-Clone-for-HttpAuthentication%3CT%2C%20F%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>, F:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="struct" href="struct.HttpAuthentication.html" title="struct actix_web_httpauth::middleware::HttpAuthentication">HttpAuthentication</a>&lt;T, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../extractors/trait.AuthExtractor.html" title="trait actix_web_httpauth::extractors::AuthExtractor">AuthExtractor</a>,&nbsp;</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/actix_web_httpauth/middleware.rs.html#29">source</a></span><a href="#method.clone" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone" class="fnname">clone</a>(&amp;self) -&gt; <a class="struct" href="struct.HttpAuthentication.html" title="struct actix_web_httpauth::middleware::HttpAuthentication">HttpAuthentication</a>&lt;T, F&gt;</h4></section></summary><div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone_from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/clone.rs.html#132-134">source</a></span><a href="#method.clone_from" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from" class="fnname">clone_from</a>(&amp;mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Self)</h4></section></summary><div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p> </div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone_from" class="method trait-impl has-srclink"><span class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/clone.rs.html#132-134">source</a></span><a href="#method.clone_from" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from" class="fnname">clone_from</a>(&amp;mut self, source: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.reference.html">&amp;</a>Self)</h4></section></summary><div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Debug-for-HttpAuthentication%3CT%2C%20F%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/actix_web_httpauth/middleware.rs.html#29">source</a></span><a href="#impl-Debug-for-HttpAuthentication%3CT%2C%20F%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>, F:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="struct.HttpAuthentication.html" title="struct actix_web_httpauth::middleware::HttpAuthentication">HttpAuthentication</a>&lt;T, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../extractors/trait.AuthExtractor.html" title="trait actix_web_httpauth::extractors::AuthExtractor">AuthExtractor</a>,&nbsp;</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/actix_web_httpauth/middleware.rs.html#29">source</a></span><a href="#method.fmt" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></section></summary><div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p> </div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Debug-for-HttpAuthentication%3CT%2C%20F%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/actix_web_httpauth/middleware.rs.html#29">source</a></span><a href="#impl-Debug-for-HttpAuthentication%3CT%2C%20F%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;T:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>, F:&nbsp;<a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a>&gt; <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="struct.HttpAuthentication.html" title="struct actix_web_httpauth::middleware::HttpAuthentication">HttpAuthentication</a>&lt;T, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../extractors/trait.AuthExtractor.html" title="trait actix_web_httpauth::extractors::AuthExtractor">AuthExtractor</a>,&nbsp;</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/actix_web_httpauth/middleware.rs.html#29">source</a></span><a href="#method.fmt" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt" class="fnname">fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>&lt;'_&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></h4></section></summary><div class='docblock'><p>Formats the value using the given formatter. <a href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Transform%3CS%2C%20ServiceRequest%3E-for-HttpAuthentication%3CT%2C%20F%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/actix_web_httpauth/middleware.rs.html#119-141">source</a></span><a href="#impl-Transform%3CS%2C%20ServiceRequest%3E-for-HttpAuthentication%3CT%2C%20F%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;S, B, T, F, O&gt; Transform&lt;S, ServiceRequest&gt; for <a class="struct" href="struct.HttpAuthentication.html" title="struct actix_web_httpauth::middleware::HttpAuthentication">HttpAuthentication</a>&lt;T, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: Service&lt;ServiceRequest, Response = ServiceResponse&lt;B&gt;, Error = Error&gt; + 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;S::Future: 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(ServiceRequest, T) -&gt; O + 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;O: <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;ServiceRequest, Error&gt;&gt; + 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../extractors/trait.AuthExtractor.html" title="trait actix_web_httpauth::extractors::AuthExtractor">AuthExtractor</a> + 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;B: MessageBody + 'static,&nbsp;</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Response" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Response" class="anchor"></a><h4 class="code-header">type <a class="associatedtype">Response</a> = ServiceResponse&lt;EitherBody&lt;B, BoxBody&gt;&gt;</h4></section></summary><div class='docblock'><p>Responses produced by the service.</p> </div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Transform%3CS%2C%20ServiceRequest%3E-for-HttpAuthentication%3CT%2C%20F%3E" class="impl has-srclink"><span class="rightside"><a class="srclink" href="../../src/actix_web_httpauth/middleware.rs.html#119-141">source</a></span><a href="#impl-Transform%3CS%2C%20ServiceRequest%3E-for-HttpAuthentication%3CT%2C%20F%3E" class="anchor"></a><h3 class="code-header in-band">impl&lt;S, B, T, F, O&gt; Transform&lt;S, ServiceRequest&gt; for <a class="struct" href="struct.HttpAuthentication.html" title="struct actix_web_httpauth::middleware::HttpAuthentication">HttpAuthentication</a>&lt;T, F&gt; <span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: Service&lt;ServiceRequest, Response = ServiceResponse&lt;B&gt;, Error = Error&gt; + 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;S::Future: 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/function/trait.Fn.html" title="trait core::ops::function::Fn">Fn</a>(ServiceRequest, T) -&gt; O + 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;O: <a class="trait" href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html" title="trait core::future::future::Future">Future</a>&lt;Output = <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a>&lt;ServiceRequest, (Error, ServiceRequest)&gt;&gt; + 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class="trait" href="../extractors/trait.AuthExtractor.html" title="trait actix_web_httpauth::extractors::AuthExtractor">AuthExtractor</a> + 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;B: MessageBody + 'static,&nbsp;</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Response" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Response" class="anchor"></a><h4 class="code-header">type <a class="associatedtype">Response</a> = ServiceResponse&lt;EitherBody&lt;B, BoxBody&gt;&gt;</h4></section></summary><div class='docblock'><p>Responses produced by the service.</p>
</div></details><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Error" class="anchor"></a><h4 class="code-header">type <a class="associatedtype">Error</a> = Error</h4></section></summary><div class='docblock'><p>Errors produced by the service.</p> </div></details><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Error" class="anchor"></a><h4 class="code-header">type <a class="associatedtype">Error</a> = Error</h4></section></summary><div class='docblock'><p>Errors produced by the service.</p>
</div></details><details class="rustdoc-toggle" open><summary><section id="associatedtype.Transform" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Transform" class="anchor"></a><h4 class="code-header">type <a class="associatedtype">Transform</a> = AuthenticationMiddleware&lt;S, F, T&gt;</h4></section></summary><div class='docblock'><p>The <code>TransformService</code> value created by this factory</p> </div></details><details class="rustdoc-toggle" open><summary><section id="associatedtype.Transform" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Transform" class="anchor"></a><h4 class="code-header">type <a class="associatedtype">Transform</a> = AuthenticationMiddleware&lt;S, F, T&gt;</h4></section></summary><div class='docblock'><p>The <code>TransformService</code> value created by this factory</p>
</div></details><details class="rustdoc-toggle" open><summary><section id="associatedtype.InitError" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.InitError" class="anchor"></a><h4 class="code-header">type <a class="associatedtype">InitError</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a></h4></section></summary><div class='docblock'><p>Errors produced while building a transform service.</p> </div></details><details class="rustdoc-toggle" open><summary><section id="associatedtype.InitError" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.InitError" class="anchor"></a><h4 class="code-header">type <a class="associatedtype">InitError</a> = <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a></h4></section></summary><div class='docblock'><p>Errors produced while building a transform service.</p>

View File

@ -3,5 +3,5 @@ implementors["actix_cors"] = [{"text":"impl&lt;S, B&gt; Transform&lt;S, ServiceR
implementors["actix_identity"] = [{"text":"impl&lt;S, B&gt; Transform&lt;S, ServiceRequest&gt; for <a class=\"struct\" href=\"actix_identity/struct.IdentityMiddleware.html\" title=\"struct actix_identity::IdentityMiddleware\">IdentityMiddleware</a> <span class=\"where fmt-newline\">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: Service&lt;ServiceRequest, Response = ServiceResponse&lt;B&gt;, Error = Error&gt; + 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;S::Future: 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;B: MessageBody + 'static,&nbsp;</span>","synthetic":false,"types":["actix_identity::middleware::IdentityMiddleware"]}]; implementors["actix_identity"] = [{"text":"impl&lt;S, B&gt; Transform&lt;S, ServiceRequest&gt; for <a class=\"struct\" href=\"actix_identity/struct.IdentityMiddleware.html\" title=\"struct actix_identity::IdentityMiddleware\">IdentityMiddleware</a> <span class=\"where fmt-newline\">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: Service&lt;ServiceRequest, Response = ServiceResponse&lt;B&gt;, Error = Error&gt; + 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;S::Future: 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;B: MessageBody + 'static,&nbsp;</span>","synthetic":false,"types":["actix_identity::middleware::IdentityMiddleware"]}];
implementors["actix_limitation"] = [{"text":"impl&lt;S, B&gt; Transform&lt;S, ServiceRequest&gt; for <a class=\"struct\" href=\"actix_limitation/struct.RateLimiter.html\" title=\"struct actix_limitation::RateLimiter\">RateLimiter</a> <span class=\"where fmt-newline\">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: Service&lt;ServiceRequest, Response = ServiceResponse&lt;B&gt;, Error = Error&gt; + 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;S::Future: 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;B: 'static,&nbsp;</span>","synthetic":false,"types":["actix_limitation::middleware::RateLimiter"]}]; implementors["actix_limitation"] = [{"text":"impl&lt;S, B&gt; Transform&lt;S, ServiceRequest&gt; for <a class=\"struct\" href=\"actix_limitation/struct.RateLimiter.html\" title=\"struct actix_limitation::RateLimiter\">RateLimiter</a> <span class=\"where fmt-newline\">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: Service&lt;ServiceRequest, Response = ServiceResponse&lt;B&gt;, Error = Error&gt; + 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;S::Future: 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;B: 'static,&nbsp;</span>","synthetic":false,"types":["actix_limitation::middleware::RateLimiter"]}];
implementors["actix_session"] = [{"text":"impl&lt;S, B, Store&gt; Transform&lt;S, ServiceRequest&gt; for <a class=\"struct\" href=\"actix_session/struct.SessionMiddleware.html\" title=\"struct actix_session::SessionMiddleware\">SessionMiddleware</a>&lt;Store&gt; <span class=\"where fmt-newline\">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: Service&lt;ServiceRequest, Response = ServiceResponse&lt;B&gt;, Error = Error&gt; + 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;S::Future: 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;B: MessageBody + 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;Store: <a class=\"trait\" href=\"actix_session/storage/trait.SessionStore.html\" title=\"trait actix_session::storage::SessionStore\">SessionStore</a> + 'static,&nbsp;</span>","synthetic":false,"types":["actix_session::middleware::SessionMiddleware"]}]; implementors["actix_session"] = [{"text":"impl&lt;S, B, Store&gt; Transform&lt;S, ServiceRequest&gt; for <a class=\"struct\" href=\"actix_session/struct.SessionMiddleware.html\" title=\"struct actix_session::SessionMiddleware\">SessionMiddleware</a>&lt;Store&gt; <span class=\"where fmt-newline\">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: Service&lt;ServiceRequest, Response = ServiceResponse&lt;B&gt;, Error = Error&gt; + 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;S::Future: 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;B: MessageBody + 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;Store: <a class=\"trait\" href=\"actix_session/storage/trait.SessionStore.html\" title=\"trait actix_session::storage::SessionStore\">SessionStore</a> + 'static,&nbsp;</span>","synthetic":false,"types":["actix_session::middleware::SessionMiddleware"]}];
implementors["actix_web_httpauth"] = [{"text":"impl&lt;S, B, T, F, O&gt; Transform&lt;S, ServiceRequest&gt; for <a class=\"struct\" href=\"actix_web_httpauth/middleware/struct.HttpAuthentication.html\" title=\"struct actix_web_httpauth::middleware::HttpAuthentication\">HttpAuthentication</a>&lt;T, F&gt; <span class=\"where fmt-newline\">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: Service&lt;ServiceRequest, Response = ServiceResponse&lt;B&gt;, Error = Error&gt; + 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;S::Future: 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/ops/function/trait.Fn.html\" title=\"trait core::ops::function::Fn\">Fn</a>(ServiceRequest, T) -&gt; O + 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;O: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html\" title=\"trait core::future::future::Future\">Future</a>&lt;Output = <a class=\"enum\" href=\"https://doc.rust-lang.org/nightly/core/result/enum.Result.html\" title=\"enum core::result::Result\">Result</a>&lt;ServiceRequest, Error&gt;&gt; + 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class=\"trait\" href=\"actix_web_httpauth/extractors/trait.AuthExtractor.html\" title=\"trait actix_web_httpauth::extractors::AuthExtractor\">AuthExtractor</a> + 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;B: MessageBody + 'static,&nbsp;</span>","synthetic":false,"types":["actix_web_httpauth::middleware::HttpAuthentication"]}]; implementors["actix_web_httpauth"] = [{"text":"impl&lt;S, B, T, F, O&gt; Transform&lt;S, ServiceRequest&gt; for <a class=\"struct\" href=\"actix_web_httpauth/middleware/struct.HttpAuthentication.html\" title=\"struct actix_web_httpauth::middleware::HttpAuthentication\">HttpAuthentication</a>&lt;T, F&gt; <span class=\"where fmt-newline\">where<br>&nbsp;&nbsp;&nbsp;&nbsp;S: Service&lt;ServiceRequest, Response = ServiceResponse&lt;B&gt;, Error = Error&gt; + 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;S::Future: 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;F: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/ops/function/trait.Fn.html\" title=\"trait core::ops::function::Fn\">Fn</a>(ServiceRequest, T) -&gt; O + 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;O: <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html\" title=\"trait core::future::future::Future\">Future</a>&lt;Output = <a class=\"enum\" href=\"https://doc.rust-lang.org/nightly/core/result/enum.Result.html\" title=\"enum core::result::Result\">Result</a>&lt;ServiceRequest, (Error, ServiceRequest)&gt;&gt; + 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;T: <a class=\"trait\" href=\"actix_web_httpauth/extractors/trait.AuthExtractor.html\" title=\"trait actix_web_httpauth::extractors::AuthExtractor\">AuthExtractor</a> + 'static,<br>&nbsp;&nbsp;&nbsp;&nbsp;B: MessageBody + 'static,&nbsp;</span>","synthetic":false,"types":["actix_web_httpauth::middleware::HttpAuthentication"]}];
if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()

View File

@ -417,6 +417,9 @@
<span id="411">411</span> <span id="411">411</span>
<span id="412">412</span> <span id="412">412</span>
<span id="413">413</span> <span id="413">413</span>
<span id="414">414</span>
<span id="415">415</span>
<span id="416">416</span>
</pre><pre class="rust"><code><span class="doccomment">//! HTTP Authentication middleware.</span> </pre><pre class="rust"><code><span class="doccomment">//! HTTP Authentication middleware.</span>
<span class="kw">use</span> <span class="ident">std</span>::{ <span class="kw">use</span> <span class="ident">std</span>::{
@ -458,7 +461,7 @@
<span class="kw">where</span> <span class="kw">where</span>
<span class="ident">T</span>: <span class="ident">AuthExtractor</span>, <span class="ident">T</span>: <span class="ident">AuthExtractor</span>,
<span class="ident">F</span>: <span class="ident">Fn</span>(<span class="ident">ServiceRequest</span>, <span class="ident">T</span>) -&gt; <span class="ident">O</span>, <span class="ident">F</span>: <span class="ident">Fn</span>(<span class="ident">ServiceRequest</span>, <span class="ident">T</span>) -&gt; <span class="ident">O</span>,
<span class="ident">O</span>: <span class="ident">Future</span><span class="op">&lt;</span><span class="ident">Output</span> <span class="op">=</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">ServiceRequest</span>, <span class="ident">Error</span><span class="op">&gt;</span><span class="op">&gt;</span>, <span class="ident">O</span>: <span class="ident">Future</span><span class="op">&lt;</span><span class="ident">Output</span> <span class="op">=</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">ServiceRequest</span>, (<span class="ident">Error</span>, <span class="ident">ServiceRequest</span>)<span class="op">&gt;</span><span class="op">&gt;</span>,
{ {
<span class="doccomment">/// Construct `HttpAuthentication` middleware with the provided auth extractor `T` and</span> <span class="doccomment">/// Construct `HttpAuthentication` middleware with the provided auth extractor `T` and</span>
<span class="doccomment">/// validation callback `F`.</span> <span class="doccomment">/// validation callback `F`.</span>
@ -473,7 +476,7 @@
<span class="kw">impl</span><span class="op">&lt;</span><span class="ident">F</span>, <span class="ident">O</span><span class="op">&gt;</span> <span class="ident">HttpAuthentication</span><span class="op">&lt;</span><span class="ident">basic::BasicAuth</span>, <span class="ident">F</span><span class="op">&gt;</span> <span class="kw">impl</span><span class="op">&lt;</span><span class="ident">F</span>, <span class="ident">O</span><span class="op">&gt;</span> <span class="ident">HttpAuthentication</span><span class="op">&lt;</span><span class="ident">basic::BasicAuth</span>, <span class="ident">F</span><span class="op">&gt;</span>
<span class="kw">where</span> <span class="kw">where</span>
<span class="ident">F</span>: <span class="ident">Fn</span>(<span class="ident">ServiceRequest</span>, <span class="ident">basic::BasicAuth</span>) -&gt; <span class="ident">O</span>, <span class="ident">F</span>: <span class="ident">Fn</span>(<span class="ident">ServiceRequest</span>, <span class="ident">basic::BasicAuth</span>) -&gt; <span class="ident">O</span>,
<span class="ident">O</span>: <span class="ident">Future</span><span class="op">&lt;</span><span class="ident">Output</span> <span class="op">=</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">ServiceRequest</span>, <span class="ident">Error</span><span class="op">&gt;</span><span class="op">&gt;</span>, <span class="ident">O</span>: <span class="ident">Future</span><span class="op">&lt;</span><span class="ident">Output</span> <span class="op">=</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">ServiceRequest</span>, (<span class="ident">Error</span>, <span class="ident">ServiceRequest</span>)<span class="op">&gt;</span><span class="op">&gt;</span>,
{ {
<span class="doccomment">/// Construct `HttpAuthentication` middleware for the HTTP &quot;Basic&quot; authentication scheme.</span> <span class="doccomment">/// Construct `HttpAuthentication` middleware for the HTTP &quot;Basic&quot; authentication scheme.</span>
<span class="doccomment">///</span> <span class="doccomment">///</span>
@ -489,7 +492,7 @@
<span class="doccomment">/// async fn validator(</span> <span class="doccomment">/// async fn validator(</span>
<span class="doccomment">/// req: ServiceRequest,</span> <span class="doccomment">/// req: ServiceRequest,</span>
<span class="doccomment">/// credentials: BasicAuth,</span> <span class="doccomment">/// credentials: BasicAuth,</span>
<span class="doccomment">/// ) -&gt; Result&lt;ServiceRequest, Error&gt; {</span> <span class="doccomment">/// ) -&gt; Result&lt;ServiceRequest, (Error, ServiceRequest)&gt; {</span>
<span class="doccomment">/// // All users are great and more than welcome!</span> <span class="doccomment">/// // All users are great and more than welcome!</span>
<span class="doccomment">/// Ok(req)</span> <span class="doccomment">/// Ok(req)</span>
<span class="doccomment">/// }</span> <span class="doccomment">/// }</span>
@ -504,7 +507,7 @@
<span class="kw">impl</span><span class="op">&lt;</span><span class="ident">F</span>, <span class="ident">O</span><span class="op">&gt;</span> <span class="ident">HttpAuthentication</span><span class="op">&lt;</span><span class="ident">bearer::BearerAuth</span>, <span class="ident">F</span><span class="op">&gt;</span> <span class="kw">impl</span><span class="op">&lt;</span><span class="ident">F</span>, <span class="ident">O</span><span class="op">&gt;</span> <span class="ident">HttpAuthentication</span><span class="op">&lt;</span><span class="ident">bearer::BearerAuth</span>, <span class="ident">F</span><span class="op">&gt;</span>
<span class="kw">where</span> <span class="kw">where</span>
<span class="ident">F</span>: <span class="ident">Fn</span>(<span class="ident">ServiceRequest</span>, <span class="ident">bearer::BearerAuth</span>) -&gt; <span class="ident">O</span>, <span class="ident">F</span>: <span class="ident">Fn</span>(<span class="ident">ServiceRequest</span>, <span class="ident">bearer::BearerAuth</span>) -&gt; <span class="ident">O</span>,
<span class="ident">O</span>: <span class="ident">Future</span><span class="op">&lt;</span><span class="ident">Output</span> <span class="op">=</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">ServiceRequest</span>, <span class="ident">Error</span><span class="op">&gt;</span><span class="op">&gt;</span>, <span class="ident">O</span>: <span class="ident">Future</span><span class="op">&lt;</span><span class="ident">Output</span> <span class="op">=</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">ServiceRequest</span>, (<span class="ident">Error</span>, <span class="ident">ServiceRequest</span>)<span class="op">&gt;</span><span class="op">&gt;</span>,
{ {
<span class="doccomment">/// Construct `HttpAuthentication` middleware for the HTTP &quot;Bearer&quot; authentication scheme.</span> <span class="doccomment">/// Construct `HttpAuthentication` middleware for the HTTP &quot;Bearer&quot; authentication scheme.</span>
<span class="doccomment">///</span> <span class="doccomment">///</span>
@ -515,7 +518,7 @@
<span class="doccomment">/// # use actix_web_httpauth::middleware::HttpAuthentication;</span> <span class="doccomment">/// # use actix_web_httpauth::middleware::HttpAuthentication;</span>
<span class="doccomment">/// # use actix_web_httpauth::extractors::bearer::{Config, BearerAuth};</span> <span class="doccomment">/// # use actix_web_httpauth::extractors::bearer::{Config, BearerAuth};</span>
<span class="doccomment">/// # use actix_web_httpauth::extractors::{AuthenticationError, AuthExtractorConfig};</span> <span class="doccomment">/// # use actix_web_httpauth::extractors::{AuthenticationError, AuthExtractorConfig};</span>
<span class="doccomment">/// async fn validator(req: ServiceRequest, credentials: BearerAuth) -&gt; Result&lt;ServiceRequest, Error&gt; {</span> <span class="doccomment">/// async fn validator(req: ServiceRequest, credentials: BearerAuth) -&gt; Result&lt;ServiceRequest, (Error, ServiceRequest)&gt; {</span>
<span class="doccomment">/// if credentials.token() == &quot;mF_9.B5f-4.1JqM&quot; {</span> <span class="doccomment">/// if credentials.token() == &quot;mF_9.B5f-4.1JqM&quot; {</span>
<span class="doccomment">/// Ok(req)</span> <span class="doccomment">/// Ok(req)</span>
<span class="doccomment">/// } else {</span> <span class="doccomment">/// } else {</span>
@ -524,7 +527,7 @@
<span class="doccomment">/// .unwrap_or_else(Default::default)</span> <span class="doccomment">/// .unwrap_or_else(Default::default)</span>
<span class="doccomment">/// .scope(&quot;urn:example:channel=HBO&amp;urn:example:rating=G,PG-13&quot;);</span> <span class="doccomment">/// .scope(&quot;urn:example:channel=HBO&amp;urn:example:rating=G,PG-13&quot;);</span>
<span class="doccomment">///</span> <span class="doccomment">///</span>
<span class="doccomment">/// Err(AuthenticationError::from(config).into())</span> <span class="doccomment">/// Err((AuthenticationError::from(config).into(), req))</span>
<span class="doccomment">/// }</span> <span class="doccomment">/// }</span>
<span class="doccomment">/// }</span> <span class="doccomment">/// }</span>
<span class="doccomment">///</span> <span class="doccomment">///</span>
@ -540,7 +543,7 @@
<span class="ident">S</span>: <span class="ident">Service</span><span class="op">&lt;</span><span class="ident">ServiceRequest</span>, <span class="ident">Response</span> <span class="op">=</span> <span class="ident">ServiceResponse</span><span class="op">&lt;</span><span class="ident">B</span><span class="op">&gt;</span>, <span class="ident">Error</span> <span class="op">=</span> <span class="ident">Error</span><span class="op">&gt;</span> <span class="op">+</span> <span class="lifetime">&#39;static</span>, <span class="ident">S</span>: <span class="ident">Service</span><span class="op">&lt;</span><span class="ident">ServiceRequest</span>, <span class="ident">Response</span> <span class="op">=</span> <span class="ident">ServiceResponse</span><span class="op">&lt;</span><span class="ident">B</span><span class="op">&gt;</span>, <span class="ident">Error</span> <span class="op">=</span> <span class="ident">Error</span><span class="op">&gt;</span> <span class="op">+</span> <span class="lifetime">&#39;static</span>,
<span class="ident">S::Future</span>: <span class="lifetime">&#39;static</span>, <span class="ident">S::Future</span>: <span class="lifetime">&#39;static</span>,
<span class="ident">F</span>: <span class="ident">Fn</span>(<span class="ident">ServiceRequest</span>, <span class="ident">T</span>) -&gt; <span class="ident">O</span> <span class="op">+</span> <span class="lifetime">&#39;static</span>, <span class="ident">F</span>: <span class="ident">Fn</span>(<span class="ident">ServiceRequest</span>, <span class="ident">T</span>) -&gt; <span class="ident">O</span> <span class="op">+</span> <span class="lifetime">&#39;static</span>,
<span class="ident">O</span>: <span class="ident">Future</span><span class="op">&lt;</span><span class="ident">Output</span> <span class="op">=</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">ServiceRequest</span>, <span class="ident">Error</span><span class="op">&gt;</span><span class="op">&gt;</span> <span class="op">+</span> <span class="lifetime">&#39;static</span>, <span class="ident">O</span>: <span class="ident">Future</span><span class="op">&lt;</span><span class="ident">Output</span> <span class="op">=</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">ServiceRequest</span>, (<span class="ident">Error</span>, <span class="ident">ServiceRequest</span>)<span class="op">&gt;</span><span class="op">&gt;</span> <span class="op">+</span> <span class="lifetime">&#39;static</span>,
<span class="ident">T</span>: <span class="ident">AuthExtractor</span> <span class="op">+</span> <span class="lifetime">&#39;static</span>, <span class="ident">T</span>: <span class="ident">AuthExtractor</span> <span class="op">+</span> <span class="lifetime">&#39;static</span>,
<span class="ident">B</span>: <span class="ident">MessageBody</span> <span class="op">+</span> <span class="lifetime">&#39;static</span>, <span class="ident">B</span>: <span class="ident">MessageBody</span> <span class="op">+</span> <span class="lifetime">&#39;static</span>,
{ {
@ -574,7 +577,7 @@
<span class="ident">S</span>: <span class="ident">Service</span><span class="op">&lt;</span><span class="ident">ServiceRequest</span>, <span class="ident">Response</span> <span class="op">=</span> <span class="ident">ServiceResponse</span><span class="op">&lt;</span><span class="ident">B</span><span class="op">&gt;</span>, <span class="ident">Error</span> <span class="op">=</span> <span class="ident">Error</span><span class="op">&gt;</span> <span class="op">+</span> <span class="lifetime">&#39;static</span>, <span class="ident">S</span>: <span class="ident">Service</span><span class="op">&lt;</span><span class="ident">ServiceRequest</span>, <span class="ident">Response</span> <span class="op">=</span> <span class="ident">ServiceResponse</span><span class="op">&lt;</span><span class="ident">B</span><span class="op">&gt;</span>, <span class="ident">Error</span> <span class="op">=</span> <span class="ident">Error</span><span class="op">&gt;</span> <span class="op">+</span> <span class="lifetime">&#39;static</span>,
<span class="ident">S::Future</span>: <span class="lifetime">&#39;static</span>, <span class="ident">S::Future</span>: <span class="lifetime">&#39;static</span>,
<span class="ident">F</span>: <span class="ident">Fn</span>(<span class="ident">ServiceRequest</span>, <span class="ident">T</span>) -&gt; <span class="ident">O</span> <span class="op">+</span> <span class="lifetime">&#39;static</span>, <span class="ident">F</span>: <span class="ident">Fn</span>(<span class="ident">ServiceRequest</span>, <span class="ident">T</span>) -&gt; <span class="ident">O</span> <span class="op">+</span> <span class="lifetime">&#39;static</span>,
<span class="ident">O</span>: <span class="ident">Future</span><span class="op">&lt;</span><span class="ident">Output</span> <span class="op">=</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">ServiceRequest</span>, <span class="ident">Error</span><span class="op">&gt;</span><span class="op">&gt;</span> <span class="op">+</span> <span class="lifetime">&#39;static</span>, <span class="ident">O</span>: <span class="ident">Future</span><span class="op">&lt;</span><span class="ident">Output</span> <span class="op">=</span> <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">ServiceRequest</span>, (<span class="ident">Error</span>, <span class="ident">ServiceRequest</span>)<span class="op">&gt;</span><span class="op">&gt;</span> <span class="op">+</span> <span class="lifetime">&#39;static</span>,
<span class="ident">T</span>: <span class="ident">AuthExtractor</span> <span class="op">+</span> <span class="lifetime">&#39;static</span>, <span class="ident">T</span>: <span class="ident">AuthExtractor</span> <span class="op">+</span> <span class="lifetime">&#39;static</span>,
<span class="ident">B</span>: <span class="ident">MessageBody</span> <span class="op">+</span> <span class="lifetime">&#39;static</span>, <span class="ident">B</span>: <span class="ident">MessageBody</span> <span class="op">+</span> <span class="lifetime">&#39;static</span>,
{ {
@ -597,9 +600,12 @@
} }
}; };
<span class="comment">// TODO: alter to remove ? operator; an error response is required for downstream</span> <span class="kw">let</span> <span class="ident">req</span> <span class="op">=</span> <span class="kw">match</span> <span class="ident">process_fn</span>(<span class="ident">req</span>, <span class="ident">credentials</span>).<span class="kw">await</span> {
<span class="comment">// middleware to do their thing (eg. cors adding headers)</span> <span class="prelude-val">Ok</span>(<span class="ident">req</span>) =&gt; <span class="ident">req</span>,
<span class="kw">let</span> <span class="ident">req</span> <span class="op">=</span> <span class="ident">process_fn</span>(<span class="ident">req</span>, <span class="ident">credentials</span>).<span class="kw">await</span><span class="question-mark">?</span>; <span class="prelude-val">Err</span>((<span class="ident">err</span>, <span class="ident">req</span>)) =&gt; {
<span class="kw">return</span> <span class="prelude-val">Ok</span>(<span class="ident">req</span>.<span class="ident">error_response</span>(<span class="ident">err</span>).<span class="ident">map_into_right_body</span>());
}
};
<span class="ident">service</span>.<span class="ident">call</span>(<span class="ident">req</span>).<span class="kw">await</span>.<span class="ident">map</span>(<span class="op">|</span><span class="ident">res</span><span class="op">|</span> <span class="ident">res</span>.<span class="ident">map_into_left_body</span>()) <span class="ident">service</span>.<span class="ident">call</span>(<span class="ident">req</span>).<span class="kw">await</span>.<span class="ident">map</span>(<span class="op">|</span><span class="ident">res</span><span class="op">|</span> <span class="ident">res</span>.<span class="ident">map_into_left_body</span>())
} }
@ -781,10 +787,10 @@
<span class="attribute">#[<span class="ident">actix_web::test</span>]</span> <span class="attribute">#[<span class="ident">actix_web::test</span>]</span>
<span class="kw">async</span> <span class="kw">fn</span> <span class="ident">test_middleware_works_with_app</span>() { <span class="kw">async</span> <span class="kw">fn</span> <span class="ident">test_middleware_works_with_app</span>() {
<span class="kw">async</span> <span class="kw">fn</span> <span class="ident">validator</span>( <span class="kw">async</span> <span class="kw">fn</span> <span class="ident">validator</span>(
<span class="ident">_req</span>: <span class="ident">ServiceRequest</span>, <span class="ident">req</span>: <span class="ident">ServiceRequest</span>,
<span class="ident">_credentials</span>: <span class="ident">BasicAuth</span>, <span class="ident">_credentials</span>: <span class="ident">BasicAuth</span>,
) -&gt; <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">ServiceRequest</span>, <span class="ident">actix_web::Error</span><span class="op">&gt;</span> { ) -&gt; <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">ServiceRequest</span>, (<span class="ident">actix_web::Error</span>, <span class="ident">ServiceRequest</span>)<span class="op">&gt;</span> {
<span class="prelude-val">Err</span>(<span class="ident">ErrorForbidden</span>(<span class="string">&quot;You are not welcome!&quot;</span>)) <span class="prelude-val">Err</span>((<span class="ident">ErrorForbidden</span>(<span class="string">&quot;You are not welcome!&quot;</span>), <span class="ident">req</span>))
} }
<span class="kw">let</span> <span class="ident">middleware</span> <span class="op">=</span> <span class="ident">HttpAuthentication::basic</span>(<span class="ident">validator</span>); <span class="kw">let</span> <span class="ident">middleware</span> <span class="op">=</span> <span class="ident">HttpAuthentication::basic</span>(<span class="ident">validator</span>);
@ -806,10 +812,10 @@
<span class="attribute">#[<span class="ident">actix_web::test</span>]</span> <span class="attribute">#[<span class="ident">actix_web::test</span>]</span>
<span class="kw">async</span> <span class="kw">fn</span> <span class="ident">test_middleware_works_with_scope</span>() { <span class="kw">async</span> <span class="kw">fn</span> <span class="ident">test_middleware_works_with_scope</span>() {
<span class="kw">async</span> <span class="kw">fn</span> <span class="ident">validator</span>( <span class="kw">async</span> <span class="kw">fn</span> <span class="ident">validator</span>(
<span class="ident">_req</span>: <span class="ident">ServiceRequest</span>, <span class="ident">req</span>: <span class="ident">ServiceRequest</span>,
<span class="ident">_credentials</span>: <span class="ident">BasicAuth</span>, <span class="ident">_credentials</span>: <span class="ident">BasicAuth</span>,
) -&gt; <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">ServiceRequest</span>, <span class="ident">actix_web::Error</span><span class="op">&gt;</span> { ) -&gt; <span class="prelude-ty">Result</span><span class="op">&lt;</span><span class="ident">ServiceRequest</span>, (<span class="ident">actix_web::Error</span>, <span class="ident">ServiceRequest</span>)<span class="op">&gt;</span> {
<span class="prelude-val">Err</span>(<span class="ident">ErrorForbidden</span>(<span class="string">&quot;You are not welcome!&quot;</span>)) <span class="prelude-val">Err</span>((<span class="ident">ErrorForbidden</span>(<span class="string">&quot;You are not welcome!&quot;</span>), <span class="ident">req</span>))
} }
<span class="kw">let</span> <span class="ident">middleware</span> <span class="op">=</span> <span class="ident">actix_web::middleware::Compat::new</span>(<span class="ident">HttpAuthentication::basic</span>(<span class="ident">validator</span>)); <span class="kw">let</span> <span class="ident">middleware</span> <span class="op">=</span> <span class="ident">actix_web::middleware::Compat::new</span>(<span class="ident">HttpAuthentication::basic</span>(<span class="ident">validator</span>));