{"id":15048137,"url":"https://github.com/github/hackerone-client","last_synced_at":"2025-10-19T22:32:55.568Z","repository":{"id":189238813,"uuid":"496328849","full_name":"github/hackerone-client","owner":"github","description":"An unofficial wrapper for the HackerOne API","archived":false,"fork":false,"pushed_at":"2024-08-09T20:13:38.000Z","size":329,"stargazers_count":14,"open_issues_count":3,"forks_count":3,"subscribers_count":201,"default_branch":"main","last_synced_at":"2025-01-30T07:42:40.461Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/hackerone-client","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/github.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY.md","support":"SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-25T17:28:54.000Z","updated_at":"2025-01-11T11:02:41.000Z","dependencies_parsed_at":"2023-08-18T23:24:43.568Z","dependency_job_id":"5e369161-3e69-4143-ad32-b592672d9b3f","html_url":"https://github.com/github/hackerone-client","commit_stats":null,"previous_names":["github/hackerone-client"],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fhackerone-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fhackerone-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fhackerone-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fhackerone-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/github","download_url":"https://codeload.github.com/github/hackerone-client/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237224897,"owners_count":19275107,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-24T21:08:32.327Z","updated_at":"2025-10-19T22:32:50.257Z","avatar_url":"https://github.com/github.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hackerone::Client\n\nA limited client library for interacting with HackerOne in Ruby. Currently supports a few operations:\n\n```ruby\nclient = HackerOne::Client::Api.new(\"github\")\n\n# POST '/reports' creates a new report\nclient.create_report(title: \"hi\", summary: \"hi\", impact: \"string\", severity_rating: :high, source: \"api\")\n\n# GET '/reports' returns all reports in a given state for a program, by default :new\nclient.reports(since: 10.days.ago, before: 1.day.ago, state: :new)\n\n# GET '/report/{id}' returns report data for a given report\nreport = client.report(id)\n\n# PUT '/reports/{id}/assignee'\nreport.assign_to_user(\"username\")\nreport.assign_to_group(\"groupname\")\n\n# POST '/reports/#{id}/activities'\nreport.add_comment(message, internal: false) # internal is true by default\n\n# POST '/report/{id}/state_change change the state of a report\n# `state` can be one of  new, triaged, needs-more-info, resolved, not-applicable, informative, duplicate, spam\n# when marking as duplicate, you can supply the original report ID\nreport.state_change(:duplicate, \"Your issue has been marked as X\", original_report_id: 12345)\n\n# POST '/report/{id}/add_report_reference add a \"reference\" e.g. internal issue number\nreport.add_report_reference(reference)\n\n# Triage an issue (add a reference and set state to :triaged)\nreport.triage(reference)\n\n# Set the severity on a report (rating can be :none, :low, :medium, :high or :critical)\nreport.update_severity(rating: :high)\n\n# POST /reports/{id}/bounty_suggestions\nreport.suggest_bounty(message: \"I suggest $500 with a small bonus. Report is well-written.\", amount: 500, bonus_amount: 50)\n\n# POST /reports/{id}/bounties\nreport.award_bounty(message: \"Here's your bounty!\", amount: 500, bonus_amount: 50)\n\n# POST /reports/{id}/swags\nreport.award_swag(message: \"Here's your T-Shirt\")\n\n# GET `/{program}/reporters` returns a list of unique reporters that have reported to your program\nclient.reporters\n\nprogram = HackerOne::Client::Program.find(\"insert-program-name-here\")\n\n# returns all common responses\nprogram.common_responses\n\n# Updates a program's policy\nprogram.update_policy(policy: \"Please submit valid vulnerabilities\")\n\n# Gets a program's balance\nprogram.balance\n\n# Gets a list of structured scopes\nprogram.structured_scopes\n\n# Gets an organization for a program\nprogram.organization\n\n# Gets assets for an organization\nprogram.organization.assets\n\n# Updates an asset for an organization\nasset = program.organization.assets[0]\nasset.update(\n  attributes: {\n    description: \"This is the new description\"\n  }\n)\n```\n\n## State change hooks\n\nYou can add hooks that will be called for every state change. This can be useful e.g. for ensuring that reports always get assigned or calling out to external services for specific state changes.\n\n```ruby\n# Initialization\n\nHackerOne::Client::Report.add_state_change_hook -\u003e(report, old_state, new_state) do\n  # ...\nend\n```\n\n## Usage\n\n### Credential management\n\nYou'll need to generate an API token at `https://hackerone.com/\u003cprogram\u003e/api`.\n\n* Click \"Create API token\"\n* Name the token\n* Click \"Create\"\n* Copy down the value\n\n**Set the `HACKERONE_TOKEN` and `HACKERONE_TOKEN_NAME` environment variables.**\n\n### Program name\n\nIn order to retrieve all reports for a given program, you need to supply a default program:\n\n```ruby\nHackerOne::Client.program = \"github\"\n```\n\n### Risk classification\n\nConfigure the low/med/high/crit ranges for easier classification based on payouts:\n\n```ruby\nHackerOne::Client.low_range = 1..999\nHackerOne::Client.medium_range = 1000...2500\nHackerOne::Client.high_range = 2500...5000\nHackerOne::Client.critical_range = 5000...100_000_000\n```\n\n### Configuration\n\nIn order to configure whether error handling is strict or lenient, set the `HACKERONE_CLIENT_LENIENT_MODE` variable.\n\nSetting this variable will make the client try to absorb errors, like a malformed bounty or bonus amount. Not setting this variable will cause the client to raise errors.\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/oreoshake/hackerone-client. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n\n## License \n\nThis project is licensed under the terms of the MIT open source license. Please refer to [MIT](./LICENSE.txt) for the full terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithub%2Fhackerone-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgithub%2Fhackerone-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithub%2Fhackerone-client/lists"}