# github/hackerone-client architecture

> Architecture diagram of the GitHub repository github/hackerone-client, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/github/hackerone-client
- Repository: https://github.com/github/hackerone-client

## Overview

Hackerone::Client is a Ruby API client for managing HackerOne reports and program resources. The main workflow is a caller’s API request to list, create, or fetch reports, followed by report-level triage, assignment, comments, state changes, and bounty or swag operations. A separate program workflow exposes organization assets, scopes, policy, balance, members, and related data. ResourceHelper centralizes HTTP request construction and response parsing for resource objects. Relationships among unsampled resource modules are omitted where the excerpts do not establish calls.

Main entry points: [`lib/hackerone/client/program.rb`](https://github.com/github/hackerone-client/blob/main/lib/hackerone/client/program.rb) (Programs), [`lib/hackerone/client/report.rb`](https://github.com/github/hackerone-client/blob/main/lib/hackerone/client/report.rb) (Reports), [`lib/hackerone/client.rb`](https://github.com/github/hackerone-client/blob/main/lib/hackerone/client.rb) (API client), [`lib/hackerone/client/resource_helper.rb`](https://github.com/github/hackerone-client/blob/main/lib/hackerone/client/resource_helper.rb) (Resource helper)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Client entry"]
  node_api["API client<br/>[client.rb]"]
end

subgraph group_reports["Report workflow"]
  node_report["Reports<br/>[report.rb]"]
  node_activity["Activities<br/>[activity.rb]"]
  node_incremental["Activity traversal<br/>[activities.rb]"]
  node_weakness["Weakness mapping<br/>[weakness.rb]"]
  node_attachment["Attachments<br/>[attachment.rb]"]
  node_bounty["Bounty<br/>[bounty.rb]"]
end

subgraph group_programs["Program resources"]
  node_program["Programs<br/>[program.rb]"]
  node_organization["Organizations<br/>[organization.rb]"]
  node_asset["Assets<br/>[asset.rb]"]
  node_scope["Structured scopes"]
  node_swag["Swag<br/>[swag.rb]"]
  node_balance["Billing balance<br/>[billing_balance.rb]"]
  node_member["Members<br/>[member.rb]"]
  node_group["Groups<br/>[group.rb]"]
  node_reporter["Reporters<br/>[reporter.rb]"]
  node_user["Users<br/>[user.rb]"]
  node_address["Addresses<br/>[address.rb]"]
end

subgraph group_support["Shared resource layer"]
  node_resource["Resource helper<br/>[resource_helper.rb]"]
end

node_caller(("Ruby caller"))
node_hackerone{{"HackerOne API"}}

node_caller -->|"calls"| node_api
node_api -->|"sends requests"| node_hackerone
node_api -->|"builds results"| node_report
node_api -->|"finds program"| node_program
node_report -->|"uses requests"| node_resource
node_program -->|"uses requests"| node_resource
node_program -->|"builds scopes"| node_scope
node_program -->|"builds swag"| node_swag
node_program -->|"builds balance"| node_balance
node_program -->|"builds members"| node_member
node_program -->|"builds groups"| node_group
node_program -->|"builds organization"| node_organization
node_organization -->|"builds assets"| node_asset
node_asset -->|"builds programs"| node_program
node_report -->|"builds activities"| node_activity
node_report -->|"maps weakness"| node_weakness
node_report -->|"builds attachments"| node_attachment
node_report -->|"builds assignee"| node_user
node_activity -->|"builds attachments"| node_attachment
node_incremental -->|"builds activities"| node_activity
node_incremental -->|"fetches pages"| node_resource
node_resource -->|"uses connection"| node_api
node_report -->|"assigns directly"| node_api
node_report -->|"looks up program"| node_program

click node_api "https://github.com/github/hackerone-client/blob/main/lib/hackerone/client.rb"
click node_report "https://github.com/github/hackerone-client/blob/main/lib/hackerone/client/report.rb"
click node_activity "https://github.com/github/hackerone-client/blob/main/lib/hackerone/client/activity.rb"
click node_incremental "https://github.com/github/hackerone-client/blob/main/lib/hackerone/client/incremental/activities.rb"
click node_weakness "https://github.com/github/hackerone-client/blob/main/lib/hackerone/client/weakness.rb"
click node_attachment "https://github.com/github/hackerone-client/blob/main/lib/hackerone/client/attachment.rb"
click node_bounty "https://github.com/github/hackerone-client/blob/main/lib/hackerone/client/bounty.rb"
click node_program "https://github.com/github/hackerone-client/blob/main/lib/hackerone/client/program.rb"
click node_organization "https://github.com/github/hackerone-client/blob/main/lib/hackerone/client/organization.rb"
click node_asset "https://github.com/github/hackerone-client/blob/main/lib/hackerone/client/asset.rb"
click node_scope "https://github.com/github/hackerone-client/blob/main/lib/hackerone/client/structured_scope.rb"
click node_swag "https://github.com/github/hackerone-client/blob/main/lib/hackerone/client/swag.rb"
click node_balance "https://github.com/github/hackerone-client/blob/main/lib/hackerone/client/billing_balance.rb"
click node_member "https://github.com/github/hackerone-client/blob/main/lib/hackerone/client/member.rb"
click node_group "https://github.com/github/hackerone-client/blob/main/lib/hackerone/client/group.rb"
click node_reporter "https://github.com/github/hackerone-client/blob/main/lib/hackerone/client/reporter.rb"
click node_user "https://github.com/github/hackerone-client/blob/main/lib/hackerone/client/user.rb"
click node_address "https://github.com/github/hackerone-client/blob/main/lib/hackerone/client/address.rb"
click node_resource "https://github.com/github/hackerone-client/blob/main/lib/hackerone/client/resource_helper.rb"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_api toneBlue
class node_report,node_activity,node_incremental,node_weakness,node_attachment,node_bounty toneAmber
class node_program,node_organization,node_asset,node_scope,node_swag,node_balance,node_member,node_group,node_reporter,node_user,node_address,node_hackerone toneMint
class node_resource toneRose
class node_caller toneIndigo
```

## Components

### Client entry

- [API client](https://github.com/github/hackerone-client/blob/main/lib/hackerone/client.rb): `lib/hackerone/client.rb`

### Report workflow

- [Reports](https://github.com/github/hackerone-client/blob/main/lib/hackerone/client/report.rb): `lib/hackerone/client/report.rb`
- [Activities](https://github.com/github/hackerone-client/blob/main/lib/hackerone/client/activity.rb): `lib/hackerone/client/activity.rb`
- [Activity traversal](https://github.com/github/hackerone-client/blob/main/lib/hackerone/client/incremental/activities.rb): `lib/hackerone/client/incremental/activities.rb`
- [Weakness mapping](https://github.com/github/hackerone-client/blob/main/lib/hackerone/client/weakness.rb): `lib/hackerone/client/weakness.rb`
- [Attachments](https://github.com/github/hackerone-client/blob/main/lib/hackerone/client/attachment.rb): `lib/hackerone/client/attachment.rb`
- [Bounty](https://github.com/github/hackerone-client/blob/main/lib/hackerone/client/bounty.rb): `lib/hackerone/client/bounty.rb`

### Program resources

- [Programs](https://github.com/github/hackerone-client/blob/main/lib/hackerone/client/program.rb): `lib/hackerone/client/program.rb`
- [Organizations](https://github.com/github/hackerone-client/blob/main/lib/hackerone/client/organization.rb): `lib/hackerone/client/organization.rb`
- [Assets](https://github.com/github/hackerone-client/blob/main/lib/hackerone/client/asset.rb): `lib/hackerone/client/asset.rb`
- [Structured scopes](https://github.com/github/hackerone-client/blob/main/lib/hackerone/client/structured_scope.rb): `lib/hackerone/client/structured_scope.rb`
- [Swag](https://github.com/github/hackerone-client/blob/main/lib/hackerone/client/swag.rb): `lib/hackerone/client/swag.rb`
- [Billing balance](https://github.com/github/hackerone-client/blob/main/lib/hackerone/client/billing_balance.rb): `lib/hackerone/client/billing_balance.rb`
- [Members](https://github.com/github/hackerone-client/blob/main/lib/hackerone/client/member.rb): `lib/hackerone/client/member.rb`
- [Groups](https://github.com/github/hackerone-client/blob/main/lib/hackerone/client/group.rb): `lib/hackerone/client/group.rb`
- [Reporters](https://github.com/github/hackerone-client/blob/main/lib/hackerone/client/reporter.rb): `lib/hackerone/client/reporter.rb`
- [Users](https://github.com/github/hackerone-client/blob/main/lib/hackerone/client/user.rb): `lib/hackerone/client/user.rb`
- [Addresses](https://github.com/github/hackerone-client/blob/main/lib/hackerone/client/address.rb): `lib/hackerone/client/address.rb`

### Shared resource layer

- [Resource helper](https://github.com/github/hackerone-client/blob/main/lib/hackerone/client/resource_helper.rb): `lib/hackerone/client/resource_helper.rb`

### Other components

- **Ruby caller**
- **HackerOne API**

## Connections

- Ruby caller → API client: calls (evidence: `README.md`)
- API client → HackerOne API: sends requests (evidence: `lib/hackerone/client.rb`)
- API client → Reports: builds results (evidence: `lib/hackerone/client.rb`)
- API client → Programs: finds program (evidence: `lib/hackerone/client.rb`)
- Reports → Resource helper: uses requests (evidence: `lib/hackerone/client/report.rb`)
- Programs → Resource helper: uses requests (evidence: `lib/hackerone/client/program.rb`)
- Programs → Structured scopes: builds scopes (evidence: `lib/hackerone/client/program.rb`)
- Programs → Swag: builds swag (evidence: `lib/hackerone/client/program.rb`)
- Programs → Billing balance: builds balance (evidence: `lib/hackerone/client/program.rb`)
- Programs → Members: builds members (evidence: `lib/hackerone/client/program.rb`)
- Programs → Groups: builds groups (evidence: `lib/hackerone/client/program.rb`)
- Programs → Organizations: builds organization (evidence: `lib/hackerone/client/program.rb`)
- Organizations → Assets: builds assets (evidence: `lib/hackerone/client/organization.rb`)
- Assets → Programs: builds programs (evidence: `lib/hackerone/client/asset.rb`)
- Reports → Activities: builds activities (evidence: `lib/hackerone/client/report.rb`)
- Reports → Weakness mapping: maps weakness (evidence: `lib/hackerone/client/report.rb`)
- Reports → Attachments: builds attachments (evidence: `lib/hackerone/client/report.rb`)
- Reports → Users: builds assignee (evidence: `lib/hackerone/client/report.rb`)
- Activities → Attachments: builds attachments (evidence: `lib/hackerone/client/activity.rb`)
- Activity traversal → Activities: builds activities (evidence: `lib/hackerone/client/incremental/activities.rb`)
- Activity traversal → Resource helper: fetches pages (evidence: `lib/hackerone/client/incremental/activities.rb`)
- Resource helper → API client: uses connection (evidence: `lib/hackerone/client/resource_helper.rb`)
- Reports → API client: assigns directly (evidence: `lib/hackerone/client/report.rb`)
- Reports → Programs: looks up program (evidence: `lib/hackerone/client/report.rb`)
