pyoaev.client ============= .. py:module:: pyoaev.client Module Contents --------------- .. py:data:: REDIRECT_MSG :value: 'pyoaev detected a {status_code} ({reason!r}) redirection. You must update your OpenAEV URL to... .. py:class:: OpenAEV(url: str, token: str, timeout: Optional[float] = None, per_page: Optional[int] = None, pagination: Optional[str] = None, order_by: Optional[str] = None, ssl_verify: Union[bool, str] = True, **kwargs: Any) .. py:attribute:: url .. py:attribute:: timeout :value: None .. py:attribute:: headers .. py:attribute:: ssl_verify :value: True .. py:attribute:: backend .. py:attribute:: _auth .. py:attribute:: session .. py:attribute:: per_page :value: None .. py:attribute:: pagination :value: None .. py:attribute:: order_by :value: None .. py:attribute:: me .. py:attribute:: organization .. py:attribute:: injector .. py:attribute:: collector .. py:attribute:: cve .. py:attribute:: inject .. py:attribute:: injector_contract .. py:attribute:: document .. py:attribute:: kill_chain_phase .. py:attribute:: attack_pattern .. py:attribute:: team .. py:attribute:: endpoint .. py:attribute:: user .. py:attribute:: inject_expectation .. py:attribute:: payload .. py:attribute:: security_platform .. py:attribute:: inject_expectation_trace .. py:attribute:: tag .. py:method:: _check_redirects(result: requests.Response) -> None :staticmethod: .. py:method:: _build_url(path: str) -> str Returns the full url from path. If path is already a url, return it unchanged. If it's a path, append it to the stored url. Returns: The full URL .. py:method:: _get_session_opts() -> Dict[str, Any] .. py:method:: http_request(verb: str, path: str, query_data: Optional[Dict[str, Any]] = None, post_data: Optional[Union[Dict[str, Any], bytes, BinaryIO]] = None, raw: bool = False, streamed: bool = False, files: Optional[Dict[str, Any]] = None, timeout: Optional[float] = None, **kwargs: Any) -> requests.Response Make an HTTP request to the OpenAEV server. Args: verb: The HTTP method to call ('get', 'post', 'put', 'delete') path: Path or full URL to query ('/projects' or 'http://whatever/v4/api/projecs') query_data: Data to send as query parameters post_data: Data to send in the body (will be converted to json by default) raw: If True, do not convert post_data to json streamed: Whether the data should be streamed files: The files to send to the server timeout: The timeout, in seconds, for the request **kwargs: Extra options to send to the server (e.g. sudo) Returns: A requests result object. Raises: OpenAEVHttpError: When the return code is not 2xx .. py:method:: http_get(path: str, query_data: Optional[Dict[str, Any]] = None, streamed: bool = False, raw: bool = False, **kwargs: Any) -> Union[Dict[str, Any], requests.Response] .. py:method:: http_head(path: str, query_data: Optional[Dict[str, Any]] = None, **kwargs: Any) -> requests.structures.CaseInsensitiveDict[Any] .. py:method:: http_post(path: str, query_data: Optional[Dict[str, Any]] = None, post_data: Optional[Dict[str, Any]] = None, raw: bool = False, files: Optional[Dict[str, Any]] = None, **kwargs: Any) -> Union[Dict[str, Any], requests.Response] .. py:method:: http_put(path: str, query_data: Optional[Dict[str, Any]] = None, post_data: Optional[Union[Dict[str, Any], bytes, BinaryIO]] = None, raw: bool = False, files: Optional[Dict[str, Any]] = None, **kwargs: Any) -> Union[Dict[str, Any], requests.Response] .. py:method:: http_patch(path: str, *, query_data: Optional[Dict[str, Any]] = None, post_data: Optional[Union[Dict[str, Any], bytes]] = None, raw: bool = False, **kwargs: Any) -> Union[Dict[str, Any], requests.Response] .. py:method:: http_delete(path: str, **kwargs: Any) -> requests.Response .. py:method:: http_list(path: str, query_data: Optional[Dict[str, Any]] = None, *, iterator: Optional[bool] = None, **kwargs: Any) -> Union[OpenAEVList, List[Dict[str, Any]]] .. py:class:: OpenAEVList(openaev: OpenAEV, url: str, query_data: Dict[str, Any], get_next: bool = True, **kwargs: Any) Generator representing a list of remote objects. The object handles the links returned by a query to the API, and will call the API again when needed. .. py:attribute:: _openaev .. py:attribute:: _kwargs .. py:attribute:: _get_next :value: True .. py:method:: _query(url: str, query_data: Optional[Dict[str, Any]] = None, **kwargs: Any) -> None .. py:property:: current_page :type: int The current page number. .. py:property:: prev_page :type: Optional[int] The previous page number. If None, the current page is the first. .. py:property:: next_page :type: Optional[int] The next page number. If None, the current page is the last. .. py:property:: per_page :type: Optional[int] The number of items per page. .. py:property:: total_pages :type: Optional[int] The total number of pages. .. py:property:: total :type: Optional[int] The total number of items. .. py:method:: next() -> Dict[str, Any]