This is a work in progress and this readme was generated by ChatGPT.
This library provides a simple interface to interact with the HackerOne API. It allows you to retrieve details about programs and their associated weaknesses.
- Authenticate using your HackerOne username and token.
- Retrieve program details.
- Retrieve program weaknesses.
Ensure you have Go installed and set up on your machine. You can install this package by running:
go get github.com/ryanjarv/h1
To create a new HackerOne client, you need to provide your username. The token is optional; if not provided, it will be read from ~/.config/h1_token
.
package main
import (
"github.com/ryanjarv/h1"
"log"
)
func main() {
h1Client := h1.NewHackerone(&h1.NewHackeroneInput{
Username: "your-username",
Token: "your-token", // optional
})
program := h1Client.Program("program-id")
details, err := program.GetDetail()
if err != nil {
log.Fatalf("Error getting program details: %v", err)
}
log.Printf("Program details: %+v", details)
weaknesses, err := program.GetWeaknesses()
if err != nil {
log.Fatalf("Error getting program weaknesses: %v", err)
}
log.Printf("Program weaknesses: %+v", weaknesses)
}
Creates a new HackerOne client.
func NewHackerone(input *NewHackeroneInput) *Hackerone
Returns a new Program object to interact with a specific program.
func (h1 *Hackerone) Program(id string) *Program
Retrieves details about a specific program.
func (h1 *Program) GetDetail() (*h1Types.ProgramDetail, error)
Retrieves weaknesses of a specific program.
func (h1 *Program) GetWeaknesses() (*h1Types.Weaknesses, error)
The authentication token can be stored in ~/.config/h1_token
. If the token is not provided when initializing the client, it will be read from this file.