<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"><spanclass="pre">class</span></em><codeclass="sig-prename descclassname"><spanclass="pre">vmware.vapi.vmc.csp_filter.</span></code><codeclass="sig-name descname"><spanclass="pre">CSPSecurityContextFilter</span></code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">session</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">refresh_token</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">refresh_url</span></span></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"><spanclass="pre">get_max_retries</span></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"><spanclass="pre">get_security_context</span></code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">on_error</span></span></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"><spanclass="pre">should_retry</span></code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">error_value</span></span></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