Documentation
¶
Overview ¶
Package plugin provides the implementation of the JVS plugin interface.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExchangeResponse ¶
type ExchangeResponse struct {
AccessToken string `json:"token"`
}
ExchangeResponse is the GitHub API response of requesting an access token for the GitHub App installation with requested repositories and permissions.
type GitHubPlugin ¶
type GitHubPlugin struct {
// contains filtered or unexported fields
}
GitHubPlugin is the implementation of jvspb.Validator interface.
See: https://pkg.go.dev/github.com/abcxyz/jvs@v0.1.4/apis/v0#Validator
func NewGitHubPlugin ¶
func NewGitHubPlugin(ctx context.Context, ghClient *github.Client, ghApp *githubapp.GitHubApp, cfg *PluginConfig) *GitHubPlugin
NewGitHubPlugin creates a new GitHubPlugin.
func (*GitHubPlugin) GetUIData ¶
func (g *GitHubPlugin) GetUIData(ctx context.Context, req *jvspb.GetUIDataRequest) (*jvspb.UIData, error)
GetUIData returns UIData for jvs ui service to use.
func (*GitHubPlugin) Validate ¶
func (g *GitHubPlugin) Validate(ctx context.Context, req *jvspb.ValidateJustificationRequest) (*jvspb.ValidateJustificationResponse, error)
Validate returns the validation result.
type PluginConfig ¶
type PluginConfig struct { // ID of the GitHub APP we use to authenticate. GitHubAppID string // Installation ID of the github app. GitHubAppInstallationID string // The private Key PEM obtained for github app. GitHubAppPrivateKeyPEM string // GitHubPluginDisplayName is for display, e.g. for the web UI. GitHubPluginDisplayName string // GitHubPluginHint is for what value to put as the justification. GitHubPluginHint string }
PluginConfig defines the set over environment variables required for running the plugin.
func (*PluginConfig) ToFlags ¶
func (cfg *PluginConfig) ToFlags(set *cli.FlagSet) *cli.FlagSet
ToFlags binds the config to the give cli.FlagSet and returns it.
func (*PluginConfig) Validate ¶
func (cfg *PluginConfig) Validate() error
Validate validates if the config is valid.
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
Validator validates github issue against validation criteria.
func NewValidator ¶
NewValidator creates a validator.