review

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GITLEAKS_REVIEW_COMMENT_TEMPLATE = `` /* 647-byte string literal not displayed */

)
View Source
const (
	NO_REVIEW_COMMENT = "" /* 127-byte string literal not displayed */
)
View Source
const (
	RISKEN_COMMENT_TEMPLATE = `` /* 128-byte string literal not displayed */

)
View Source
const (
	SEMGREP_REVIEW_COMMENT_TEMPLATE = `` /* 162-byte string literal not displayed */

)

Variables

This section is empty.

Functions

This section is empty.

Types

type GithubPREvent

type GithubPREvent struct {
	Action      string              `json:"action"`
	Number      int                 `json:"number"`
	PullRequest *github.PullRequest `json:"pull_request"`
	Repository  *github.Repository  `json:"repository"`
	Owner       string              `json:"owner"`
	RepoName    string              `json:"repo_name"`
}

GithubPREvent is a struct for GitHub Pull Request Event. ref: https://docs.github.com/ja/webhooks/webhook-events-and-payloads#pull_request example: https://github.com/pingdotgg/sample_hooks/blob/main/github_pr_opened.json

type GitleaksScanner

type GitleaksScanner struct {
	// contains filtered or unexported fields
}

func (*GitleaksScanner) Scan

func (s *GitleaksScanner) Scan(ctx context.Context, repo *github.Repository, sourceCodePath string, changeFiles []*github.CommitFile) ([]*ScanResult, error)

type ReviewOption

type ReviewOption struct {
	GithubToken       string
	GithubEventPath   string
	GithubWorkspace   string
	ErrorFlag         bool
	RiskenConsoleURL  string
	RiskenApiEndpoint string
	RiskenApiToken    string
}

type ReviewService

type ReviewService interface {
	Run(ctx context.Context) error
}

func NewReviewService

func NewReviewService(ctx context.Context, opt *ReviewOption, logger *slog.Logger) ReviewService

type ScanResult

type ScanResult struct {
	ScanID        string
	File          string
	Line          int
	DiffHunk      string
	ReviewComment string
	GitHubURL     string
	ScanResult    any
	RiskenURL     string
}

type Scanner

type Scanner interface {
	Scan(ctx context.Context, repo *github.Repository, sourceCodePath string, changeFiles []*github.CommitFile) ([]*ScanResult, error)
}

func NewGitleaksScanner

func NewGitleaksScanner(logger *slog.Logger) Scanner

func NewSemgrepScanner

func NewSemgrepScanner(logger *slog.Logger) Scanner

type SemgrepScanner

type SemgrepScanner struct {
	// contains filtered or unexported fields
}

func (*SemgrepScanner) Scan

func (s *SemgrepScanner) Scan(ctx context.Context, repo *github.Repository, sourceCodePath string, changeFiles []*github.CommitFile) ([]*ScanResult, error)

Jump to

Keyboard shortcuts

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