Files
zeekay 189ce08e51 Regenerate against the document the deployment answers for
The projection these were generated from was a month old and predated the
compute migration, so every one of them described /v1/visor — which the API
serves at zero paths now. That is why a hand-written console client and a
generated one had drifted the same way at the same time.

No /v1/visor path survives here. The word still appears as a source-plane
value and inside gvisor and supervisor, which are not this rename.
2026-09-05 18:07:13 -07:00

131 lines
7.0 KiB
C++

/**
* Hanzo Cloud API
* The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
*
* The version of the OpenAPI document: v1
*
* NOTE: This class is auto generated by OpenAPI-Generator 7.14.0.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* SecurityApi.h
*
*
*/
#ifndef HANZO_API_SecurityApi_H_
#define HANZO_API_SecurityApi_H_
#include "hanzo/ApiClient.h"
#include "hanzo/model/FindingList.h"
#include "hanzo/model/FindingView.h"
#include "hanzo/model/RuleList.h"
#include "hanzo/model/Ruleset.h"
#include "hanzo/model/ScanDetail.h"
#include "hanzo/model/ScanList.h"
#include "hanzo/model/ScanView.h"
#include "hanzo/model/SubmitReq.h"
#include <cpprest/details/basic_types.h>
#include <boost/optional.hpp>
namespace hanzo {
namespace api {
using namespace hanzo::model;
class SecurityApi
{
public:
explicit SecurityApi( std::shared_ptr<const ApiClient> apiClient );
virtual ~SecurityApi();
/// <summary>
/// Is the org&#39;s findings — rule, severity, path, line, masked preview and fingerprint — newest first, across scans or within one.
/// </summary>
/// <remarks>
/// Is the org&#39;s findings — rule, severity, path, line, masked preview and fingerprint — newest first, across scans or within one. A minSeverity outside critical|high|medium|low is refused rather than quietly ignored, so a filter typo cannot read as \&quot;no findings\&quot;. Strictly org-scoped, and a caller with no validated org is refused.
/// </remarks>
/// <param name="scanId">ScanID narrows to a single scan. (optional, default to utility::conversions::to_string_t(&quot;&quot;))</param>
/// <param name="minSeverity">MinSeverity drops everything below that rank: critical, high, medium or low. A value outside that set is refused rather than quietly ignored, so a filter typo cannot read as \&quot;no findings\&quot;. (optional, default to utility::conversions::to_string_t(&quot;&quot;))</param>
/// <param name="limit">Limit caps the page. (optional, default to 0L)</param>
pplx::task<std::shared_ptr<FindingList>> getSecurityFindings(
boost::optional<utility::string_t> scanId,
boost::optional<utility::string_t> minSeverity,
boost::optional<int64_t> limit
) const;
/// <summary>
/// Returns a single finding: which rule fired, where (path and line), the masked preview and the SHA-256 fingerprint of the secret — the raw secret is not stored and cannot be read back.
/// </summary>
/// <remarks>
/// Returns a single finding: which rule fired, where (path and line), the masked preview and the SHA-256 fingerprint of the secret — the raw secret is not stored and cannot be read back. Scoped to the caller&#39;s org, and a finding belonging to another org is the same 404 as one that never existed.
/// </remarks>
/// <param name="id">ID is the finding the URL names.</param>
pplx::task<std::shared_ptr<FindingView>> getSecurityFindingsById(
utility::string_t id
) const;
/// <summary>
/// Reports that the scanning subsystem is serving and how many secret-detection rules the engine holds.
/// </summary>
/// <remarks>
/// Reports that the scanning subsystem is serving and how many secret-detection rules the engine holds. It has no external dependency — the answer is ok whenever the findings store opened — so it measures this process rather than anything downstream. It reads no tenant: a prober that sends no principal is answered, not refused.
/// </remarks>
pplx::task<std::shared_ptr<Ruleset>> getSecurityHealth(
) const;
/// <summary>
/// Is the secret-detection catalog the engine scans with.
/// </summary>
/// <remarks>
/// Is the secret-detection catalog the engine scans with. It returns every rule a scan can fire — the id, name and severity a finding cites — so a caller can render or triage results without hard-coding the catalog. It is the same for everyone and discloses nothing tenant-specific, so it carries no org scope.
/// </remarks>
pplx::task<std::shared_ptr<RuleList>> getSecurityRules(
) const;
/// <summary>
/// Is the org&#39;s scan history, newest first, each as the same summary the submission answered — files read, findings fired, tally by severity.
/// </summary>
/// <remarks>
/// Is the org&#39;s scan history, newest first, each as the same summary the submission answered — files read, findings fired, tally by severity. Strictly org-scoped: a caller only ever sees its own scans, and one with no validated org is refused.
/// </remarks>
/// <param name="limit">Limit caps the page. (optional, default to 0L)</param>
pplx::task<std::shared_ptr<ScanList>> getSecurityScans(
boost::optional<int64_t> limit
) const;
/// <summary>
/// Returns one scan together with every finding on it, so the detail view is one round-trip rather than a list call per scan.
/// </summary>
/// <remarks>
/// Returns one scan together with every finding on it, so the detail view is one round-trip rather than a list call per scan. The findings carry masked previews and fingerprints, never secrets. Scoped to the caller&#39;s org: a scan id belonging to another org is the same 404 as an id that never existed, so a ruleset learns nothing about what exists elsewhere. No validated org is refused.
/// </remarks>
/// <param name="id">ID is the scan the URL names.</param>
pplx::task<std::shared_ptr<ScanDetail>> getSecurityScansById(
utility::string_t id
) const;
/// <summary>
/// Runs the detection engine over a batch of files and answers 201 with the scan summary: how many files were read, how many findings fired, and the tally by severity.
/// </summary>
/// <remarks>
/// Runs the detection engine over a batch of files and answers 201 with the scan summary: how many files were read, how many findings fired, and the tally by severity. THE SUBMITTED CONTENT IS NEVER STORED. It is scanned in memory; what persists is the finding — its rule, its path and line, a MASKED preview (first and last characters kept, the middle starred) and the SHA-256 fingerprint of the raw secret. The fingerprint is what makes the same secret recognisable across scans and after rotation without the secret ever being written down. It requires a validated org, which scopes the stored scan and every finding on it; a caller with no org is refused. Bounded at 500 files and 8 MiB of total content per submission — split a larger tree across scans. One scan is one metered unit, and the scan is recorded in the audit log with its tally, never with its findings.
/// </remarks>
/// <param name="submitReq"></param>
pplx::task<std::shared_ptr<ScanView>> postSecurityScans(
std::shared_ptr<SubmitReq> submitReq
) const;
protected:
std::shared_ptr<const ApiClient> m_ApiClient;
};
}
}
#endif /* HANZO_API_SecurityApi_H_ */