Documentation
¶
Overview ¶
Package app provides the GitHub App specific operations
Index ¶
- Constants
- Variables
- func NewGitHubAppProvider(providerConfig *minderv1.GitHubAppProviderConfig, ...) (*github.GitHub, error)
- func ParseV1Config(rawCfg json.RawMessage) (*minderv1.GitHubAppProviderConfig, error)
- type GitHubAppDelegate
- func (g *GitHubAppDelegate) GetCredential() provifv1.GitHubCredential
- func (g *GitHubAppDelegate) GetLogin(ctx context.Context) (string, error)
- func (g *GitHubAppDelegate) GetName(_ context.Context) (string, error)
- func (_ *GitHubAppDelegate) GetOwner() string
- func (g *GitHubAppDelegate) GetPrimaryEmail(ctx context.Context) (string, error)
- func (g *GitHubAppDelegate) GetUserId(ctx context.Context) (int64, error)
- func (g *GitHubAppDelegate) IsOrg() bool
- func (g *GitHubAppDelegate) ListAllRepositories(ctx context.Context) ([]*minderv1.Repository, error)
Constants ¶
const GithubApp = "github-app"
GithubApp is the string that represents the GitHubApp provider
Variables ¶
var AuthorizationFlows = []db.AuthorizationFlow{ db.AuthorizationFlowGithubAppFlow, }
AuthorizationFlows is the list of authorization flows that the GitHubOAuth provider supports
var Implements = []db.ProviderType{ db.ProviderTypeGithub, db.ProviderTypeGit, db.ProviderTypeRest, db.ProviderTypeRepoLister, }
Implements is the list of provider types that the GitHubOAuth provider implements
Functions ¶
func NewGitHubAppProvider ¶ added in v0.0.37
func NewGitHubAppProvider( providerConfig *minderv1.GitHubAppProviderConfig, appConfig *server.GitHubAppConfig, metrics telemetry.HttpClientMetrics, restClientCache ratecache.RestClientCache, credential provifv1.GitHubCredential, packageListingClient *gogithub.Client, isOrg bool, ) (*github.GitHub, error)
NewGitHubAppProvider creates a new GitHub App API client BaseURL defaults to the public GitHub API, if needing to use a customer domain endpoint (as is the case with GitHub Enterprise), set the Endpoint field in the GitHubConfig struct
func ParseV1Config ¶ added in v0.0.37
func ParseV1Config(rawCfg json.RawMessage) (*minderv1.GitHubAppProviderConfig, error)
ParseV1Config parses the raw config into a GitHubAppProviderConfig struct
Types ¶
type GitHubAppDelegate ¶
type GitHubAppDelegate struct {
// contains filtered or unexported fields
}
GitHubAppDelegate is the struct that contains the GitHub App specific operations
func (*GitHubAppDelegate) GetCredential ¶
func (g *GitHubAppDelegate) GetCredential() provifv1.GitHubCredential
GetCredential returns the GitHub App installation credential
func (*GitHubAppDelegate) GetLogin ¶
func (g *GitHubAppDelegate) GetLogin(ctx context.Context) (string, error)
GetLogin returns the username for the GitHub App user
func (*GitHubAppDelegate) GetName ¶
func (g *GitHubAppDelegate) GetName(_ context.Context) (string, error)
GetName returns the username for the GitHub App user
func (*GitHubAppDelegate) GetOwner ¶ added in v0.0.38
func (_ *GitHubAppDelegate) GetOwner() string
GetOwner returns the owner filter
func (*GitHubAppDelegate) GetPrimaryEmail ¶
func (g *GitHubAppDelegate) GetPrimaryEmail(ctx context.Context) (string, error)
GetPrimaryEmail returns the email for the GitHub App user
func (*GitHubAppDelegate) GetUserId ¶
func (g *GitHubAppDelegate) GetUserId(ctx context.Context) (int64, error)
GetUserId returns the user id for the GitHub App user
func (*GitHubAppDelegate) IsOrg ¶ added in v0.0.41
func (g *GitHubAppDelegate) IsOrg() bool
IsOrg returns true if the owner is an organization
func (*GitHubAppDelegate) ListAllRepositories ¶
func (g *GitHubAppDelegate) ListAllRepositories(ctx context.Context) ([]*minderv1.Repository, error)
ListAllRepositories returns a list of all repositories accessible to the GitHub App installation