Documentation
¶
Index ¶
- Variables
- type Connection
- type GitHubProvider
- func (p *GitHubProvider) AuthorizationURL(state string) (string, error)
- func (p *GitHubProvider) InstallationToken(ctx context.Context, installationID int64, repositoryIDs []int64) (InstallationToken, error)
- func (p *GitHubProvider) VerifyAuthorizedInstallation(ctx context.Context, code, accountLogin string, callbackInstallationID int64) (githubapps.VerifiedInstallation, error)
- func (p *GitHubProvider) VerifyInstallation(ctx context.Context, code string, installationID int64) (githubapps.VerifiedInstallation, error)
- func (p *GitHubProvider) VerifyRepositoryInstallation(ctx context.Context, code string, installationID int64, ...) (githubapps.VerifiedInstallation, *gitprovider.RepositoryBootstrapResult, error)
- type InstallationToken
- type Provider
- type Service
- func (s *Service) ApplyLifecycle(ctx context.Context, event githubprovider.InstallationLifecycleEvent) error
- func (s *Service) Complete(ctx context.Context, actor model.EventActor, state, code string, ...) (*Connection, error)
- func (s *Service) CompleteRepositorySetup(ctx context.Context, org, setup slug.Slug, actor model.EventActor, ...) (*gitprovider.RepositoryBootstrapResult, error)
- func (s *Service) ConsumeRejectedInstall(ctx context.Context, org, setup slug.Slug, actor model.EventActor, ...) error
- func (s *Service) Disconnect(ctx context.Context, org slug.Slug, actor model.EventActor) error
- func (s *Service) Get(ctx context.Context, org slug.Slug) (*Connection, error)
- func (s *Service) OrganizationForState(ctx context.Context, actor model.EventActor, state string) (slug.Slug, error)
- func (s *Service) RepositorySetupForState(ctx context.Context, actor model.EventActor, state string) (slug.Slug, slug.Slug, error)
- func (s *Service) Resolve(ctx context.Context, installationID, repositoryID int64) (slug.Slug, error)
- func (s *Service) Start(ctx context.Context, org slug.Slug, actor model.EventActor) (string, error)
- func (s *Service) StartExistingAuthorization(ctx context.Context, org slug.Slug, actor model.EventActor, ...) (string, error)
- func (s *Service) StartRepositorySetup(ctx context.Context, org slug.Slug, actor model.EventActor, setup slug.Slug) (string, error)
- func (s *Service) Token(ctx context.Context, org slug.Slug, repositoryIDs []int64) (InstallationToken, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidInstall = xerror.New(xerror.KindInvalidInput, "GITHUB_APP_INSTALL_INVALID", "GitHub App installation could not be verified")
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type GitHubProvider ¶
type GitHubProvider struct {
// contains filtered or unexported fields
}
func NewGitHubProvider ¶
func NewGitHubProvider(appID int64, clientID, clientSecret, callbackURL, privateKeyPath string) (*GitHubProvider, error)
func (*GitHubProvider) AuthorizationURL ¶
func (p *GitHubProvider) AuthorizationURL(state string) (string, error)
func (*GitHubProvider) InstallationToken ¶
func (p *GitHubProvider) InstallationToken(ctx context.Context, installationID int64, repositoryIDs []int64) (InstallationToken, error)
func (*GitHubProvider) VerifyAuthorizedInstallation ¶
func (p *GitHubProvider) VerifyAuthorizedInstallation(ctx context.Context, code, accountLogin string, callbackInstallationID int64) (githubapps.VerifiedInstallation, error)
func (*GitHubProvider) VerifyInstallation ¶
func (p *GitHubProvider) VerifyInstallation(ctx context.Context, code string, installationID int64) (githubapps.VerifiedInstallation, error)
func (*GitHubProvider) VerifyRepositoryInstallation ¶
func (p *GitHubProvider) VerifyRepositoryInstallation(ctx context.Context, code string, installationID int64, request gitprovider.RepositoryBootstrapRequest) (githubapps.VerifiedInstallation, *gitprovider.RepositoryBootstrapResult, error)
type InstallationToken ¶
type InstallationToken struct {
Token string
ExpiresAt time.Time
ContentsPermission string
PullRequestsPermission string
InstallationID int64
AccountID int64
PrincipalID int64
PrincipalLogin string
}
InstallationToken is the provider-issued authority for one bound installation token.
type Provider ¶
type Provider interface {
AuthorizationURL(string) (string, error)
VerifyInstallation(context.Context, string, int64) (githubapps.VerifiedInstallation, error)
VerifyAuthorizedInstallation(context.Context, string, string, int64) (githubapps.VerifiedInstallation, error)
VerifyRepositoryInstallation(context.Context, string, int64, gitprovider.RepositoryBootstrapRequest) (githubapps.VerifiedInstallation, *gitprovider.RepositoryBootstrapResult, error)
InstallationToken(context.Context, int64, []int64) (InstallationToken, error)
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func New ¶
func New(txm postgres.TransactionManager, repo githubapps.Repository, provider Provider, events workerproducer.EventProducer, installURL string) (*Service, error)
func (*Service) ApplyLifecycle ¶
func (s *Service) ApplyLifecycle(ctx context.Context, event githubprovider.InstallationLifecycleEvent) error
func (*Service) Complete ¶
func (s *Service) Complete(ctx context.Context, actor model.EventActor, state, code string, installationID int64) (*Connection, error)
func (*Service) CompleteRepositorySetup ¶
func (s *Service) CompleteRepositorySetup(ctx context.Context, org, setup slug.Slug, actor model.EventActor, state, code string, installationID int64, request gitprovider.RepositoryBootstrapRequest) (*gitprovider.RepositoryBootstrapResult, error)
func (*Service) ConsumeRejectedInstall ¶
func (*Service) Disconnect ¶
func (*Service) OrganizationForState ¶
func (*Service) RepositorySetupForState ¶
func (*Service) StartExistingAuthorization ¶
func (*Service) StartRepositorySetup ¶
Click to show internal directories.
Click to hide internal directories.