githubauth

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2026 License: Apache-2.0 Imports: 21 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnavailable             = errors.New("github auth service unavailable")
	ErrInvalidInput            = errors.New("invalid GitHub auth input")
	ErrCredentialNotConfigured = errors.New("GitHub credential is not configured")
	ErrGHCLIImportFailed       = errors.New("failed to import gh auth token")
)

Functions

func ApplyWorkspaceAuth

func ApplyWorkspaceAuth(
	ctx context.Context,
	resolver TokenResolver,
	projectID uuid.UUID,
	request workspaceinfra.SetupRequest,
) (workspaceinfra.SetupRequest, error)

Types

type OrgInput added in v0.3.0

type OrgInput struct {
	OrganizationID uuid.UUID
}

type OrgSaveCredentialInput added in v0.3.0

type OrgSaveCredentialInput struct {
	OrganizationID uuid.UUID
	Token          string
}

type OrgSecurity added in v0.3.0

type OrgSecurity struct {
	Organization ScopedSecurity
}

type OrgSecurityManager added in v0.3.0

type OrgSecurityManager interface {
	ReadOrgSecurity(ctx context.Context, orgID uuid.UUID) (OrgSecurity, error)
	SaveOrgManualCredential(ctx context.Context, input OrgSaveCredentialInput) (OrgSecurity, error)
	ImportOrgGHCLICredential(ctx context.Context, input OrgInput) (OrgSecurity, error)
	RetestOrgCredential(ctx context.Context, input OrgInput) (OrgSecurity, error)
	DeleteOrgCredential(ctx context.Context, input OrgInput) (OrgSecurity, error)
}

type ProjectSecurity

type ProjectSecurity struct {
	Effective       ScopedSecurity
	Organization    ScopedSecurity
	ProjectOverride ScopedSecurity
}

type SaveCredentialInput

type SaveCredentialInput struct {
	ProjectID uuid.UUID
	Scope     domain.Scope
	Token     string
}

type ScopeInput

type ScopeInput struct {
	ProjectID uuid.UUID
	Scope     domain.Scope
}

type ScopedSecurity

type ScopedSecurity struct {
	Scope        domain.Scope
	Configured   bool
	Source       domain.Source
	TokenPreview string
	Probe        domain.TokenProbe
}

type SecurityManager

type SecurityManager interface {
	ReadProjectSecurity(ctx context.Context, projectID uuid.UUID) (ProjectSecurity, error)
	SaveManualCredential(ctx context.Context, input SaveCredentialInput) (ProjectSecurity, error)
	ImportGHCLICredential(ctx context.Context, input ScopeInput) (ProjectSecurity, error)
	RetestCredential(ctx context.Context, input ScopeInput) (ProjectSecurity, error)
	DeleteCredential(ctx context.Context, input ScopeInput) (ProjectSecurity, error)
}

type Service

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

func New

func New(repository repo.Repository, httpClient *http.Client, cipherSeed string) (*Service, error)

func (*Service) DeleteCredential

func (s *Service) DeleteCredential(ctx context.Context, input ScopeInput) (ProjectSecurity, error)

func (*Service) DeleteOrgCredential added in v0.3.0

func (s *Service) DeleteOrgCredential(ctx context.Context, input OrgInput) (OrgSecurity, error)

func (*Service) ImportGHCLICredential

func (s *Service) ImportGHCLICredential(ctx context.Context, input ScopeInput) (ProjectSecurity, error)

func (*Service) ImportOrgGHCLICredential added in v0.3.0

func (s *Service) ImportOrgGHCLICredential(ctx context.Context, input OrgInput) (OrgSecurity, error)

func (*Service) ProbeResolvedCredential

func (s *Service) ProbeResolvedCredential(ctx context.Context, projectID uuid.UUID, repositoryURL string) (domain.TokenProbe, error)

func (*Service) ReadOrgSecurity added in v0.3.0

func (s *Service) ReadOrgSecurity(ctx context.Context, orgID uuid.UUID) (OrgSecurity, error)

func (*Service) ReadProjectSecurity

func (s *Service) ReadProjectSecurity(ctx context.Context, projectID uuid.UUID) (ProjectSecurity, error)

func (*Service) ResolveProjectCredential

func (s *Service) ResolveProjectCredential(ctx context.Context, projectID uuid.UUID) (domain.ResolvedCredential, error)

func (*Service) RetestCredential

func (s *Service) RetestCredential(ctx context.Context, input ScopeInput) (ProjectSecurity, error)

func (*Service) RetestOrgCredential added in v0.3.0

func (s *Service) RetestOrgCredential(ctx context.Context, input OrgInput) (OrgSecurity, error)

func (*Service) SaveManualCredential

func (s *Service) SaveManualCredential(ctx context.Context, input SaveCredentialInput) (ProjectSecurity, error)

func (*Service) SaveOrgManualCredential added in v0.3.0

func (s *Service) SaveOrgManualCredential(ctx context.Context, input OrgSaveCredentialInput) (OrgSecurity, error)

func (*Service) SealToken

func (s *Service) SealToken(token string, source domain.Source) (domain.StoredCredential, error)

type TokenResolver

type TokenResolver interface {
	ResolveProjectCredential(ctx context.Context, projectID uuid.UUID) (domain.ResolvedCredential, error)
}

Jump to

Keyboard shortcuts

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