githubauth

package
v0.2.2 Latest Latest
Warning

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

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

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 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) ImportGHCLICredential

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

func (*Service) ProbeResolvedCredential

func (s *Service) ProbeResolvedCredential(ctx context.Context, projectID uuid.UUID, repositoryURL string) (domain.TokenProbe, 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) SaveManualCredential

func (s *Service) SaveManualCredential(ctx context.Context, input SaveCredentialInput) (ProjectSecurity, 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