Documentation
¶
Overview ¶
Package wizapi is a minimal Wiz GraphQL API client, holding exactly what the Wiz verdict write-back needs: an OAuth2 client-credentials token source and the updateIssue mutation that rejects an issue with a note. It is the only place a Wiz API credential is exercised, mirroring how ghpush is the only place the forge write credential is.
Index ¶
Constants ¶
const ( // ResolutionFalsePositive marks the issue wrong on the facts. ResolutionFalsePositive = "FALSE_POSITIVE" // ResolutionWontFix accepts the finding but declines to act. ResolutionWontFix = "WONT_FIX" )
Resolution reasons for a rejected issue, from Wiz's IssueResolutionReason vocabulary. Only the two the ignore verdict maps onto are declared.
const DefaultTokenURL = "https://auth.app.wiz.io/oauth/token"
DefaultTokenURL is Wiz's commercial OAuth2 token endpoint; gov and other partitions override it on the Integration.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client calls the Wiz GraphQL API as one service account, caching its token until expiry.
type Options ¶
type Options struct {
// Endpoint is the tenant GraphQL endpoint, e.g.
// https://api.eu1.app.wiz.io/graphql.
Endpoint string
// TokenURL is the OAuth2 token endpoint; empty means DefaultTokenURL.
TokenURL string
// ClientID and ClientSecret are the Wiz service-account credentials.
ClientID string
ClientSecret string
// HTTPClient overrides the transport; nil means a 30-second-timeout
// client.
HTTPClient *http.Client
}
Options configure the client.