credentials

package
v0.0.0-...-f274180 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultCredentialFile = "cert.pem"
	OriginCertFlag        = "origincert"
)

Variables

This section is empty.

Functions

func FindDefaultOriginCertPath

func FindDefaultOriginCertPath() string

FindDefaultOriginCertPath returns the first path that contains a cert.pem file. If none of the DefaultConfigSearchDirectories contains a cert.pem file, return empty string

func FindOriginCert

func FindOriginCert(originCertPath string, log *zerolog.Logger) (string, error)

FindOriginCert will check to make sure that the certificate exists at the specified file path.

Types

type OriginCert

type OriginCert struct {
	ZoneID    string
	APIToken  string
	AccountID string
}

type User

type User struct {
	// contains filtered or unexported fields
}

func Read

func Read(originCertPath string, log *zerolog.Logger) (*User, error)

Read will load and read the origin cert.pem to load the user credentials

func (User) APIToken

func (c User) APIToken() string

func (User) AccountID

func (c User) AccountID() string

func (User) CertPath

func (c User) CertPath() string

func (*User) Client

func (c *User) Client(apiURL string, userAgent string, log *zerolog.Logger) (cfapi.Client, error)

Client uses the user credentials to create a Cloudflare API client

func (User) ZoneID

func (c User) ZoneID() string

Jump to

Keyboard shortcuts

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