<spanid="vmware-vapi-vmc-package"></span><h1>vmware.vapi.vmc package<aclass="headerlink"href="#module-vmware.vapi.vmc"title="Permalink to this headline">¶</a></h1>
<divclass="section"id="submodules">
<h2>Submodules<aclass="headerlink"href="#submodules"title="Permalink to this headline">¶</a></h2>
<spanid="vmware-vapi-vmc-csp-filter-module"></span><h2>vmware.vapi.vmc.csp_filter module<aclass="headerlink"href="#module-vmware.vapi.vmc.csp_filter"title="Permalink to this headline">¶</a></h2>
<p>CSP Refresh token based SecurityContextFilter</p>
<emclass="property">class </em><codeclass="sig-prename descclassname">vmware.vapi.vmc.csp_filter.</code><codeclass="sig-name descname">CSPSecurityContextFilter</code><spanclass="sig-paren">(</span><emclass="sig-param">session</em>, <emclass="sig-param">refresh_token</em>, <emclass="sig-param">refresh_url</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#vmware.vapi.vmc.csp_filter.CSPSecurityContextFilter"title="Permalink to this definition">¶</a></dt>
<p>CSP Security Context filter in API Provider chain adds the security
context based on a refresh token to the execution context passed in.</p>
<p>Initialize SecurityContextFilter</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>session</strong> (<codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">requests.Session</span></code>) – Requests Session object to use for making HTTP calls</p></li>
<li><p><strong>refresh_token</strong> (<codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">str</span></code>) – Refresh token to use for obtaining an access token</p></li>
<li><p><strong>refresh_url</strong> (<codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">str</span></code>) – URL that allows exchanging a refresh token for an
<codeclass="sig-name descname">get_max_retries</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="headerlink"href="#vmware.vapi.vmc.csp_filter.CSPSecurityContextFilter.get_max_retries"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">get_security_context</code><spanclass="sig-paren">(</span><emclass="sig-param">on_error</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#vmware.vapi.vmc.csp_filter.CSPSecurityContextFilter.get_security_context"title="Permalink to this definition">¶</a></dt>
<dd><p>Retrieve security context. If this method is called after an error
occured, then a new access token is obtained using the refresh token and
a new security context is created.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>on_error</strong> (<codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">bool</span></code>) – Whether this method is called after getting an error</p>
<codeclass="sig-name descname">should_retry</code><spanclass="sig-paren">(</span><emclass="sig-param">error_value</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#vmware.vapi.vmc.csp_filter.CSPSecurityContextFilter.should_retry"title="Permalink to this definition">¶</a></dt>
<dd><p>Returns whether the request should be retried or not based on the error
Built with <ahref="http://sphinx-doc.org/">Sphinx</a> using a <ahref="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <ahref="https://readthedocs.org">Read the Docs</a>.