</a><h2class="location">Crate actix_identity</h2></nav><main><divclass="width-limiter"><divclass="sub-container"><aclass="sub-logo-container"href="../actix_identity/index.html"><imgclass="rust-logo"src="../rust-logo.svg"alt="logo"></a><navclass="sub"><divclass="theme-picker hidden"><buttonid="theme-picker"aria-label="Pick another theme!"aria-haspopup="menu"title="themes"><imgwidth="22"height="22"alt="Pick another theme!"src="../brush.svg"></button><divid="theme-choices"role="menu"></div></div><formclass="search-form"><divclass="search-container"><span></span><inputclass="search-input"name="search"autocomplete="off"spellcheck="false"placeholder="Click or press ‘S’ to search, ‘?’ for more options…"type="search"><buttontype="button"id="help-button"title="help">?</button><aid="settings-menu"href="../settings.html"title="settings"><imgwidth="22"height="22"alt="Change settings"src="../wheel.svg"></a></div></form></nav></div><sectionid="main-content"class="content"><h1class="fqn"><spanclass="in-band">List of all items</span></h1><h3id="Structs">Structs</h3><ulclass="structs docblock"><li><ahref="struct.CookieIdentityPolicy.html">CookieIdentityPolicy</a></li><li><ahref="struct.Identity.html">Identity</a></li><li><ahref="struct.IdentityService.html">IdentityService</a></li></ul><h3id="Traits">Traits</h3><ulclass="traits docblock"><li><ahref="trait.IdentityPolicy.html">IdentityPolicy</a></li><li><ahref="trait.RequestIdentity.html">RequestIdentity</a></li></ul></section><sectionid="search"class="content hidden"></section></div></main><divid="rustdoc-vars"data-root-path="../"data-current-crate="actix_identity"data-themes="ayu,dark,light"data-resource-suffix=""data-rustdoc-version="1.61.0-nightly (ab0c2e18d 2022-03-27)"></div>
</a><h2class="location">Crate actix_identity</h2></nav><main><divclass="width-limiter"><divclass="sub-container"><aclass="sub-logo-container"href="../actix_identity/index.html"><imgclass="rust-logo"src="../rust-logo.svg"alt="logo"></a><navclass="sub"><divclass="theme-picker hidden"><buttonid="theme-picker"aria-label="Pick another theme!"aria-haspopup="menu"title="themes"><imgwidth="22"height="22"alt="Pick another theme!"src="../brush.svg"></button><divid="theme-choices"role="menu"></div></div><formclass="search-form"><divclass="search-container"><span></span><inputclass="search-input"name="search"autocomplete="off"spellcheck="false"placeholder="Click or press ‘S’ to search, ‘?’ for more options…"type="search"><buttontype="button"id="help-button"title="help">?</button><aid="settings-menu"href="../settings.html"title="settings"><imgwidth="22"height="22"alt="Change settings"src="../wheel.svg"></a></div></form></nav></div><sectionid="main-content"class="content"><h1class="fqn"><spanclass="in-band">List of all items</span></h1><h3id="Structs">Structs</h3><ulclass="structs docblock"><li><ahref="struct.CookieIdentityPolicy.html">CookieIdentityPolicy</a></li><li><ahref="struct.Identity.html">Identity</a></li><li><ahref="struct.IdentityService.html">IdentityService</a></li></ul><h3id="Traits">Traits</h3><ulclass="traits docblock"><li><ahref="trait.IdentityPolicy.html">IdentityPolicy</a></li><li><ahref="trait.RequestIdentity.html">RequestIdentity</a></li></ul></section><sectionid="search"class="content hidden"></section></div></main><divid="rustdoc-vars"data-root-path="../"data-current-crate="actix_identity"data-themes="ayu,dark,light"data-resource-suffix=""data-rustdoc-version="1.61.0-nightly (ee915c34e 2022-03-28)"></div>
</div></div><divclass="item-row"><divclass="item-left module-item"><aclass="trait"href="trait.RequestIdentity.html"title="actix_identity::RequestIdentity trait">RequestIdentity</a></div><divclass="item-right docblock-short"><p>Helper trait that allows to get Identity.</p>
</a><h2class="location"><ahref="#">CookieIdentityPolicy</a></h2><divclass="sidebar-elems"><section><divclass="block"><h3class="sidebar-title"><ahref="#implementations">Methods</a></h3><ul><li><ahref="#method.domain">domain</a></li><li><ahref="#method.http_only">http_only</a></li><li><ahref="#method.login_deadline">login_deadline</a></li><li><ahref="#method.max_age">max_age</a></li><li><ahref="#method.max_age_secs">max_age_secs</a></li><li><ahref="#method.name">name</a></li><li><ahref="#method.new">new</a></li><li><ahref="#method.path">path</a></li><li><ahref="#method.same_site">same_site</a></li><li><ahref="#method.secure">secure</a></li><li><ahref="#method.visit_deadline">visit_deadline</a></li></ul></div><divclass="block"><h3class="sidebar-title"><ahref="#trait-implementations">Trait Implementations</a></h3><ul><li><ahref="#impl-IdentityPolicy">IdentityPolicy</a></li></ul></div><divclass="block"><h3class="sidebar-title"><ahref="#synthetic-implementations">Auto Trait Implementations</a></h3><ul><li><ahref="#impl-RefUnwindSafe">RefUnwindSafe</a></li><li><ahref="#impl-Send">!Send</a></li><li><ahref="#impl-Sync">!Sync</a></li><li><ahref="#impl-Unpin">Unpin</a></li><li><ahref="#impl-UnwindSafe">UnwindSafe</a></li></ul></div><divclass="block"><h3class="sidebar-title"><ahref="#blanket-implementations">Blanket Implementations</a></h3><ul><li><ahref="#impl-Any">Any</a></li><li><ahref="#impl-Borrow%3CT%3E">Borrow<T></a></li><li><ahref="#impl-BorrowMut%3CT%3E">BorrowMut<T></a></li><li><ahref="#impl-From%3CT%3E">From<T></a></li><li><ahref="#impl-Instrument">Instrument</a></li><li><ahref="#impl-Into%3CU%3E">Into<U></a></li><li><ahref="#impl-Same%3CT%3E">Same<T></a></li><li><ahref="#impl-TryFrom%3CU%3E">TryFrom<U></a></li><li><ahref="#impl-TryInto%3CU%3E">TryInto<U></a></li><li><ahref="#impl-VZip%3CV%3E">VZip<V></a></li><li><ahref="#impl-WithSubscriber">WithSubscriber</a></li></ul></div></section><h2class="location"><ahref="index.html">In actix_identity</a></h2><divid="sidebar-vars"data-name="CookieIdentityPolicy"data-ty="struct"data-relpath=""></div><scriptdefersrc="sidebar-items.js"></script></div></nav><main><divclass="width-limiter"><divclass="sub-container"><aclass="sub-logo-container"href="../actix_identity/index.html"><imgclass="rust-logo"src="../rust-logo.svg"alt="logo"></a><navclass="sub"><divclass="theme-picker hidden"><buttonid="theme-picker"aria-label="Pick another theme!"aria-haspopup="menu"title="themes"><imgwidth="22"height="22"alt="Pick another theme!"src="../brush.svg"></button><divid="theme-choices"role="menu"></div></div><formclass="search-form"><divclass="search-container"><span></span><inputclass="search-input"name="search"autocomplete="off"spellcheck="false"placeholder="Click or press ‘S’ to search, ‘?’ for more options…"type="search"><buttontype="button"id="help-button"title="help">?</button><aid="settings-menu"href="../settings.html"title="settings"><imgwidth="22"height="22"alt="Change settings"src="../wheel.svg"></a></div></form></nav></div><sectionid="main-content"class="content"><divclass="main-heading">
<h1class="fqn"><spanclass="in-band">Struct <ahref="index.html">actix_identity</a>::<wbr><aclass="struct"href="#">CookieIdentityPolicy</a><buttonid="copy-path"onclick="copy_path(this)"title="Copy item path to clipboard"><imgsrc="../clipboard.svg"width="19"height="18"alt="Copy item path"></button></span></h1><spanclass="out-of-band"><aclass="srclink"href="../src/actix_identity/cookie.rs.html#208">source</a> · <aid="toggle-all-docs"href="javascript:void(0)"title="collapse all docs">[<spanclass="inner">−</span>]</a></span></div><divclass="docblock item-decl"><preclass="rust struct"><code>pub struct CookieIdentityPolicy(_);</code></pre></div><detailsclass="rustdoc-toggle top-doc"open><summaryclass="hideme"><span>Expand description</span></summary><divclass="docblock"><p>Use cookies for request identity storage.</p>
<h1class="fqn"><spanclass="in-band">Struct <ahref="index.html">actix_identity</a>::<wbr><aclass="struct"href="#">CookieIdentityPolicy</a><buttonid="copy-path"onclick="copy_path(this)"title="Copy item path to clipboard"><imgsrc="../clipboard.svg"width="19"height="18"alt="Copy item path"></button></span></h1><spanclass="out-of-band"><aclass="srclink"href="../src/actix_identity/cookie.rs.html#207">source</a> · <aid="toggle-all-docs"href="javascript:void(0)"title="collapse all docs">[<spanclass="inner">−</span>]</a></span></div><divclass="docblock item-decl"><preclass="rust struct"><code>pub struct CookieIdentityPolicy(_);</code></pre></div><detailsclass="rustdoc-toggle top-doc"open><summaryclass="hideme"><span>Expand description</span></summary><divclass="docblock"><p>Use cookies for request identity storage.</p>
<p><ahref="mdn-cookies">See this page on MDN</a> for details on cookie attributes.</p>
<p>Key argument is the private key for issued cookies. If this value is changed, all issued
cookie identities are invalidated.</p>
<h5id="panics"><ahref="#panics">Panics</a></h5>
<p>Panics if <code>key</code> is less than 32 bytes in length..</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.name"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/actix_identity/cookie.rs.html#223-226">source</a></span><ahref="#method.name"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.name"class="fnname">name</a>(self, value: impl <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><<aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html"title="struct alloc::string::String">String</a>>) -><aclass="struct"href="struct.CookieIdentityPolicy.html"title="struct actix_identity::CookieIdentityPolicy">CookieIdentityPolicy</a></h4></section></summary><divclass="docblock"><p>Sets the name of issued cookies.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.path"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/actix_identity/cookie.rs.html#229-232">source</a></span><ahref="#method.path"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.path"class="fnname">path</a>(self, value: impl <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><<aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html"title="struct alloc::string::String">String</a>>) -><aclass="struct"href="struct.CookieIdentityPolicy.html"title="struct actix_identity::CookieIdentityPolicy">CookieIdentityPolicy</a></h4></section></summary><divclass="docblock"><p>Sets the <code>Path</code> attribute of issued cookies.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.domain"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/actix_identity/cookie.rs.html#235-238">source</a></span><ahref="#method.domain"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.domain"class="fnname">domain</a>(self, value: impl <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><<aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html"title="struct alloc::string::String">String</a>>) -><aclass="struct"href="struct.CookieIdentityPolicy.html"title="struct actix_identity::CookieIdentityPolicy">CookieIdentityPolicy</a></h4></section></summary><divclass="docblock"><p>Sets the <code>Domain</code> attribute of issued cookies.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.secure"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/actix_identity/cookie.rs.html#241-244">source</a></span><ahref="#method.secure"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.secure"class="fnname">secure</a>(self, value: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -><aclass="struct"href="struct.CookieIdentityPolicy.html"title="struct actix_identity::CookieIdentityPolicy">CookieIdentityPolicy</a></h4></section></summary><divclass="docblock"><p>Sets the <code>Secure</code> attribute of issued cookies.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.max_age"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/actix_identity/cookie.rs.html#247-250">source</a></span><ahref="#method.max_age"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.max_age"class="fnname">max_age</a>(self, value: Duration) -><aclass="struct"href="struct.CookieIdentityPolicy.html"title="struct actix_identity::CookieIdentityPolicy">CookieIdentityPolicy</a></h4></section></summary><divclass="docblock"><p>Sets the <code>Max-Age</code> attribute of issued cookies.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.max_age_secs"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/actix_identity/cookie.rs.html#253-255">source</a></span><ahref="#method.max_age_secs"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.max_age_secs"class="fnname">max_age_secs</a>(self, seconds: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a>) -><aclass="struct"href="struct.CookieIdentityPolicy.html"title="struct actix_identity::CookieIdentityPolicy">CookieIdentityPolicy</a></h4></section></summary><divclass="docblock"><p>Sets the <code>Max-Age</code> attribute of issued cookies with given number of seconds.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.http_only"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/actix_identity/cookie.rs.html#260-263">source</a></span><ahref="#method.http_only"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.http_only"class="fnname">http_only</a>(self, http_only: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -> Self</h4></section></summary><divclass="docblock"><p>Sets the <code>HttpOnly</code> attribute of issued cookies.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.name"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/actix_identity/cookie.rs.html#222-225">source</a></span><ahref="#method.name"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.name"class="fnname">name</a>(self, value: impl <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><<aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html"title="struct alloc::string::String">String</a>>) -><aclass="struct"href="struct.CookieIdentityPolicy.html"title="struct actix_identity::CookieIdentityPolicy">CookieIdentityPolicy</a></h4></section></summary><divclass="docblock"><p>Sets the name of issued cookies.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.path"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/actix_identity/cookie.rs.html#228-231">source</a></span><ahref="#method.path"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.path"class="fnname">path</a>(self, value: impl <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><<aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html"title="struct alloc::string::String">String</a>>) -><aclass="struct"href="struct.CookieIdentityPolicy.html"title="struct actix_identity::CookieIdentityPolicy">CookieIdentityPolicy</a></h4></section></summary><divclass="docblock"><p>Sets the <code>Path</code> attribute of issued cookies.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.domain"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/actix_identity/cookie.rs.html#234-237">source</a></span><ahref="#method.domain"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.domain"class="fnname">domain</a>(self, value: impl <aclass="trait"href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html"title="trait core::convert::Into">Into</a><<aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html"title="struct alloc::string::String">String</a>>) -><aclass="struct"href="struct.CookieIdentityPolicy.html"title="struct actix_identity::CookieIdentityPolicy">CookieIdentityPolicy</a></h4></section></summary><divclass="docblock"><p>Sets the <code>Domain</code> attribute of issued cookies.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.secure"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/actix_identity/cookie.rs.html#240-243">source</a></span><ahref="#method.secure"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.secure"class="fnname">secure</a>(self, value: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -><aclass="struct"href="struct.CookieIdentityPolicy.html"title="struct actix_identity::CookieIdentityPolicy">CookieIdentityPolicy</a></h4></section></summary><divclass="docblock"><p>Sets the <code>Secure</code> attribute of issued cookies.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.max_age"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/actix_identity/cookie.rs.html#246-249">source</a></span><ahref="#method.max_age"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.max_age"class="fnname">max_age</a>(self, value: Duration) -><aclass="struct"href="struct.CookieIdentityPolicy.html"title="struct actix_identity::CookieIdentityPolicy">CookieIdentityPolicy</a></h4></section></summary><divclass="docblock"><p>Sets the <code>Max-Age</code> attribute of issued cookies.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.max_age_secs"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/actix_identity/cookie.rs.html#252-254">source</a></span><ahref="#method.max_age_secs"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.max_age_secs"class="fnname">max_age_secs</a>(self, seconds: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.i64.html">i64</a>) -><aclass="struct"href="struct.CookieIdentityPolicy.html"title="struct actix_identity::CookieIdentityPolicy">CookieIdentityPolicy</a></h4></section></summary><divclass="docblock"><p>Sets the <code>Max-Age</code> attribute of issued cookies with given number of seconds.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.http_only"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/actix_identity/cookie.rs.html#259-262">source</a></span><ahref="#method.http_only"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.http_only"class="fnname">http_only</a>(self, http_only: <aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a>) -> Self</h4></section></summary><divclass="docblock"><p>Sets the <code>HttpOnly</code> attribute of issued cookies.</p>
<p>By default, the <code>HttpOnly</code> attribute is omitted from issued cookies.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.same_site"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/actix_identity/cookie.rs.html#268-271">source</a></span><ahref="#method.same_site"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.same_site"class="fnname">same_site</a>(self, same_site: <aclass="enum"href="https://docs.rs/cookie/0.16/cookie/draft/enum.SameSite.html"title="enum cookie::draft::SameSite">SameSite</a>) -> Self</h4></section></summary><divclass="docblock"><p>Sets the <code>SameSite</code> attribute of issued cookies.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.same_site"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/actix_identity/cookie.rs.html#267-270">source</a></span><ahref="#method.same_site"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.same_site"class="fnname">same_site</a>(self, same_site: <aclass="enum"href="https://docs.rs/cookie/0.16/cookie/draft/enum.SameSite.html"title="enum cookie::draft::SameSite">SameSite</a>) -> Self</h4></section></summary><divclass="docblock"><p>Sets the <code>SameSite</code> attribute of issued cookies.</p>
<p>By default, the <code>SameSite</code> attribute is omitted from issued cookies.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.visit_deadline"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/actix_identity/cookie.rs.html#280-283">source</a></span><ahref="#method.visit_deadline"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.visit_deadline"class="fnname">visit_deadline</a>(self, deadline: Duration) -><aclass="struct"href="struct.CookieIdentityPolicy.html"title="struct actix_identity::CookieIdentityPolicy">CookieIdentityPolicy</a></h4></section></summary><divclass="docblock"><p>Accepts only users who have visited within given deadline.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.visit_deadline"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/actix_identity/cookie.rs.html#279-282">source</a></span><ahref="#method.visit_deadline"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.visit_deadline"class="fnname">visit_deadline</a>(self, deadline: Duration) -><aclass="struct"href="struct.CookieIdentityPolicy.html"title="struct actix_identity::CookieIdentityPolicy">CookieIdentityPolicy</a></h4></section></summary><divclass="docblock"><p>Accepts only users who have visited within given deadline.</p>
<p>In other words, invalidate a login after some amount of inactivity. Using this feature
causes updated cookies to be issued on each response in order to record the user’s last
visitation timestamp.</p>
<p>By default, visit deadline is disabled.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.login_deadline"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/actix_identity/cookie.rs.html#293-296">source</a></span><ahref="#method.login_deadline"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.login_deadline"class="fnname">login_deadline</a>(self, deadline: Duration) -><aclass="struct"href="struct.CookieIdentityPolicy.html"title="struct actix_identity::CookieIdentityPolicy">CookieIdentityPolicy</a></h4></section></summary><divclass="docblock"><p>Accepts only users who authenticated within the given deadline.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.login_deadline"class="method has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/actix_identity/cookie.rs.html#292-295">source</a></span><ahref="#method.login_deadline"class="anchor"></a><h4class="code-header">pub fn <ahref="#method.login_deadline"class="fnname">login_deadline</a>(self, deadline: Duration) -><aclass="struct"href="struct.CookieIdentityPolicy.html"title="struct actix_identity::CookieIdentityPolicy">CookieIdentityPolicy</a></h4></section></summary><divclass="docblock"><p>Accepts only users who authenticated within the given deadline.</p>
<p>In other words, invalidate a login after some amount of time, regardless of activity.
While <ahref="struct.CookieIdentityPolicy.html#method.max_age"><code>Max-Age</code></a> is useful in constraining the cookie
lifetime, it could be extended manually; using this feature encodes the deadline directly
into the issued cookies, making it immutable to users.</p>
<p>By default, login deadline is disabled.</p>
</div></details></div></details></div><h2id="trait-implementations"class="small-section-header">Trait Implementations<ahref="#trait-implementations"class="anchor"></a></h2><divid="trait-implementations-list"><detailsclass="rustdoc-toggle implementors-toggle"open><summary><sectionid="impl-IdentityPolicy"class="impl has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/actix_identity/cookie.rs.html#303-367">source</a></span><ahref="#impl-IdentityPolicy"class="anchor"></a><h3class="code-header in-band">impl <aclass="trait"href="trait.IdentityPolicy.html"title="trait actix_identity::IdentityPolicy">IdentityPolicy</a> for <aclass="struct"href="struct.CookieIdentityPolicy.html"title="struct actix_identity::CookieIdentityPolicy">CookieIdentityPolicy</a></h3></section></summary><divclass="impl-items"><detailsclass="rustdoc-toggle"open><summary><sectionid="associatedtype.Future"class="type trait-impl has-srclink"><ahref="#associatedtype.Future"class="anchor"></a><h4class="code-header">type <ahref="trait.IdentityPolicy.html#associatedtype.Future"class="associatedtype">Future</a> = Ready<Result<<aclass="enum"href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html"title="enum core::option::Option">Option</a><<aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html"title="struct alloc::string::String">String</a>>, Error>></h4></section></summary><divclass='docblock'><p>The return type of the middleware</p>
</div></details></div></details></div><h2id="trait-implementations"class="small-section-header">Trait Implementations<ahref="#trait-implementations"class="anchor"></a></h2><divid="trait-implementations-list"><detailsclass="rustdoc-toggle implementors-toggle"open><summary><sectionid="impl-IdentityPolicy"class="impl has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/actix_identity/cookie.rs.html#302-366">source</a></span><ahref="#impl-IdentityPolicy"class="anchor"></a><h3class="code-header in-band">impl <aclass="trait"href="trait.IdentityPolicy.html"title="trait actix_identity::IdentityPolicy">IdentityPolicy</a> for <aclass="struct"href="struct.CookieIdentityPolicy.html"title="struct actix_identity::CookieIdentityPolicy">CookieIdentityPolicy</a></h3></section></summary><divclass="impl-items"><detailsclass="rustdoc-toggle"open><summary><sectionid="associatedtype.Future"class="type trait-impl has-srclink"><ahref="#associatedtype.Future"class="anchor"></a><h4class="code-header">type <ahref="trait.IdentityPolicy.html#associatedtype.Future"class="associatedtype">Future</a> = Ready<Result<<aclass="enum"href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html"title="enum core::option::Option">Option</a><<aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html"title="struct alloc::string::String">String</a>>, Error>></h4></section></summary><divclass='docblock'><p>The return type of the middleware</p>
</div></details><detailsclass="rustdoc-toggle"open><summary><sectionid="associatedtype.ResponseFuture"class="type trait-impl has-srclink"><ahref="#associatedtype.ResponseFuture"class="anchor"></a><h4class="code-header">type <ahref="trait.IdentityPolicy.html#associatedtype.ResponseFuture"class="associatedtype">ResponseFuture</a> = Ready<Result<<aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, Error>></h4></section></summary><divclass='docblock'><p>The return type of the middleware</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.from_request"class="method trait-impl has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/actix_identity/cookie.rs.html#307-322">source</a></span><ahref="#method.from_request"class="anchor"></a><h4class="code-header">fn <ahref="trait.IdentityPolicy.html#tymethod.from_request"class="fnname">from_request</a>(&self, req: &mut ServiceRequest) -> Self::<aclass="associatedtype"href="trait.IdentityPolicy.html#associatedtype.Future"title="type actix_identity::IdentityPolicy::Future">Future</a></h4></section></summary><divclass='docblock'><p>Parse the session from request and load data from a service identity.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.from_request"class="method trait-impl has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/actix_identity/cookie.rs.html#306-321">source</a></span><ahref="#method.from_request"class="anchor"></a><h4class="code-header">fn <ahref="trait.IdentityPolicy.html#tymethod.from_request"class="fnname">from_request</a>(&self, req: &mut ServiceRequest) -> Self::<aclass="associatedtype"href="trait.IdentityPolicy.html#associatedtype.Future"title="type actix_identity::IdentityPolicy::Future">Future</a></h4></section></summary><divclass='docblock'><p>Parse the session from request and load data from a service identity.</p>
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.with_current_subscriber"class="method trait-impl has-srclink"><spanclass="rightside"><aclass="srclink"href="https://docs.rs/tracing/0.1.32/src/tracing/instrument.rs.html#221">source</a></span><ahref="#method.with_current_subscriber"class="anchor"></a><h4class="code-header">fn <ahref="https://docs.rs/tracing/0.1.32/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber"class="fnname">with_current_subscriber</a>(self) -><aclass="struct"href="https://docs.rs/tracing/0.1.32/tracing/instrument/struct.WithDispatch.html"title="struct tracing::instrument::WithDispatch">WithDispatch</a><Self></h4></section></summary><divclass='docblock'><p>Attaches the current <ahref="https://docs.rs/tracing/0.1.32/tracing/dispatcher/index.html#setting-the-default-subscriber">default</a><ahref="https://docs.rs/tracing-core/0.1.22/tracing_core/subscriber/trait.Subscriber.html"><code>Subscriber</code></a> to this type, returning a
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.with_current_subscriber"class="method trait-impl has-srclink"><spanclass="rightside"><aclass="srclink"href="https://docs.rs/tracing/0.1.32/src/tracing/instrument.rs.html#221">source</a></span><ahref="#method.with_current_subscriber"class="anchor"></a><h4class="code-header">fn <ahref="https://docs.rs/tracing/0.1.32/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber"class="fnname">with_current_subscriber</a>(self) -><aclass="struct"href="https://docs.rs/tracing/0.1.32/tracing/instrument/struct.WithDispatch.html"title="struct tracing::instrument::WithDispatch">WithDispatch</a><Self></h4></section></summary><divclass='docblock'><p>Attaches the current <ahref="https://docs.rs/tracing/0.1.32/tracing/dispatcher/index.html#setting-the-default-subscriber">default</a><ahref="https://docs.rs/tracing-core/0.1.22/tracing_core/subscriber/trait.Subscriber.html"><code>Subscriber</code></a> to this type, returning a
</div></details><detailsclass="rustdoc-toggle method-toggle"open><summary><sectionid="method.with_current_subscriber"class="method trait-impl has-srclink"><spanclass="rightside"><aclass="srclink"href="https://docs.rs/tracing/0.1.32/src/tracing/instrument.rs.html#221">source</a></span><ahref="#method.with_current_subscriber"class="anchor"></a><h4class="code-header">fn <ahref="https://docs.rs/tracing/0.1.32/tracing/instrument/trait.WithSubscriber.html#method.with_current_subscriber"class="fnname">with_current_subscriber</a>(self) -><aclass="struct"href="https://docs.rs/tracing/0.1.32/tracing/instrument/struct.WithDispatch.html"title="struct tracing::instrument::WithDispatch">WithDispatch</a><Self></h4></section></summary><divclass='docblock'><p>Attaches the current <ahref="https://docs.rs/tracing/0.1.32/tracing/dispatcher/index.html#setting-the-default-subscriber">default</a><ahref="https://docs.rs/tracing-core/0.1.22/tracing_core/subscriber/trait.Subscriber.html"><code>Subscriber</code></a> to this type, returning a
</div></details><detailsclass="rustdoc-toggle"open><summary><divid="associatedtype.ResponseFuture"class="method has-srclink"><divclass="rightside"><aclass="srclink"href="../src/actix_identity/lib.rs.html#76">source</a></div><h4class="code-header">type <ahref="#associatedtype.ResponseFuture"class="associatedtype">ResponseFuture</a>: <aclass="trait"href="https://doc.rust-lang.org/nightly/core/future/future/trait.Future.html"title="trait core::future::future::Future">Future</a><Output = Result<<aclass="primitive"href="https://doc.rust-lang.org/nightly/std/primitive.unit.html">()</a>, Error>></h4></div></summary><divclass="docblock"><p>The return type of the middleware</p>
</div></details></div><h2id="required-methods"class="small-section-header">Required methods<ahref="#required-methods"class="anchor"></a></h2><divclass="methods"><detailsclass="rustdoc-toggle"open><summary><divid="tymethod.from_request"class="method has-srclink"><divclass="rightside"><aclass="srclink"href="../src/actix_identity/lib.rs.html#80">source</a></div><h4class="code-header">fn <ahref="#tymethod.from_request"class="fnname">from_request</a>(&self, req: &mut ServiceRequest) -> Self::<aclass="associatedtype"href="trait.IdentityPolicy.html#associatedtype.Future"title="type actix_identity::IdentityPolicy::Future">Future</a></h4></div></summary><divclass="docblock"><p>Parse the session from request and load data from a service identity.</p>
}</code></pre></div><detailsclass="rustdoc-toggle top-doc"open><summaryclass="hideme"><span>Expand description</span></summary><divclass="docblock"><p>Helper trait that allows to get Identity.</p>
<p>It could be used in middleware but identity policy must be set before any other middleware that
needs identity. RequestIdentity is implemented both for <code>ServiceRequest</code> and <code>HttpRequest</code>.</p>
</div></details><h2id="required-methods"class="small-section-header">Required methods<ahref="#required-methods"class="anchor"></a></h2><divclass="methods"><divid="tymethod.get_identity"class="method has-srclink"><divclass="rightside"><aclass="srclink"href="../src/actix_identity/lib.rs.html#96">source</a></div><h4class="code-header">fn <ahref="#tymethod.get_identity"class="fnname">get_identity</a>(&self) -><aclass="enum"href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html"title="enum core::option::Option">Option</a><<aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html"title="struct alloc::string::String">String</a>></h4></div></div><h2id="implementors"class="small-section-header">Implementors<ahref="#implementors"class="anchor"></a></h2><divclass="item-list"id="implementors-list"><sectionid="impl-RequestIdentity"class="impl has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/actix_identity/lib.rs.html#99-106">source</a></span><ahref="#impl-RequestIdentity"class="anchor"></a><h3class="code-header in-band">impl<T><aclass="trait"href="trait.RequestIdentity.html"title="trait actix_identity::RequestIdentity">RequestIdentity</a> for T <spanclass="where fmt-newline">where<br> T: HttpMessage, </span></h3></section></div><scripttype="text/javascript"src="../implementors/actix_identity/trait.RequestIdentity.js"async></script></section><sectionid="search"class="content hidden"></section></div></main><divid="rustdoc-vars"data-root-path="../"data-current-crate="actix_identity"data-themes="ayu,dark,light"data-resource-suffix=""data-rustdoc-version="1.61.0-nightly (ab0c2e18d 2022-03-27)"></div>
</div></details><h2id="required-methods"class="small-section-header">Required methods<ahref="#required-methods"class="anchor"></a></h2><divclass="methods"><divid="tymethod.get_identity"class="method has-srclink"><divclass="rightside"><aclass="srclink"href="../src/actix_identity/lib.rs.html#96">source</a></div><h4class="code-header">fn <ahref="#tymethod.get_identity"class="fnname">get_identity</a>(&self) -><aclass="enum"href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html"title="enum core::option::Option">Option</a><<aclass="struct"href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html"title="struct alloc::string::String">String</a>></h4></div></div><h2id="implementors"class="small-section-header">Implementors<ahref="#implementors"class="anchor"></a></h2><divclass="item-list"id="implementors-list"><sectionid="impl-RequestIdentity"class="impl has-srclink"><spanclass="rightside"><aclass="srclink"href="../src/actix_identity/lib.rs.html#99-106">source</a></span><ahref="#impl-RequestIdentity"class="anchor"></a><h3class="code-header in-band">impl<T><aclass="trait"href="trait.RequestIdentity.html"title="trait actix_identity::RequestIdentity">RequestIdentity</a> for T <spanclass="where fmt-newline">where<br> T: HttpMessage, </span></h3></section></div><scripttype="text/javascript"src="../implementors/actix_identity/trait.RequestIdentity.js"async></script></section><sectionid="search"class="content hidden"></section></div></main><divid="rustdoc-vars"data-root-path="../"data-current-crate="actix_identity"data-themes="ayu,dark,light"data-resource-suffix=""data-rustdoc-version="1.61.0-nightly (ee915c34e 2022-03-28)"></div>
</body></html>
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.