Versions in this module Expand all Collapse all v0 v0.2.0 Apr 26, 2026 Changes in this version + var ErrAuthenticationFailed = errors.New("authentication failed") + var ErrAuthorizationTimeout = errors.New("authorization timeout - please try again") + var ErrBrowserOpenFailed = errors.New("failed to open browser for authorization") + var ErrChecksumMismatch = errors.New("checksum verification failed") + var ErrConfigSaveFailed = errors.New("failed to save authentication configuration") + var ErrCredentialsRequired = errors.New("credentials required") + var ErrDownloadFailed = errors.New("failed to download plugin") + var ErrExtractionFailed = errors.New("failed to extract plugin archive") + var ErrInvalidPluginID = errors.New("invalid plugin ID format") + var ErrNoAuthMethodsSupported = errors.New("registry does not support any known authentication methods") + var ErrNoCredentials = errors.New("no credentials found - run 'bluelink plugins login' first") + var ErrPluginNotFound = errors.New("plugin not found") + var ErrServiceDiscoveryFailed = errors.New("failed to fetch service discovery document") + var ErrSignatureInvalid = errors.New("signature verification failed") + var ErrSignatureMissing = errors.New("signature required but not provided by registry") + var ErrSigningKeysMissing = errors.New("signing keys required but not provided by registry") + var ErrStateMismatch = errors.New("OAuth2 state parameter mismatch") + var ErrTokenExchangeFailed = errors.New("failed to exchange authorization code for token") + var ErrTokenRefreshFailed = errors.New("failed to refresh access token") + var ErrVersionNotFound = errors.New("version not found") + func DefaultBrowserOpener(url string) error + func GetAuthConfigPath() string + func GetTokenStorePath() string + func NormalizeRegistryHost(host string) string + type APIKeyCredentialStore struct + func NewAPIKeyCredentialStore(authConfigStore *AuthConfigStore) *APIKeyCredentialStore + func NewAPIKeyCredentialStoreWithHTTPClient(httpClient *http.Client, authConfigStore *AuthConfigStore) *APIKeyCredentialStore + func (a *APIKeyCredentialStore) Store(_ context.Context, registryHost string, _ *AuthV1Config, apiKey string) error + func (a *APIKeyCredentialStore) Verify(ctx context.Context, registryHost string, authConfig *AuthV1Config, ...) error + type AuthCodeResult struct + AccessToken string + ClientId string + RefreshToken string + TokenExpiry *time.Time + type AuthConfigFile map[string]*RegistryAuthConfig + type AuthConfigStore struct + func NewAuthConfigStore() *AuthConfigStore + func NewAuthConfigStoreWithPath(path string) *AuthConfigStore + func (s *AuthConfigStore) GetRegistryAuth(registryHost string) (*RegistryAuthConfig, error) + func (s *AuthConfigStore) HasRegistryAuth(registryHost string) (bool, error) + func (s *AuthConfigStore) Load() (AuthConfigFile, error) + func (s *AuthConfigStore) Path() string + func (s *AuthConfigStore) RemoveRegistryAuth(registryHost string) error + func (s *AuthConfigStore) Save(config AuthConfigFile) error + func (s *AuthConfigStore) SaveRegistryAuth(registryHost string, auth *RegistryAuthConfig) error + type AuthType string + const AuthTypeAPIKey + const AuthTypeOAuth2AuthCode + const AuthTypeOAuth2ClientCreds + type AuthV1Config struct + APIKeyHeader string + Authorize string + ClientId string + DownloadAuth string + Endpoint string + GrantTypes []string + PKCE bool + Token string + func (c *AuthV1Config) GetAuthorizeURL() string + func (c *AuthV1Config) GetSupportedAuthTypes() []AuthType + func (c *AuthV1Config) GetTokenURL() string + func (c *AuthV1Config) SupportsAuthType(authType AuthType) bool + func (c *AuthV1Config) SupportsPKCE() bool + type BrowserOpener func(url string) error + type OAuth2AuthCodeAuthenticator struct + func NewOAuth2AuthCodeAuthenticator(tokenStore *TokenStore) *OAuth2AuthCodeAuthenticator + func NewOAuth2AuthCodeAuthenticatorWithOptions(httpClient *http.Client, tokenStore *TokenStore, browserOpener BrowserOpener, ...) *OAuth2AuthCodeAuthenticator + func (a *OAuth2AuthCodeAuthenticator) Authenticate(ctx context.Context, registryHost string, authConfig *AuthV1Config) (*AuthCodeResult, error) + func (a *OAuth2AuthCodeAuthenticator) RefreshTokens(ctx context.Context, registryHost string, authConfig *AuthV1Config) (*AuthCodeResult, error) + type OAuth2ClientConfig struct + ClientId string + ClientSecret string + type OAuth2ClientCredsStore struct + func NewOAuth2ClientCredsStore(authConfigStore *AuthConfigStore) *OAuth2ClientCredsStore + func NewOAuth2ClientCredsStoreWithHTTPClient(httpClient *http.Client, authConfigStore *AuthConfigStore) *OAuth2ClientCredsStore + func (a *OAuth2ClientCredsStore) ObtainToken(ctx context.Context, authConfig *AuthV1Config, clientId string, ...) (*oauth2.Token, error) + func (a *OAuth2ClientCredsStore) Store(_ context.Context, registryHost string, _ *AuthV1Config, clientId string, ...) error + type PluginPackageMetadata struct + Arch string + Dependencies map[string]string + DownloadURL string + Filename string + OS string + Shasum string + ShasumsSignatureURL string + ShasumsURL string + SigningKeys map[string]string + type PluginServiceConfig struct + DownloadAcceptContentType string + Endpoint string + type PluginType string + const PluginTypeProvider + const PluginTypeTransformer + const PluginTypeUnknown + type PluginVersionInfo struct + SupportedProtocols []string + Version string + type PluginVersionsResponse struct + Versions []PluginVersionInfo + type ProgressFunc func(downloaded, total int64) + type RegistryAuthConfig struct + APIKey string + OAuth2 *OAuth2ClientConfig + type RegistryClient struct + func NewRegistryClient(authConfigStore *AuthConfigStore, tokenStore *TokenStore, ...) *RegistryClient + func NewRegistryClientWithHTTPClient(httpClient *http.Client, authConfigStore *AuthConfigStore, ...) *RegistryClient + func (c *RegistryClient) DownloadPackage(ctx context.Context, registryHost string, metadata *PluginPackageMetadata, ...) error + func (c *RegistryClient) DownloadShasums(ctx context.Context, registryHost, shasumsURL string) ([]byte, error) + func (c *RegistryClient) DownloadSignature(ctx context.Context, registryHost, signatureURL string) ([]byte, error) + func (c *RegistryClient) GetPackageMetadata(ctx context.Context, ...) (*PluginPackageMetadata, error) + func (c *RegistryClient) ListVersions(ctx context.Context, registryHost, namespace, pluginName string) (*PluginVersionsResponse, error) + type RegistryTokens struct + AccessToken string + ClientId string + RefreshToken string + TokenExpiry *time.Time + func (t *RegistryTokens) IsExpired() bool + type ServiceDiscoveryClient struct + func NewServiceDiscoveryClient() *ServiceDiscoveryClient + func NewServiceDiscoveryClientWithHTTPClient(client *http.Client) *ServiceDiscoveryClient + func (c *ServiceDiscoveryClient) Discover(ctx context.Context, registryHost string) (*ServiceDiscoveryDocument, error) + func (c *ServiceDiscoveryClient) DiscoverAuthConfig(ctx context.Context, registryHost string) (*AuthV1Config, error) + func (c *ServiceDiscoveryClient) GetPluginType(ctx context.Context, registryHost string) (PluginType, error) + type ServiceDiscoveryDocument struct + Auth *AuthV1Config + ProviderV1 *PluginServiceConfig + TransformerV1 *PluginServiceConfig + type TokenStore struct + func NewTokenStore() *TokenStore + func NewTokenStoreWithPath(path string) *TokenStore + func (s *TokenStore) GetRegistryTokens(registryHost string) (*RegistryTokens, error) + func (s *TokenStore) GetValidTokens(registryHost string) (*RegistryTokens, error) + func (s *TokenStore) HasRegistryTokens(registryHost string) (bool, error) + func (s *TokenStore) Load() (TokensFile, error) + func (s *TokenStore) Path() string + func (s *TokenStore) RemoveRegistryTokens(registryHost string) error + func (s *TokenStore) Save(tokens TokensFile) error + func (s *TokenStore) SaveRegistryTokens(registryHost string, tokens *RegistryTokens) error + type TokensFile map[string]*RegistryTokens