Documentation ¶
Overview ¶
Package githubapp provides a convenient interface for handling Github App authentication.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithInstallationClientFactory ¶ added in v0.5.0
func WithInstallationClientFactory(f func(token string) AppsTokenAPI) option
WithInstallationClientFactory sets the function used to create new installation clients internally, and can be used to inject test fakes.
func WithUpdateInterval ¶ added in v0.5.0
WithUpdateInterval can be used to override the default update interval for installations and repositories.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App wraps the AppsAPI client and caches the installations and repositories for the installation.
func (*App) CreateInstallationToken ¶
func (a *App) CreateInstallationToken(owner string, repositories []string, permissions *Permissions) (*Token, error)
CreateInstallationToken returns a new installation token for the given owner, scoped to the provided repositories and permissions.
func (*App) RateLimits ¶ added in v0.8.0
RateLimits returns the rate limits for the githubClient.
type AppsJWTAPI ¶
type AppsJWTAPI interface { ListInstallations(ctx context.Context, opt *github.ListOptions) ([]*github.Installation, *github.Response, error) CreateInstallationToken(ctx context.Context, id int64, opt *github.InstallationTokenOptions) (*github.InstallationToken, *github.Response, error) RateLimits(ctx context.Context) (*github.RateLimits, *github.Response, error) }
AppsJWTAPI is the interface that is satisfied by the Apps client when authenticated with a JWT.
type AppsTokenAPI ¶
type AppsTokenAPI interface {
ListRepos(ctx context.Context, opts *github.ListOptions) (*github.ListRepositories, *github.Response, error)
}
AppsTokenAPI is the interface that is satisfied by the Apps client when authenticated with an installation token.
type ErrInstallationNotFound ¶
type ErrInstallationNotFound string
ErrInstallationNotFound is returned if the requested App installation is not found.
func (ErrInstallationNotFound) Error ¶
func (e ErrInstallationNotFound) Error() string
type InstallationClient ¶
InstallationClient is authenticated with an installation token and includes a client for both the V3 and V4 Github APIs.
func NewInstallationClient ¶
func NewInstallationClient(token string) *InstallationClient
NewInstallationClient returns a new client.
type Permissions ¶
type Permissions github.InstallationPermissions
Permissions is re-exported to prevent issues with conflicting go-github versions.
type Token ¶
type Token struct {
*github.InstallationToken
}
Token is re-exported to prevent issues with conflicting go-github versions.