Skip to content

Latest commit

 

History

History
30 lines (19 loc) · 761 Bytes

File metadata and controls

30 lines (19 loc) · 761 Bytes

API Reference

This document provides detailed documentation for the pentest library.

Table of Contents

Core Components

Parser Module

The parser module handles parsing OpenAPI/Swagger specifications.

OpenAPIParser

from pentestkit.parser import OpenAPIParser

parser = OpenAPIParser(source="swagger.json")
endpoints = parser.parse("swagger.json")
base_url = parser.get_base_url()

Methods:

  • parse(source: str) -> List[Endpoint]: Parse API specification from a URL or file path
  • get_format() -> SpecFormat: Get the format of the specification (OpenAPI v2 or v3)
  • get_base_url() -> Optional[str]: Get the base URL from the specification