Documentation
¶
Index ¶
- Constants
- func GeneratedOwnerInstallationName(integration *models.Integration) (string, bool)
- func IsGeneratedInstallationName(name string) bool
- func OwnerInstallationName(owner string) string
- func PreferHostedInstall(orgID, integrationName string, config map[string]any) bool
- func UseHostedApp(orgID string) bool
- func UseHostedInstall(orgID, integrationName string) bool
- func WantsPrivateApp(integrationName string, config map[string]any) bool
- type CapabilityDef
- type CapabilityMapper
- type Configuration
- type GitHub
- func (g *GitHub) Actions() []core.Action
- func (g *GitHub) Cleanup(ctx core.IntegrationCleanupContext) error
- func (g *GitHub) Configuration() []configuration.Field
- func (g *GitHub) Description() string
- func (g *GitHub) HandleHook(ctx core.IntegrationHookContext) error
- func (g *GitHub) HandleRequest(ctx core.HTTPRequestContext)
- func (g *GitHub) Hooks() []core.Hook
- func (g *GitHub) Icon() string
- func (g *GitHub) Instructions() string
- func (g *GitHub) Label() string
- func (g *GitHub) ListResources(resourceType string, ctx core.ListResourcesContext) ([]core.IntegrationResource, error)
- func (g *GitHub) Name() string
- func (g *GitHub) ResolveSecrets(ctx core.IntegrationSecretContext) (core.IntegrationSecrets, error)
- func (g *GitHub) Sync(ctx core.SyncContext) error
- func (g *GitHub) Triggers() []core.Trigger
- type GitHubAppData
- type GitHubWebhookHandler
- func (h *GitHubWebhookHandler) Cleanup(ctx core.WebhookHandlerContext) error
- func (h *GitHubWebhookHandler) CompareConfig(a, b any) (bool, error)
- func (h *GitHubWebhookHandler) Merge(current, requested any) (any, bool, error)
- func (h *GitHubWebhookHandler) Setup(ctx core.WebhookHandlerContext) (any, error)
- type GroupDef
- type Permission
- type PermissionSet
- type SetupProvider
- func (g *SetupProvider) CapabilityGroups() []core.CapabilityGroup
- func (g *SetupProvider) FirstStep(ctx core.SetupStepContext) core.SetupStep
- func (g *SetupProvider) OnCapabilityUpdate(ctx core.CapabilityUpdateContext) (*core.SetupStep, error)
- func (g *SetupProvider) OnPropertyUpdate(ctx core.PropertyUpdateContext) (*core.SetupStep, error)
- func (g *SetupProvider) OnSecretUpdate(ctx core.SecretUpdateContext) (*core.SetupStep, error)
- func (g *SetupProvider) OnStepRevert(ctx core.SetupStepContext) error
- func (g *SetupProvider) OnStepSubmit(ctx core.SetupStepContext) (*core.SetupStep, error)
- type Webhook
Constants ¶
const ( PermissionScopeRepository = "Repository" PermissionScopeOrganization = "Organization" // // Repository-scoped permissions // PermissionIssues = "Issues" PermissionContents = "Contents" PermissionPullRequests = "Pull Requests" PermissionActions = "Actions" PermissionChecks = "Checks" PermissionCommitStatuses = "Commit Statuses" PermissionDeployments = "Deployments" PermissionMetadata = "Metadata" PermissionVulnerabilityAlerts = "Dependabot alerts" // // Organization-scoped permissions // PermissionAdministration = "Organization Administration" )
const ( GitHubAppPEM = "pem" GitHubAppClientSecret = "clientSecret" GitHubAppWebhookSecret = "webhookSecret" )
const ( SetupStepSelectOwner = "selectOwner" SetupStepCapabilitySelection = "capabilitySelection" SetupStepSelectAuthMethod = "selectAuthMethod" SetupStepEnterPAT = "enterPAT" SetupStepUpdatePATPermissions = "updatePATPermissions" SetupStepUpdateAppPermissions = "updateAppPermissions" SetupStepAcceptAppPermissionUpdate = "acceptAppPermissionUpdate" SetupStepCreateApp = "createApp" SetupStepInstallApp = "installApp" )
Variables ¶
This section is empty.
Functions ¶
func GeneratedOwnerInstallationName ¶
func GeneratedOwnerInstallationName(integration *models.Integration) (string, bool)
GeneratedOwnerInstallationName returns the preferred github-<owner> name when the connection uses the generated placeholder or a name generated from a previous owner.
func IsGeneratedInstallationName ¶
IsGeneratedInstallationName reports whether the name is the placeholder created before GitHub bind (github, github-2, ...).
func OwnerInstallationName ¶
OwnerInstallationName is the preferred display name after bind.
func PreferHostedInstall ¶
PreferHostedInstall is the default GitHub create path. A privateApp configuration flag opts out and uses the customer GitHub App wizard.
func UseHostedApp ¶
UseHostedApp reports whether new GitHub connections for this organization should install SuperPlane's public GitHub App. The org must have the factories feature, and the process must hold the Cloud app credentials.
func UseHostedInstall ¶
UseHostedInstall is true when this integration create should skip the SetupProvider wizard and the organization dialog, and install the public app.
Types ¶
type CapabilityDef ¶ added in v0.20.0
type CapabilityMapper ¶ added in v0.20.0
func NewCapabilityMapper ¶ added in v0.20.0
func NewCapabilityMapper() *CapabilityMapper
func (*CapabilityMapper) AllNames ¶ added in v0.20.0
func (m *CapabilityMapper) AllNames() []string
func (*CapabilityMapper) ForOrg ¶ added in v0.20.0
func (m *CapabilityMapper) ForOrg() []string
func (*CapabilityMapper) ForOwnerType ¶ added in v0.20.0
func (m *CapabilityMapper) ForOwnerType(ownerType string) []string
func (*CapabilityMapper) ForUserAccount ¶ added in v0.20.0
func (m *CapabilityMapper) ForUserAccount() []string
func (*CapabilityMapper) NewPermissionSet ¶ added in v0.20.0
func (m *CapabilityMapper) NewPermissionSet(capabilities []string) PermissionSet
type Configuration ¶ added in v0.5.0
type GitHub ¶ added in v0.5.0
type GitHub struct {
}
func (*GitHub) Cleanup ¶ added in v0.6.0
func (g *GitHub) Cleanup(ctx core.IntegrationCleanupContext) error
func (*GitHub) Configuration ¶ added in v0.5.0
func (g *GitHub) Configuration() []configuration.Field
func (*GitHub) Description ¶ added in v0.5.0
func (*GitHub) HandleHook ¶ added in v0.18.0
func (g *GitHub) HandleHook(ctx core.IntegrationHookContext) error
func (*GitHub) HandleRequest ¶ added in v0.5.0
func (g *GitHub) HandleRequest(ctx core.HTTPRequestContext)
func (*GitHub) Instructions ¶ added in v0.5.0
func (*GitHub) ListResources ¶ added in v0.5.0
func (g *GitHub) ListResources(resourceType string, ctx core.ListResourcesContext) ([]core.IntegrationResource, error)
func (*GitHub) ResolveSecrets ¶ added in v0.30.0
func (g *GitHub) ResolveSecrets(ctx core.IntegrationSecretContext) (core.IntegrationSecrets, error)
type GitHubAppData ¶ added in v0.5.0
type GitHubAppData struct {
ID int64 `mapstructure:"id" json:"id"`
Slug string `mapstructure:"slug" json:"slug"`
ClientID string `mapstructure:"client_id" json:"client_id"`
ClientSecret string `mapstructure:"client_secret" json:"client_secret"`
WebhookSecret string `mapstructure:"webhook_secret" json:"webhook_secret"`
PEM string `mapstructure:"pem" json:"pem"`
}
* This is the response GitHub sends back after the GitHub app is created. * NOTE: this contains sensitive data, so we should not save this as part * of the installation metadata.
type GitHubWebhookHandler ¶ added in v0.7.0
type GitHubWebhookHandler struct{}
func (*GitHubWebhookHandler) Cleanup ¶ added in v0.7.0
func (h *GitHubWebhookHandler) Cleanup(ctx core.WebhookHandlerContext) error
func (*GitHubWebhookHandler) CompareConfig ¶ added in v0.7.0
func (h *GitHubWebhookHandler) CompareConfig(a, b any) (bool, error)
func (*GitHubWebhookHandler) Merge ¶ added in v0.8.0
func (h *GitHubWebhookHandler) Merge(current, requested any) (any, bool, error)
func (*GitHubWebhookHandler) Setup ¶ added in v0.7.0
func (h *GitHubWebhookHandler) Setup(ctx core.WebhookHandlerContext) (any, error)
type GroupDef ¶ added in v0.20.0
type GroupDef struct {
PermissionScope string
Capabilities []CapabilityDef
}
type Permission ¶ added in v0.20.0
type PermissionSet ¶ added in v0.20.0
func FindPermissionUpdates ¶ added in v0.20.0
func FindPermissionUpdates(existing PermissionSet, requested PermissionSet) PermissionSet
* Compares one permission set with another and returns a new permission set.
func (*PermissionSet) ForAppManifest ¶ added in v0.20.0
func (p *PermissionSet) ForAppManifest() map[string]string
func (*PermissionSet) ForHuman ¶ added in v0.20.0
func (p *PermissionSet) ForHuman() []Permission
func (*PermissionSet) IsEmpty ¶ added in v0.20.0
func (p *PermissionSet) IsEmpty() bool
type SetupProvider ¶ added in v0.20.0
type SetupProvider struct{}
func (*SetupProvider) CapabilityGroups ¶ added in v0.20.0
func (g *SetupProvider) CapabilityGroups() []core.CapabilityGroup
func (*SetupProvider) FirstStep ¶ added in v0.20.0
func (g *SetupProvider) FirstStep(ctx core.SetupStepContext) core.SetupStep
func (*SetupProvider) OnCapabilityUpdate ¶ added in v0.20.0
func (g *SetupProvider) OnCapabilityUpdate(ctx core.CapabilityUpdateContext) (*core.SetupStep, error)
func (*SetupProvider) OnPropertyUpdate ¶ added in v0.20.0
func (g *SetupProvider) OnPropertyUpdate(ctx core.PropertyUpdateContext) (*core.SetupStep, error)
func (*SetupProvider) OnSecretUpdate ¶ added in v0.20.0
func (g *SetupProvider) OnSecretUpdate(ctx core.SecretUpdateContext) (*core.SetupStep, error)
func (*SetupProvider) OnStepRevert ¶ added in v0.20.0
func (g *SetupProvider) OnStepRevert(ctx core.SetupStepContext) error
func (*SetupProvider) OnStepSubmit ¶ added in v0.20.0
func (g *SetupProvider) OnStepSubmit(ctx core.SetupStepContext) (*core.SetupStep, error)