Expand description
§hackerone-api
Unofficial, dependency-light Rust client for the HackerOne API (v1).
Built for the boring, reliable half of bug-bounty tooling: list your programs, pull scopes, read reports, file reports, comment, and change state — with HTTP Basic auth and no async runtime.
use hackerone_api::{Client, ReportQuery};
fn main() -> Result<(), hackerone_api::Error> {
let client = Client::new("api-identifier", "api-token");
for program in client.programs()?.items() {
println!("{:?}", program.handle);
}
let reports = client
.reports(&ReportQuery::new().state("new").page(1, 25))?
.into_items();
println!("{} new reports", reports.len());
Ok(())
}§Auth
The API uses HTTP Basic auth: the username is your API token identifier and the password is the token value. Create one in your HackerOne account settings.
§Design
- Blocking, no async runtime.
urequnder the hood. - Injectable transport. The client is generic over
Transport, so tests use a mock and embedders can swap the HTTP stack. - Forward-compatible types. Domain structs keep the documented fields
and stash unknown ones in a flattened
extramap.
§Disclaimer
This crate is unofficial and not affiliated with or endorsed by HackerOne. “HackerOne” is a trademark of its owner; the name is used only to describe what the library talks to.
Structs§
- ApiError
- A single entry from the HackerOne API’s
errorsarray. - Client
- A HackerOne API client.
- Collection
Doc - A collection response (
GET /v1/reports,GET /v1/me/programs, …). - Create
Report - A report to create. Build it with the chainable methods, then
Client::create_report. - Links
- JSON:API
linksobject (pagination URLs). - Meta
- JSON:API
metaobject, kept loose. - Page
- A decoded page: the items plus the links needed to fetch more.
- Program
- See the HackerOne API reference for
Program. - Report
- See the HackerOne API reference for
Report. - Report
Query - Filters for
Client::reports. - Request
- A fully-built request handed to a
Transport. - Resource
- A single JSON:API resource: id + type + attributes.
- Response
- A raw HTTP response.
- Severity
- See the HackerOne API reference for
Severity. - Single
Doc - A single-object response (
GET /v1/me,GET /v1/reports/{id}, …). - Structured
Scope - See the HackerOne API reference for
StructuredScope. - Ureq
Transport - Default transport backed by blocking
ureq. - User
- See the HackerOne API reference for
User. - Weakness
- See the HackerOne API reference for
Weakness.
Enums§
- Error
- Everything that can go wrong talking to the HackerOne API.
- Method
- HTTP method.
- Report
State - Report states accepted by a state change.
- Severity
Rating - Severity rating supplied when creating a report.
Constants§
- DEFAULT_
BASE_ URL - Default API root.
Traits§
Type Aliases§
- Result
- Convenience alias.