Documentation
¶
Index ¶
- Constants
- Variables
- func CredentialAccount(account string) string
- type AuthConfig
- type AuthError
- type AuthHeaders
- type AuthType
- type Authenticator
- type CredentialEntry
- type CredentialManager
- func (c *CredentialManager) DeletePAT(service, account string) error
- func (c *CredentialManager) GetBackend() string
- func (c *CredentialManager) GetPAT(service, account string) (string, error)
- func (c *CredentialManager) GetStoragePath() string
- func (c *CredentialManager) IsPlatformManagerAvailable() bool
- func (c *CredentialManager) SavePAT(service, account, pat string) error
Constants ¶
View Source
const ( ServicePAT = "azure-devops-cli-pat" ServiceAAD = "azure-devops-cli-aad" ServiceRefresh = "azure-devops-cli-refresh" )
Variables ¶
View Source
var ( ErrPATRequired = &AuthError{message: "PAT is required for PAT authentication"} ErrClientIDRequired = &AuthError{message: "Client ID is required for OAuth authentication"} ErrClientIDAndTenantRequired = &AuthError{message: "Client ID and Tenant ID are required for service principal authentication"} ErrInvalidAuthType = &AuthError{message: "Invalid authentication type"} )
Functions ¶
func CredentialAccount ¶ added in v0.1.3
Types ¶
type AuthConfig ¶
type AuthConfig struct {
Type AuthType `json:"type" yaml:"type"`
PAT string `json:"pat,omitempty" yaml:"pat,omitempty"`
ClientID string `json:"clientId,omitempty" yaml:"clientId,omitempty"`
ClientSecret string `json:"clientSecret,omitempty" yaml:"clientSecret,omitempty"`
TenantID string `json:"tenantId,omitempty" yaml:"tenantId,omitempty"`
ManagedID string `json:"managedId,omitempty" yaml:"managedId,omitempty"`
Scopes []string `json:"scopes,omitempty" yaml:"scopes,omitempty"`
}
func NewAuthConfig ¶
func NewAuthConfig(authType AuthType) *AuthConfig
func (*AuthConfig) GetScopes ¶
func (a *AuthConfig) GetScopes() []string
func (*AuthConfig) Validate ¶
func (a *AuthConfig) Validate() error
type AuthHeaders ¶
type Authenticator ¶
type Authenticator interface {
Validate() bool
Authenticate() (AuthHeaders, error)
GetHeaders() AuthHeaders
GetScopes() []string
GetExpiration() *int64
}
type CredentialEntry ¶
type CredentialManager ¶
type CredentialManager struct {
// contains filtered or unexported fields
}
func NewCredentialManager ¶
func NewCredentialManager(storageDir string) (*CredentialManager, error)
func (*CredentialManager) DeletePAT ¶
func (c *CredentialManager) DeletePAT(service, account string) error
func (*CredentialManager) GetBackend ¶
func (c *CredentialManager) GetBackend() string
func (*CredentialManager) GetPAT ¶
func (c *CredentialManager) GetPAT(service, account string) (string, error)
func (*CredentialManager) GetStoragePath ¶
func (c *CredentialManager) GetStoragePath() string
func (*CredentialManager) IsPlatformManagerAvailable ¶
func (c *CredentialManager) IsPlatformManagerAvailable() bool
func (*CredentialManager) SavePAT ¶
func (c *CredentialManager) SavePAT(service, account, pat string) error
Click to show internal directories.
Click to hide internal directories.