githubapp

package
v1.0.0-rc1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAlreadyConfigured = errors.New("GitHub App is already configured")

Functions

func AccountConnectionRequired

func AccountConnectionRequired(ctx context.Context) bool

AccountConnectionRequired reports whether repository access stays on the linked GitHub account. Cloud sets the public GitHub App, the login client, or both. A self-hosted app stored on the installation does not.

func ConvertManifest

func ConvertManifest(httpCtx core.HTTPContext, code string) (config.GitHubHostedAppConfig, error)

func CreateURL

func CreateURL() string

func CreatedPath

func CreatedPath() string

func Enabled

func Enabled(ctx context.Context, tx *gorm.DB, encryptor crypto.Encryptor) bool

func OAuthCallbackURL

func OAuthCallbackURL(baseURL string) string

func ProcessEnabled

func ProcessEnabled(ctx context.Context) bool

func PublicManifestJSON

func PublicManifestJSON(baseURL, webhooksBaseURL string) (string, error)

func Resolve

func Resolve(ctx context.Context, tx *gorm.DB, encryptor crypto.Encryptor) (config.GitHubHostedAppConfig, error)

Resolve returns the public GitHub App for this request. Process environment wins so Cloud keeps env-only credentials. Self-host stores the app on the installation after the first-run create step.

func ResolveProcess

func ResolveProcess(ctx context.Context) (config.GitHubHostedAppConfig, error)

ResolveProcess reads the public GitHub App using the process encryptor.

func SafeReturnPath

func SafeReturnPath(path string) string

func Save

func Save(
	ctx context.Context,
	tx *gorm.DB,
	encryptor crypto.Encryptor,
	cfg config.GitHubHostedAppConfig,
) error

func SignCreateState

func SignCreateState(secret, returnPath string, accountID uuid.UUID) (string, error)

func UserConnectReady

func UserConnectReady(_ context.Context) bool

UserConnectReady reports whether GitHub account connection can start. Cloud sets GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET. A self-hosted app does not offer Sign in with GitHub.

func VerifyCreateState

func VerifyCreateState(secret, state string) (string, uuid.UUID, error)

Types

type Catalog

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

Catalog synchronizes the public SuperPlane GitHub App into the global installation catalog. It never uses a GitHub user OAuth token.

func NewCatalog

func NewCatalog(db *gorm.DB, cfg config.GitHubHostedAppConfig) (*Catalog, error)

func (*Catalog) EnqueueRefresh

func (c *Catalog) EnqueueRefresh(repositoryIDs []int64) error

EnqueueRefresh schedules database-cached repositories only. It does not block the request on GitHub.

func (*Catalog) HasInstallationRequest

func (c *Catalog) HasInstallationRequest(ctx context.Context, installationID int64) (bool, error)

func (*Catalog) Reconcile

Reconcile imports installations, repositories, and pending approval requests. App-JWT requests follow the endpoints and pagination documented in onboarding-guide.md.

func (*Catalog) ReconcileInstallRequests

func (c *Catalog) ReconcileInstallRequests(ctx context.Context) error

ReconcileInstallRequests replaces the stored approval requests with the current GitHub list. GitHub sends no webhook when a member requests the App or cancels a request, so this list is the only source.

func (*Catalog) ReconcileInstallation

func (c *Catalog) ReconcileInstallation(
	ctx context.Context,
	installationID int64,
	priority models.VCSProviderRepositorySyncPriority,
) error

func (*Catalog) SyncRepositoryCollaborators

func (c *Catalog) SyncRepositoryCollaborators(ctx context.Context, repositoryID int64) error

func (*Catalog) VerifyInstallation

func (c *Catalog) VerifyInstallation(ctx context.Context, installationID int64) error

VerifyInstallation reads one installation from GitHub without its repositories. GitHub does not always send a webhook when an App is uninstalled, so an installation that GitHub no longer has is deleted here.

type CreateForm

type CreateForm struct {
	URL    string
	Method string
	Form   map[string]string
}

CreateForm is the GitHub App Manifest POST the browser sends to GitHub.

Jump to

Keyboard shortcuts

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