Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultCipherSeed ¶
func RedactToken ¶
Types ¶
type ProbeState ¶
type ProbeState string
const ( ProbeStateMissing ProbeState = "missing" ProbeStateConfigured ProbeState = "configured" ProbeStateProbing ProbeState = "probing" ProbeStateValid ProbeState = "valid" ProbeStateInsufficientPermissions ProbeState = "insufficient_permissions" ProbeStateRevoked ProbeState = "revoked" ProbeStateError ProbeState = "error" )
func (ProbeState) IsValid ¶
func (s ProbeState) IsValid() bool
type ProjectContext ¶
type ProjectContext struct {
ProjectID uuid.UUID
OrganizationID uuid.UUID
ProjectRepositoryURL string
OrganizationCredential *StoredCredential
OrganizationProbe *TokenProbe
ProjectCredential *StoredCredential
ProjectProbe *TokenProbe
}
func (ProjectContext) CredentialForScope ¶
func (c ProjectContext) CredentialForScope(scope Scope) (*StoredCredential, *TokenProbe, error)
type RepoAccess ¶
type RepoAccess string
const ( RepoAccessNotChecked RepoAccess = "not_checked" RepoAccessGranted RepoAccess = "granted" RepoAccessDenied RepoAccess = "denied" )
func (RepoAccess) IsValid ¶
func (r RepoAccess) IsValid() bool
type RepositoryRef ¶
func ParseGitHubRepositoryURL ¶
func ParseGitHubRepositoryURL(raw string) (RepositoryRef, bool)
func (RepositoryRef) String ¶
func (r RepositoryRef) String() string
type ResolvedCredential ¶
type ResolvedCredential struct {
Scope Scope
Source Source
Token string
TokenPreview string
Probe TokenProbe
}
func ResolveProjectCredential ¶
func ResolveProjectCredential(context ProjectContext, decrypt func(StoredCredential) (string, error)) (ResolvedCredential, error)
type StoredCredential ¶
type TokenProbe ¶
type TokenProbe struct {
State ProbeState `json:"state"`
Configured bool `json:"configured"`
Valid bool `json:"valid"`
Login string `json:"login,omitempty"`
Permissions []string `json:"permissions"`
RepoAccess RepoAccess `json:"repo_access"`
CheckedAt *time.Time `json:"checked_at,omitempty"`
LastError string `json:"last_error,omitempty"`
}
func ConfiguredProbe ¶
func ConfiguredProbe() TokenProbe
func MissingProbe ¶
func MissingProbe() TokenProbe
func NormalizeProbe ¶
func NormalizeProbe(raw *TokenProbe, configured bool) TokenProbe
Click to show internal directories.
Click to hide internal directories.