Documentation
¶
Overview ¶
Package credentials provides utilities for loading Cloudflare API credentials from various sources including CloudflareCredentials resources and Kubernetes secrets.
Index ¶
- Variables
- type Credentials
- type Loader
- func (l *Loader) LoadDefault(ctx context.Context) (*Credentials, error)
- func (l *Loader) LoadFromCloudflareDetails(ctx context.Context, details *networkingv1alpha2.CloudflareDetails, ...) (*Credentials, error)
- func (l *Loader) LoadFromCredentialsRef(ctx context.Context, ref *networkingv1alpha2.CloudflareCredentialsRef) (*Credentials, error)
Constants ¶
This section is empty.
Variables ¶
var ErrCredentialsRefNil = errors.New("credentialsRef is nil")
ErrCredentialsRefNil is returned when credentialsRef is nil
var ErrNoDefaultCredentials = errors.New("no default CloudflareCredentials found")
ErrNoDefaultCredentials is returned when no default CloudflareCredentials is found
var ErrNoValidCredentials = errors.New("no valid credentials found in secret")
ErrNoValidCredentials is returned when no valid credentials are found in secret
Functions ¶
This section is empty.
Types ¶
type Credentials ¶
type Credentials struct {
// AccountID is the Cloudflare account ID
AccountID string
// Domain is the default domain
Domain string
// APIToken is the API token (if using API token auth)
APIToken string
// APIKey is the Global API Key (if using Global API Key auth)
APIKey string
// Email is the email for Global API Key auth
Email string
// AuthType is the authentication type used
AuthType networkingv1alpha2.CloudflareAuthType
}
Credentials holds the resolved Cloudflare API credentials
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
Loader loads Cloudflare credentials from various sources
func (*Loader) LoadDefault ¶
func (l *Loader) LoadDefault(ctx context.Context) (*Credentials, error)
LoadDefault loads credentials from the default CloudflareCredentials resource
func (*Loader) LoadFromCloudflareDetails ¶
func (l *Loader) LoadFromCloudflareDetails(ctx context.Context, details *networkingv1alpha2.CloudflareDetails, namespace string) (*Credentials, error)
LoadFromCloudflareDetails loads credentials from legacy CloudflareDetails This maintains backwards compatibility with existing resources
func (*Loader) LoadFromCredentialsRef ¶
func (l *Loader) LoadFromCredentialsRef(ctx context.Context, ref *networkingv1alpha2.CloudflareCredentialsRef) (*Credentials, error)
LoadFromCredentialsRef loads credentials from a CloudflareCredentials resource