MCPcopy Create free account
hub / github.com/TheSecuredAnalyst/security-suite / api_auth_test

Function api_auth_test

cli/main.py:1198–1217  ·  view source on GitHub ↗

Test API authentication security.

(
    spec_url: str = typer.Argument(..., help="URL to OpenAPI/Swagger spec"),
)

Source from the content-addressed store, hash-verified

1196 result = await tester.test_api(api)
1197
1198 display_result(result)
1199
1200 run_async(run())
1201
1202
1203@apisec_app.command("fuzz")
1204def api_fuzz(
1205 spec_url: str = typer.Argument(..., help="URL to OpenAPI/Swagger spec"),
1206 max_requests: int = typer.Option(100, "--max", "-m", help="Maximum requests"),
1207 auth_token: str | None = typer.Option(None, "--token", "-t"),
1208):
1209 """Fuzz API endpoints for vulnerabilities."""
1210 setup_logging()
1211
1212 console.print(f"[bold]API Fuzzing:[/bold] {spec_url}")
1213
1214 async def run():
1215 from modules.apisec import APIFuzzer, OpenAPIParser
1216
1217 parser = OpenAPIParser()
1218 api = await parser.parse_url(spec_url)
1219
1220 fuzzer = APIFuzzer(max_requests=max_requests, auth_token=auth_token)

Callers

nothing calls this directly

Calls 3

setup_loggingFunction · 0.90
run_asyncFunction · 0.85
runFunction · 0.85

Tested by

no test coverage detected