Versions in this module Expand all Collapse all v0 v0.2.0 Jul 14, 2026 Changes in this version + const APIVersion + var ErrWebhookInvalid = errors.New("GitHub webhook is invalid") + var ErrWebhookSignature = errors.New("GitHub webhook signature is invalid") + func IsNotFound(err error) bool + func OpenUserCredentialStore(stateDir string) (*credentialstore.Store, error) + func StatusCode(err error) (int, bool) + func UserCredentialStorePath(stateDir string) (string, error) + type API struct + func (a *API) BranchProtected(ctx context.Context, owner, repo, branch string) (bool, error) + func (a *API) DefaultBranch(ctx context.Context, owner, repo string) (string, error) + type APIError struct + Code string + RateReset time.Time + StatusCode int + func (e APIError) Error() string + type Config struct + APIBaseURL *url.URL + AppClientID string + AppClientSecret []byte + AppID string + AppPrivateKey []byte + DevelopmentToken []byte + DevelopmentTokenFile string + HTTPClient *http.Client + Now func() time.Time + RefreshBefore time.Duration + Store *credentialstore.Store + StreamTimeout time.Duration + WebBaseURL *url.URL + type Credential struct + func (c *Credential) AuthorizeAPI(request *http.Request) error + func (c *Credential) AuthorizeGit(request *http.Request) error + func (c *Credential) Metadata() Metadata + type ExecutionResult struct + Body json.RawMessage + StatusCode int + type Kind string + const KindAppJWT + const KindDevelopmentToken + const KindInstallation + const KindUser + type Manager struct + func New(cfg Config) (*Manager, error) + func (m *Manager) API(credential *Credential) (*API, error) + func (m *Manager) CheckApp(ctx context.Context) error + func (m *Manager) CredentialKind() Kind + func (m *Manager) EnableInstallation(installationID int64) + func (m *Manager) EnrollUser(ctx context.Context, enrollment UserEnrollment) error + func (m *Manager) ExecuteGraphQL(ctx context.Context, selector Metadata, document graphqlmanifest.Document, ...) (ExecutionResult, error) + func (m *Manager) ExecuteREST(ctx context.Context, selector Metadata, binding opbinding.Binding, ...) (ExecutionResult, error) + func (m *Manager) ExecuteRESTDownload(ctx context.Context, selector Metadata, binding opbinding.Binding, ...) (*http.Response, error) + func (m *Manager) ExecuteRESTRaw(ctx context.Context, selector Metadata, binding opbinding.Binding, ...) (ExecutionResult, error) + func (m *Manager) ExecuteRESTUpload(ctx context.Context, selector Metadata, binding opbinding.Binding, ...) (ExecutionResult, error) + func (m *Manager) InstallationCredential(ctx context.Context, installationID int64, repositoryIDs []int64, ...) (*Credential, error) + func (m *Manager) InstallationForAccount(ctx context.Context, account string) (Metadata, error) + func (m *Manager) Installations(ctx context.Context) ([]int64, error) + func (m *Manager) InvalidateInstallation(installationID int64, disabled bool) + func (m *Manager) InvalidateUser(userID int64) error + func (m *Manager) RepositoryCredential(ctx context.Context, operation, owner, repo string) (*Credential, error) + func (m *Manager) ResolveRepository(ctx context.Context, operation, owner, repo string) (Metadata, error) + func (m *Manager) RevokeUser(ctx context.Context, userID int64) error + func (m *Manager) RotateUser(ctx context.Context, enrollment UserEnrollment) error + func (m *Manager) SelectMetadata(ctx context.Context, descriptor opcatalog.Descriptor, target map[string]any, ...) (Metadata, error) + func (m *Manager) UserCredential(ctx context.Context, userID int64) (*Credential, error) + func (m *Manager) ValidateAuthenticatedUserTarget(ctx context.Context, selector Metadata, target map[string]any) error + type Metadata struct + APIHost string + AllowEmptyPermissions bool + ExpiresAt time.Time + InstallationID int64 + Kind Kind + Permissions map[string]string + RepositoryIDs []int64 + UserID int64 + type UserEnrollment struct + AccessExpiresAt time.Time + AccessToken []byte + Login string + RefreshExpiresAt time.Time + RefreshToken []byte + UserID int64 + func DecodeUserEnrollment(data []byte) (UserEnrollment, error) + type WebhookEvent struct + Action string + Delivery string + DisableInstallation bool + EnableInstallation bool + Event string + InstallationID int64 + InvalidateInstallation bool + Repository string + RevokedUserID int64 + func ParseWebhook(header http.Header, body []byte, secret []byte) (WebhookEvent, error)