Documentation
¶
Index ¶
- Constants
- func Health() http.Handler
- func LoadTemplates(c *FilesConfig, basePath string, githubURL string) (templatetree.HTMLTree, error)
- func Login(c githubapp.Config, basePath string, sessions *scs.Manager) oauth2.LoginCallback
- func RequireLogin(sessions *scs.Manager, basePath string) func(http.Handler) http.Handler
- func Static(prefix string, c *FilesConfig) http.Handler
- func Validate() http.Handler
- type Base
- func (b *Base) Evaluate(ctx context.Context, installationID int64, trigger common.Trigger, ...) error
- func (b *Base) EvaluateFetchedConfig(ctx context.Context, prctx pull.Context, client *github.Client, ...) (common.Result, error)
- func (b *Base) PostGitHubRepoStatus(ctx context.Context, client *github.Client, owner, repo, ref string, ...) error
- func (b *Base) PostStatus(ctx context.Context, prctx pull.Context, client *github.Client, ...)
- func (b *Base) PreparePRContext(ctx context.Context, installationID int64, pr *github.PullRequest) (context.Context, zerolog.Logger)
- func (b *Base) RequestReviewsForResult(ctx context.Context, prctx pull.Context, client *github.Client, ...) error
- func (b *Base) ValidateFetchedConfig(ctx context.Context, prctx pull.Context, client *github.Client, ...) (common.Evaluator, error)
- type CheckRun
- type ConfigFetcher
- type CrossOrgMembershipContext
- func (c *CrossOrgMembershipContext) IsOrgMember(org, user string) (bool, error)
- func (c *CrossOrgMembershipContext) IsTeamMember(team, user string) (bool, error)
- func (c *CrossOrgMembershipContext) OrganizationMembers(org string) ([]string, error)
- func (c *CrossOrgMembershipContext) TeamMembers(team string) ([]string, error)
- type Details
- type FetchedConfig
- type FilesConfig
- type HealthCheck
- type Index
- type Installation
- type IssueComment
- type Membership
- type PullEvaluationOptions
- type PullRequest
- type PullRequestReview
- type Status
- type ValidateCheck
Constants ¶
View Source
const ( DefaultPolicyPath = ".policy.yml" DefaultStatusCheckContext = "policy-bot" LogKeyGitHubSHA = "github_sha" )
View Source
const ( DefaultTemplatesDir = "templates" DefaultStaticDir = "static" )
View Source
const ( SessionKeyUsername = "username" SessionKeyRedirect = "redirect" )
View Source
const (
LogKeyAudit string = "audit"
)
Variables ¶
This section is empty.
Functions ¶
func LoadTemplates ¶
func LoadTemplates(c *FilesConfig, basePath string, githubURL string) (templatetree.HTMLTree, error)
func RequireLogin ¶
Types ¶
type Base ¶
type Base struct {
githubapp.ClientCreator
Installations githubapp.InstallationsService
ConfigFetcher *ConfigFetcher
BaseConfig *baseapp.HTTPConfig
PullOpts *PullEvaluationOptions
AppName string
}
func (*Base) EvaluateFetchedConfig ¶
func (*Base) PostGitHubRepoStatus ¶ added in v1.24.0
func (*Base) PostStatus ¶
func (*Base) PreparePRContext ¶
func (*Base) RequestReviewsForResult ¶ added in v1.21.2
type ConfigFetcher ¶
func (*ConfigFetcher) ConfigForPR ¶
func (cf *ConfigFetcher) ConfigForPR(ctx context.Context, prctx pull.Context, client *github.Client) FetchedConfig
type CrossOrgMembershipContext ¶
type CrossOrgMembershipContext struct {
// contains filtered or unexported fields
}
func NewCrossOrgMembershipContext ¶
func NewCrossOrgMembershipContext(ctx context.Context, client *github.Client, orgName string, installations githubapp.InstallationsService, clientCreator githubapp.ClientCreator) *CrossOrgMembershipContext
func (*CrossOrgMembershipContext) IsOrgMember ¶
func (c *CrossOrgMembershipContext) IsOrgMember(org, user string) (bool, error)
func (*CrossOrgMembershipContext) IsTeamMember ¶
func (c *CrossOrgMembershipContext) IsTeamMember(team, user string) (bool, error)
func (*CrossOrgMembershipContext) OrganizationMembers ¶
func (c *CrossOrgMembershipContext) OrganizationMembers(org string) ([]string, error)
func (*CrossOrgMembershipContext) TeamMembers ¶
func (c *CrossOrgMembershipContext) TeamMembers(team string) ([]string, error)
type FetchedConfig ¶
type FilesConfig ¶
type HealthCheck ¶
type Index ¶
type Index struct {
Base
GithubConfig *githubapp.Config
Templates templatetree.HTMLTree
}
type Installation ¶ added in v1.24.0
type Installation struct {
Base
}
func (*Installation) Handle ¶ added in v1.24.0
func (h *Installation) Handle(ctx context.Context, eventType, deliveryID string, payload []byte) error
Handle installation, installation_repositories https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#installation https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#installation_repositories
func (*Installation) Handles ¶ added in v1.24.0
func (h *Installation) Handles() []string
type IssueComment ¶
type IssueComment struct {
Base
}
func (*IssueComment) Handle ¶
func (h *IssueComment) Handle(ctx context.Context, eventType, deliveryID string, payload []byte) error
Handle issue_comment See https://developer.github.com/v3/activity/events/types/#issuecommentevent
func (*IssueComment) Handles ¶
func (h *IssueComment) Handles() []string
type Membership ¶ added in v1.25.0
type PullEvaluationOptions ¶
type PullEvaluationOptions struct {
PolicyPath string `yaml:"policy_path"`
// StatusCheckContext will be used to create the status context. It will be used in the following
// pattern: <StatusCheckContext>: <Base Branch Name>
StatusCheckContext string `yaml:"status_check_context"`
// PostInsecureStatusChecks enables the sending of a second status using just StatusCheckContext as the context,
// no templating. This is turned off by default. This is to support legacy workflows that depend on the original
// context behaviour, and will be removed in 2.0
PostInsecureStatusChecks bool `yaml:"post_insecure_status_checks"`
// This field is unused but is left to avoid breaking configuration files:
// yaml.UnmarshalStrict returns an error for unmapped fields
//
// TODO(bkeyes): remove in version 2.0
Deprecated_AppName string `yaml:"app_name"`
}
func (*PullEvaluationOptions) SetValuesFromEnv ¶ added in v1.24.0
func (p *PullEvaluationOptions) SetValuesFromEnv(prefix string)
type PullRequest ¶
type PullRequest struct {
Base
}
func (*PullRequest) Handle ¶
func (h *PullRequest) Handle(ctx context.Context, eventType, deliveryID string, payload []byte) error
Handle pull_request https://developer.github.com/v3/activity/events/types/#requestevent
func (*PullRequest) Handles ¶
func (h *PullRequest) Handles() []string
type PullRequestReview ¶
type PullRequestReview struct {
Base
}
func (*PullRequestReview) Handle ¶
func (h *PullRequestReview) Handle(ctx context.Context, eventType, deliveryID string, payload []byte) error
Handle pull_request_review https://developer.github.com/v3/activity/events/types/#pullrequestreviewevent
func (*PullRequestReview) Handles ¶
func (h *PullRequestReview) Handles() []string
type Status ¶
type Status struct {
Base
}
func (*Status) Handle ¶
Handle status https://developer.github.com/v3/activity/events/types/#statusevent
type ValidateCheck ¶
Click to show internal directories.
Click to hide internal directories.