wizapi

package
v0.11.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2026 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package wizapi is a minimal Wiz GraphQL API client, holding exactly what the write-back seam 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

View Source
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.

View Source
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.

func New

func New(o Options) (*Client, error)

New builds a client. It makes no network call: the token is fetched lazily on first use, so construction cannot fail on a Wiz outage.

func (*Client) RejectIssue

func (c *Client) RejectIssue(ctx context.Context, issueID, reason, note string) error

RejectIssue moves an issue to REJECTED with a resolution reason and note.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL