installer

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package installer provides a web-based installer for creating GitHub Apps using the GitHub App Manifest flow.

Index

Constants

View Source
const (
	EnvGitHubURL = "GITHUB_URL"
	EnvGitHubOrg = "GITHUB_ORG"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Store              configstore.Store
	Manifest           Manifest
	AppDisplayName     string
	GitHubURL          string
	GitHubOrg          string
	RedirectURL        string
	WebhookURL         string
	OnCredentialsSaved CredentialsSavedFunc
}

Config holds the installer configuration.

func NewConfigFromEnv

func NewConfigFromEnv() Config

NewConfigFromEnv creates a Config from environment variables.

type CredentialsSavedFunc

type CredentialsSavedFunc func(ctx context.Context, creds *configstore.AppCredentials) error

CredentialsSavedFunc is called after credentials are saved.

type Handler

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

Handler handles the GitHub App manifest installation flow.

func New

func New(cfg Config) (*Handler, error)

New creates a new installer Handler with the given configuration.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements http.Handler.

type HookAttributes

type HookAttributes struct {
	URL    string `json:"url"`
	Active bool   `json:"active"`
}

HookAttributes configures the webhook for the GitHub App.

type Manifest

type Manifest struct {
	Name           string            `json:"name,omitempty"`
	URL            string            `json:"url"`
	HookAttributes HookAttributes    `json:"hook_attributes"`
	RedirectURL    string            `json:"redirect_url"`
	Public         bool              `json:"public"`
	DefaultPerms   map[string]string `json:"default_permissions"`
	DefaultEvents  []string          `json:"default_events"`
}

Manifest represents a GitHub App manifest.

func (*Manifest) Clone

func (m *Manifest) Clone() *Manifest

Clone returns a deep copy of the manifest.

Jump to

Keyboard shortcuts

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