vmware.vapi.vmc package¶
Submodules¶
vmware.vapi.vmc.client module¶
vmware.vapi.vmc.csp_filter module¶
CSP Refresh token based SecurityContextFilter
-
class
vmware.vapi.vmc.csp_filter.CSPSecurityContextFilter(session, refresh_token, refresh_url)¶ Bases:
vmware.vapi.security.client.security_context_filter.SecurityContextFilterCSP Security Context filter in API Provider chain adds the security context based on a refresh token to the execution context passed in.
Initialize SecurityContextFilter
Parameters: - session (
requests.Session) – Requests Session object to use for making HTTP calls - refresh_token (
str) – Refresh token to use for obtaining an access token - refresh_url (
str) – URL that allows exchanging a refresh token for an access token
-
get_max_retries()¶ Get the max number of retries
Return type: intReturns: Number of retries
-
get_security_context(on_error)¶ 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.
Parameters: on_error ( bool) – Whether this method is called after getting an errorReturn type: vmware.vapi.core.SecurityContextReturns: Security context
-
should_retry(error_value)¶ Returns whether the request should be retried or not based on the error specified.
Parameters: error_value ( vmware.vapi.data.value.ErrorValue) – Method errorReturn type: boolReturns: Returns True if request should be retried in case the error is either Unauthenticated or Unauthorized else False
- session (