Documentation
¶
Index ¶
- Constants
- Variables
- type APIClient
- type Client
- func (n *Client) CreateScanRequest(items []string) nightfallAPI.ScanRequestV2
- func (n *Client) ReviewDiff(ctx context.Context, logger logger.Logger, fileDiffs []*diffreviewer.FileDiff) ([]*diffreviewer.Comment, error)
- func (n *Client) Scan(ctx context.Context, logger logger.Logger, items []string) ([][]nightfallAPI.ScanResponseV2, error)
Constants ¶
const (
// maximum attempts to Nightfall API upon receiving 429 Too Many Requests before failing
MaxScanAttempts = 5
)
Variables ¶
var ( // ErrMaxScanRetries is the error for when the max number of retries to the API has occurred without success ErrMaxScanRetries = errors.New("max number of retries has been attempted") )
Functions ¶
This section is empty.
Types ¶
type APIClient ¶
type APIClient struct {
APIClient *nightfallAPI.APIClient
}
APIClient is a wrapper around nightfallAPI.APIClient
func (*APIClient) ScanPayload ¶
func (c *APIClient) ScanPayload( ctx context.Context, scanReq nightfallAPI.ScanRequestV2, ) ([][]nightfallAPI.ScanResponseV2, *http.Response, error)
ScanPayload makes the scan request to the nightfallAPI
type Client ¶
type Client struct {
APIClient nightfallintf.NightfallAPI
APIKey string
ConditionSetUUID string
Conditions []*nightfallAPI.Condition
MaxNumberRoutines int
InitialRetryDelay time.Duration
TokenExclusionList []string
FileInclusionList []string
FileExclusionList []string
}
Client client which uses Nightfall API to determine findings from input strings
func (*Client) CreateScanRequest ¶
func (n *Client) CreateScanRequest(items []string) nightfallAPI.ScanRequestV2
func (*Client) ReviewDiff ¶
func (n *Client) ReviewDiff( ctx context.Context, logger logger.Logger, fileDiffs []*diffreviewer.FileDiff, ) ([]*diffreviewer.Comment, error)
ReviewDiff will take in a diff, chunk the contents of the diff and send the chunks to the Nightfall API to determine if it contains sensitive data