client

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusCompleted = "completed"
)

Variables

This section is empty.

Functions

func GetGitHubID added in v0.9.15

func GetGitHubID(ctx context.Context, githubOwner string) (string, error)

func HandleError

func HandleError(resp *http.Response) error

HandleError reads an HTTP error response and returns a structured *APIError.

func Int added in v0.9.2

func Int(value int) *int

func String added in v0.9.2

func String(value string) *string

Types

type APIError added in v0.12.0

type APIError struct {
	StatusCode int
	Message    string
	Path       string
}

APIError represents a structured error response from the Nullify API.

func (*APIError) Error added in v0.12.0

func (e *APIError) Error() string

func (*APIError) IsNotFound added in v0.12.0

func (e *APIError) IsNotFound() bool

IsNotFound returns true if the error is a 404 Not Found.

func (*APIError) IsUnauthorized added in v0.12.0

func (e *APIError) IsUnauthorized() bool

IsUnauthorized returns true if the error is a 401 Unauthorized.

type DASTCreateExternalScanInput added in v0.7.0

type DASTCreateExternalScanInput struct {
	AppName string `json:"appName"`

	Progress  *int       `json:"progress"`
	Status    *string    `json:"status"`
	StartTime *time.Time `json:"startTime"`
	EndTime   *time.Time `json:"endTime"`

	models.RequestProvider
	models.RequestDashboardTarget
}

type DASTCreateExternalScanOutput added in v0.7.0

type DASTCreateExternalScanOutput struct {
	ScanID string `json:"scanId"`
}

type DASTStartCloudScanInput added in v0.4.0

type DASTStartCloudScanInput struct {
	AppName     string            `json:"appName"`
	TargetHost  string            `json:"targetHost"`
	OpenAPISpec map[string]any    `json:"openAPISpec"`
	AuthConfig  models.AuthConfig `json:"authConfig"`

	models.RequestProvider
	models.RequestDashboardTarget
}

type DASTStartCloudScanOutput added in v0.7.0

type DASTStartCloudScanOutput struct {
	ScanID string `json:"scanId"`
}

type DASTUpdateExternalScanInput added in v0.7.0

type DASTUpdateExternalScanInput struct {
	Progress *int                 `json:"progress"`
	Status   *string              `json:"status"`
	Findings []models.DASTFinding `json:"findings"`

	*models.RequestDashboardTarget
}

type HTTPClient added in v0.12.0

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPClient defines the interface for making HTTP requests.

type NullifyClient added in v0.4.0

type NullifyClient struct {
	Host       string
	BaseURL    string
	Token      string
	HttpClient HTTPClient
}

NullifyClient wraps an HTTP client configured for the Nullify API.

func NewNullifyClient added in v0.4.0

func NewNullifyClient(nullifyHost string, token string) *NullifyClient

NewNullifyClient creates a client for the given host with bearer token auth.

func (*NullifyClient) DASTCreateExternalScan added in v0.7.0

func (c *NullifyClient) DASTCreateExternalScan(
	ctx context.Context,
	githubOwner string,
	input *DASTCreateExternalScanInput,
) (*DASTCreateExternalScanOutput, error)

func (*NullifyClient) DASTStartCloudScan added in v0.4.0

func (c *NullifyClient) DASTStartCloudScan(
	ctx context.Context,
	githubOwner string,
	input *DASTStartCloudScanInput,
) (*DASTStartCloudScanOutput, error)

func (*NullifyClient) DASTUpdateExternalScan added in v0.7.0

func (c *NullifyClient) DASTUpdateExternalScan(
	ctx context.Context,
	githubOwner string,
	githubRepository string,
	scanID string,
	input *DASTUpdateExternalScanInput,
) error

Jump to

Keyboard shortcuts

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