pyoaev.client
Module Contents
- pyoaev.client.REDIRECT_MSG = 'pyoaev detected a {status_code} ({reason!r}) redirection. You must update your OpenAEV URL to...
- class pyoaev.client.OpenAEV(url: str, token: str, timeout: float | None = None, per_page: int | None = None, pagination: str | None = None, order_by: str | None = None, ssl_verify: bool | str = True, **kwargs: Any)
- url
- timeout = None
- headers
- ssl_verify = True
- backend
- _auth
- session
- per_page = None
- pagination = None
- order_by = None
- me
- organization
- injector
- collector
- cve
- inject
- injector_contract
- document
- kill_chain_phase
- attack_pattern
- team
- endpoint
- user
- inject_expectation
- payload
- security_platform
- inject_expectation_trace
- tag
- static _check_redirects(result: requests.Response) None
- _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
- _get_session_opts() Dict[str, Any]
- http_request(verb: str, path: str, query_data: Dict[str, Any] | None = None, post_data: Dict[str, Any] | bytes | BinaryIO | None = None, raw: bool = False, streamed: bool = False, files: Dict[str, Any] | None = None, timeout: float | None = 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
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
- http_get(path: str, query_data: Dict[str, Any] | None = None, streamed: bool = False, raw: bool = False, **kwargs: Any) Dict[str, Any] | requests.Response
- http_head(path: str, query_data: Dict[str, Any] | None = None, **kwargs: Any) requests.structures.CaseInsensitiveDict[Any]
- http_post(path: str, query_data: Dict[str, Any] | None = None, post_data: Dict[str, Any] | None = None, raw: bool = False, files: Dict[str, Any] | None = None, **kwargs: Any) Dict[str, Any] | requests.Response
- http_put(path: str, query_data: Dict[str, Any] | None = None, post_data: Dict[str, Any] | bytes | BinaryIO | None = None, raw: bool = False, files: Dict[str, Any] | None = None, **kwargs: Any) Dict[str, Any] | requests.Response
- http_patch(path: str, *, query_data: Dict[str, Any] | None = None, post_data: Dict[str, Any] | bytes | None = None, raw: bool = False, **kwargs: Any) Dict[str, Any] | requests.Response
- http_delete(path: str, **kwargs: Any) requests.Response
- http_list(path: str, query_data: Dict[str, Any] | None = None, *, iterator: bool | None = None, **kwargs: Any) OpenAEVList | List[Dict[str, Any]]
- class pyoaev.client.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.
- _openaev
- _kwargs
- _get_next = True
- _query(url: str, query_data: Dict[str, Any] | None = None, **kwargs: Any) None
- property current_page: int
The current page number.
- property prev_page: int | None
The previous page number.
If None, the current page is the first.
- property next_page: int | None
The next page number.
If None, the current page is the last.
- property per_page: int | None
The number of items per page.
- property total_pages: int | None
The total number of pages.
- property total: int | None
The total number of items.
- next() Dict[str, Any]