legowrap

package module
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2026 License: MIT Imports: 18 Imported by: 0

README

legowrap PkgGoDev

Package legowrap provides a wrapper API for go-acme/lego: Let's Encrypt/ACME client and library written in Go.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCetificateBundleStartsWithCA = errors.New("certificate bundle starts with a CA certificate")
View Source
var ErrNoRenewal = errors.New("no renewal")
View Source
var ErrSkipRenewal = errors.New("skip renewal")

Functions

func WasIssuedByAnotherAccountError

func WasIssuedByAnotherAccountError(err error) bool

func WasIssuedByAnotherIssuerError

func WasIssuedByAnotherIssuerError(err error) bool

Types

type ARIConfig

type ARIConfig struct {
	Disable             bool          `yaml:"disable"`
	WaitToRenewDuration time.Duration `yaml:"wait_to_renew_duration"`
}

type Account

type Account struct {
	Email        string                 `json:"email"`
	Registration *registration.Resource `json:"registration"`
	PrivateKey   crypto.PrivateKey      `json:"-"`
}

Account represents a users local saved credentials.

func (*Account) GetEmail

func (a *Account) GetEmail() string

GetEmail returns the email address for the account.

func (*Account) GetPrivateKey

func (a *Account) GetPrivateKey() crypto.PrivateKey

GetPrivateKey returns the private RSA account key.

func (*Account) GetRegistration

func (a *Account) GetRegistration() *registration.Resource

GetRegistration returns the server registration.

type AccountConfig

type AccountConfig struct {
	Email        string `yaml:"email" json:"email"`
	ResourceJSON string `yaml:"resource_json" json:"resource_json"`
	PrivateKey   string `yaml:"private_key" json:"private_key"`
}

type CertificateConfig

type CertificateConfig struct {
	KeyType             string                         `yaml:"key_type"`
	Timeout             time.Duration                  `yaml:"timeout"`
	OverallRequestLimit int                            `yaml:"overall_request_limit"`
	DisableCommonName   bool                           `yaml:"disable_common_name"`
	ObtainRequest       CertificateObtainRequestConfig `yaml:"obtain_request"`
}

type CertificateObtainRequestConfig

type CertificateObtainRequestConfig struct {
	MustStaple                     bool   `yaml:"must_staple"`
	Bundle                         bool   `yaml:"bundle"`
	PreferredChain                 string `yaml:"preferred_chain"`
	Profile                        string `yaml:"profile"`
	AlwaysDeactivateAuthorizations bool   `yaml:"always_deactivate_authorizations"`
}

type Client

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

func NewClient

func NewClient(cfg *Config, acc registration.User, opts ...Option) (*Client, error)

func (*Client) IssueNewCertificate

func (c *Client) IssueNewCertificate(domains []string) (*certificate.Resource, error)

func (*Client) RegisterAccount

func (c *Client) RegisterAccount(opts registration.RegisterOptions) (*registration.Resource, error)

func (*Client) RenewCertificate

func (c *Client) RenewCertificate(domain string, domains []string,
	curCert *x509.Certificate,
	skipRenew bool) (*certificate.Resource, error)

func (*Client) SetDNS01Provider

func (c *Client) SetDNS01Provider(dnsProvider challenge.Provider) error

type Config

type Config struct {
	CADirURL    string            `yaml:"ca_dir_url"`
	UserAgent   string            `yaml:"user_agent"`
	Register    RegisterConfig    `yaml:"register"`
	Account     AccountConfig     `yaml:"account"`
	Certificate CertificateConfig `yaml:"certificate"`
	HTTPClient  HTTPClientConfig  `yaml:"http_client"`
	DNS         DNSConfig         `yaml:"dns"`
	ARI         ARIConfig         `yaml:"ari"`
	Renew       RenewConfig       `yaml:"renew"`
}

type DNSConfig

type DNSConfig struct {
	Timeout               time.Duration `yaml:"timeout"`
	Resolvers             []string      `yaml:"resolvers"`
	DisableCP             bool          `yaml:"disable_cp"`
	PropagationDisableANS bool          `yaml:"propagation_disable_ans"`
	PropagationRNS        bool          `yaml:"propagation_rns"`
	PropagationWait       time.Duration `yaml:"propagation_wait"`
}

type HTTPClientConfig

type HTTPClientConfig struct {
	Timeout       time.Duration `yaml:"timeout"`
	TLSSkipVerify bool          `yaml:"tls_skip_verify"`
}

type KeyType

type KeyType int
const (
	KeyTypeInvalid KeyType = iota
	KeyTypeEC256
	KeyTypeEC384
	KeyTypeRSA2048
	KeyTypeRSA3072
	KeyTypeRSA4096
	KeyTypeRSA8192
)

func KeyTypeFromString

func KeyTypeFromString(s string) (KeyType, error)

type LegoSlogAdapter

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

func NewLegoSlogAdapter

func NewLegoSlogAdapter(wrapped SlogLeveledLogger) *LegoSlogAdapter

func (*LegoSlogAdapter) Fatal

func (l *LegoSlogAdapter) Fatal(args ...any)

func (*LegoSlogAdapter) Fatalf

func (l *LegoSlogAdapter) Fatalf(format string, args ...any)

func (*LegoSlogAdapter) Fatalln

func (l *LegoSlogAdapter) Fatalln(args ...any)

func (*LegoSlogAdapter) Print

func (l *LegoSlogAdapter) Print(args ...any)

func (*LegoSlogAdapter) Printf

func (l *LegoSlogAdapter) Printf(format string, args ...any)

func (*LegoSlogAdapter) Println

func (l *LegoSlogAdapter) Println(args ...any)

type Option

type Option func(*Client)

func WithSlogLogger

func WithSlogLogger(logger *slog.Logger) Option

type RegisterConfig

type RegisterConfig struct {
	EAB  bool   `yaml:"eab"`
	KID  string `yaml:"kid"`
	HMAC string `yaml:"hmac"`
}

type RenewConfig

type RenewConfig struct {
	Days    int  `yaml:"days"`
	Dynamic bool `yaml:"dynamic"`
}

type SlogLeveledLogger

type SlogLeveledLogger interface {
	Info(msg string, args ...any)
	Warn(msg string, args ...any)
	Error(msg string, args ...any)
}

Directories

Path Synopsis
cmd
providers
dns/sakuracloud
Package sakuracloud implements a DNS provider for solving the DNS-01 challenge using SakuraCloud DNS.
Package sakuracloud implements a DNS provider for solving the DNS-01 challenge using SakuraCloud DNS.

Jump to

Keyboard shortcuts

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