credentials

package
v0.22.3 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package credentials provides utilities for loading Cloudflare API credentials from various sources including CloudflareCredentials resources and Kubernetes secrets.

Index

Constants

This section is empty.

Variables

View Source
var ErrCredentialsRefNil = errors.New("credentialsRef is nil")

ErrCredentialsRefNil is returned when credentialsRef is nil

View Source
var ErrNoDefaultCredentials = errors.New("no default CloudflareCredentials found")

ErrNoDefaultCredentials is returned when no default CloudflareCredentials is found

View Source
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 NewLoader

func NewLoader(c client.Client, log logr.Logger) *Loader

NewLoader creates a new credential loader

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL