github

package
v0.18.6 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProviderName          = "github"
	ProviderDisplayName   = "Github"
	ProviderConnectorType = "github"
	OrganizationKey       = "organization"
	TeamKey               = "team"
	AppIDKey              = "app-id"
	PrivateKeyKey         = "private-key"
	ClientIDKey           = "client-id"
	ClientSecretKey       = "client-secret"
	DefaultHost           = "github.com"
	TeamNameFieldSlug     = "slug"
	// PreferredEmailDomainKey is an optional credential key. When set, the
	// rendered connector config carries preferredEmailDomain, making dex
	// (>= v2.36.0) release the user's verified email on that domain instead
	// of the GitHub primary email.
	PreferredEmailDomainKey = "preferred-email-domain"
	// TeamsKey is an optional credential key holding a comma-separated list
	// of team slugs. When set it takes precedence over TeamKey: dex lets a
	// user log in when they are a member of ANY listed team, and the groups
	// claim carries the user's memberships among the listed teams. Operator
	// versions without this key ignore it, so a credential may carry both
	// keys and deploy in any order — but TeamKey's value must then appear in
	// the list, so no operator version can render a filter that drops it.
	TeamsKey = "teams"
)

Variables

This section is empty.

Functions

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidcConfig asserts invalidConfigError.

func IsMissingCallbackURI

func IsMissingCallbackURI(err error) bool

IsMissingCallbackURI asserts missingCallbackURIError.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound asserts notFoundError.

func IsRequestFailed

func IsRequestFailed(err error) bool

IsRequestFailed asserts requestFailedError.

Types

type Config

type Config struct {
	Organization         string
	Teams                []string
	AppID                int64
	PrivateKey           []byte
	ClientID             string
	ClientSecret         string
	PreferredEmailDomain string
}

type Github

type Github struct {
	Client               *githubclient.Client
	Log                  logr.Logger
	Name                 string
	Description          string
	Type                 string
	Owner                string
	Organization         string
	Teams                []string
	PreferredEmailDomain string
	// contains filtered or unexported fields
}

func New

func New(config provider.ProviderConfig) (*Github, error)

func (*Github) CleanCredentialsForAuthenticatedApp

func (g *Github) CleanCredentialsForAuthenticatedApp(config provider.AppConfig) error

func (*Github) CreateApp

func (g *Github) CreateApp(config provider.AppConfig) (*githubclient.AppConfig, error)

func (*Github) CreateOrUpdateApp

func (g *Github) CreateOrUpdateApp(config provider.AppConfig, ctx context.Context, oldConnector dex.Connector) (provider.ProviderApp, error)

func (*Github) DeleteApp

func (g *Github) DeleteApp(name string, ctx context.Context) error

func (*Github) DeleteAuthenticatedApp added in v0.5.0

func (g *Github) DeleteAuthenticatedApp(config provider.AppConfig) error

func (*Github) GetAppData

func (g *Github) GetAppData(app *githubclient.AppConfig) Config

func (*Github) GetCredentialsForAuthenticatedApp

func (g *Github) GetCredentialsForAuthenticatedApp(config provider.AppConfig) (map[string]string, error)

func (*Github) GetName

func (g *Github) GetName() string

func (*Github) GetOwner

func (g *Github) GetOwner() string

func (*Github) GetProviderName

func (g *Github) GetProviderName() string

func (*Github) GetType

func (g *Github) GetType() string

func (*Github) RotateServiceCredentials added in v0.14.0

func (g *Github) RotateServiceCredentials(ctx context.Context, config provider.AppConfig) (map[string]string, error)

func (*Github) ShouldRotateServiceCredentials added in v0.14.0

func (g *Github) ShouldRotateServiceCredentials(ctx context.Context, config provider.AppConfig) (bool, error)

func (*Github) SupportsServiceCredentialRenewal added in v0.14.0

func (g *Github) SupportsServiceCredentialRenewal() bool

Self-renewal methods implementation - Github doesn't support renewal yet

func (*Github) UpdateNeeded

func (g *Github) UpdateNeeded(app *githubclient.App, config provider.AppConfig) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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