githubappsvc

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

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 Connection struct {
	Organization        slug.Slug
	InstallationID      int64
	AccountID           int64
	AccountLogin        string
	AccountType         string
	RepositorySelection string
	Repositories        []githubapps.RepositoryBinding
	SuspendedAt         *time.Time
	DeletedAt           *time.Time
}

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

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 Service

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

func New

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 (s *Service) ConsumeRejectedInstall(ctx context.Context, org, setup slug.Slug, actor model.EventActor, state string) error

func (*Service) Disconnect

func (s *Service) Disconnect(ctx context.Context, org slug.Slug, actor model.EventActor) error

func (*Service) Get

func (s *Service) Get(ctx context.Context, org slug.Slug) (*Connection, error)

func (*Service) OrganizationForState

func (s *Service) OrganizationForState(ctx context.Context, actor model.EventActor, state string) (slug.Slug, error)

func (*Service) RepositorySetupForState

func (s *Service) RepositorySetupForState(ctx context.Context, actor model.EventActor, state string) (slug.Slug, slug.Slug, error)

func (*Service) Resolve

func (s *Service) Resolve(ctx context.Context, installationID, repositoryID int64) (slug.Slug, error)

func (*Service) Start

func (s *Service) Start(ctx context.Context, org slug.Slug, actor model.EventActor) (string, error)

func (*Service) StartExistingAuthorization

func (s *Service) StartExistingAuthorization(ctx context.Context, org slug.Slug, actor model.EventActor, accountLogin string) (string, error)

func (*Service) StartRepositorySetup

func (s *Service) StartRepositorySetup(ctx context.Context, org slug.Slug, actor model.EventActor, setup slug.Slug) (string, error)

func (*Service) Token

func (s *Service) Token(ctx context.Context, org slug.Slug, repositoryIDs []int64) (InstallationToken, error)

Jump to

Keyboard shortcuts

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