Documentation ¶
Index ¶
- Constants
- func CheckFile(name string) (bool, error)
- func GetKeyType(ctx context.Context, value string) certcrypto.KeyType
- type Account
- type CertAndStore
- type Certificate
- type ChallengeHTTP
- type ChallengeTLSALPN
- func (c *ChallengeTLSALPN) CleanUp(domain, _, keyAuth string) error
- func (c *ChallengeTLSALPN) Init() error
- func (c *ChallengeTLSALPN) ListenConfiguration(conf dynamic.Configuration)
- func (c *ChallengeTLSALPN) Present(domain, _, keyAuth string) error
- func (c *ChallengeTLSALPN) Provide(configurationChan chan<- dynamic.Message, _ *safe.Pool) error
- func (c *ChallengeTLSALPN) ThrottleDuration() time.Duration
- type Configuration
- type DNSChallenge
- type EAB
- type HTTPChallenge
- type LocalStore
- func (s *LocalStore) GetAccount(resolverName string) (*Account, error)
- func (s *LocalStore) GetCertificates(resolverName string) ([]*CertAndStore, error)
- func (s *LocalStore) SaveAccount(resolverName string, account *Account) error
- func (s *LocalStore) SaveCertificates(resolverName string, certificates []*CertAndStore) error
- type Provider
- func (p *Provider) Init() error
- func (p *Provider) ListenConfiguration(config dynamic.Configuration)
- func (p *Provider) Provide(configurationChan chan<- dynamic.Message, pool *safe.Pool) error
- func (p *Provider) SetConfigListenerChan(configFromListenerChan chan dynamic.Configuration)
- func (p *Provider) SetTLSManager(tlsManager *traefiktls.Manager)
- func (p *Provider) ThrottleDuration() time.Duration
- type Store
- type StoredData
- type TLSChallenge
Constants ¶
const (
// RegistrationURLPathV1Regexp is a regexp which match ACME registration URL in the V1 format.
RegistrationURLPathV1Regexp = `^.*/acme/reg/\d+$`
)
Variables ¶
This section is empty.
Functions ¶
func GetKeyType ¶
func GetKeyType(ctx context.Context, value string) certcrypto.KeyType
GetKeyType used to determine which algo to used.
Types ¶
type Account ¶
type Account struct { Email string Registration *registration.Resource PrivateKey []byte KeyType certcrypto.KeyType }
Account is used to store lets encrypt registration info.
func NewAccount ¶
NewAccount creates an account.
func (*Account) GetPrivateKey ¶
func (a *Account) GetPrivateKey() crypto.PrivateKey
GetPrivateKey returns private key.
func (*Account) GetRegistration ¶
func (a *Account) GetRegistration() *registration.Resource
GetRegistration returns lets encrypt registration resource.
type CertAndStore ¶
type CertAndStore struct { Certificate Store string }
CertAndStore allows mapping a TLS certificate to a TLS store.
type Certificate ¶
type Certificate struct { Domain types.Domain `json:"domain,omitempty" toml:"domain,omitempty" yaml:"domain,omitempty"` Certificate []byte `json:"certificate,omitempty" toml:"certificate,omitempty" yaml:"certificate,omitempty"` Key []byte `json:"key,omitempty" toml:"key,omitempty" yaml:"key,omitempty"` }
Certificate is a struct which contains all data needed from an ACME certificate.
type ChallengeHTTP ¶
type ChallengeHTTP struct {
// contains filtered or unexported fields
}
ChallengeHTTP HTTP challenge provider implements challenge.Provider.
func NewChallengeHTTP ¶
func NewChallengeHTTP() *ChallengeHTTP
NewChallengeHTTP creates a new ChallengeHTTP.
func (*ChallengeHTTP) CleanUp ¶
func (c *ChallengeHTTP) CleanUp(domain, token, _ string) error
CleanUp cleans the challenges when certificate is obtained.
func (*ChallengeHTTP) Present ¶
func (c *ChallengeHTTP) Present(domain, token, keyAuth string) error
Present presents a challenge to obtain new ACME certificate.
func (*ChallengeHTTP) ServeHTTP ¶
func (c *ChallengeHTTP) ServeHTTP(rw http.ResponseWriter, req *http.Request)
func (*ChallengeHTTP) Timeout ¶
func (c *ChallengeHTTP) Timeout() (timeout, interval time.Duration)
Timeout calculates the maximum of time allowed to resolved an ACME challenge.
type ChallengeTLSALPN ¶
type ChallengeTLSALPN struct {
// contains filtered or unexported fields
}
ChallengeTLSALPN TLSALPN challenge provider implements challenge.Provider.
func NewChallengeTLSALPN ¶
func NewChallengeTLSALPN() *ChallengeTLSALPN
NewChallengeTLSALPN creates a new ChallengeTLSALPN.
func (*ChallengeTLSALPN) CleanUp ¶
func (c *ChallengeTLSALPN) CleanUp(domain, _, keyAuth string) error
CleanUp cleans the challenges when certificate is obtained.
func (*ChallengeTLSALPN) ListenConfiguration ¶
func (c *ChallengeTLSALPN) ListenConfiguration(conf dynamic.Configuration)
ListenConfiguration sets a new Configuration into the configurationChan.
func (*ChallengeTLSALPN) Present ¶
func (c *ChallengeTLSALPN) Present(domain, _, keyAuth string) error
Present presents a challenge to obtain new ACME certificate.
func (*ChallengeTLSALPN) Provide ¶
Provide allows the provider to provide configurations to traefik using the given configuration channel.
func (*ChallengeTLSALPN) ThrottleDuration ¶
func (c *ChallengeTLSALPN) ThrottleDuration() time.Duration
ThrottleDuration returns the throttle duration.
type Configuration ¶
type Configuration struct { Email string `description:"Email address used for registration." json:"email,omitempty" toml:"email,omitempty" yaml:"email,omitempty"` CAServer string `description:"CA server to use." json:"caServer,omitempty" toml:"caServer,omitempty" yaml:"caServer,omitempty"` PreferredChain string `` /* 147-byte string literal not displayed */ Storage string `description:"Storage to use." json:"storage,omitempty" toml:"storage,omitempty" yaml:"storage,omitempty" export:"true"` KeyType string `` /* 218-byte string literal not displayed */ EAB *EAB `description:"External Account Binding to use." json:"eab,omitempty" toml:"eab,omitempty" yaml:"eab,omitempty"` CertificatesDuration int `` /* 174-byte string literal not displayed */ DNSChallenge *DNSChallenge `` /* 181-byte string literal not displayed */ HTTPChallenge *HTTPChallenge `` /* 185-byte string literal not displayed */ TLSChallenge *TLSChallenge `` /* 186-byte string literal not displayed */ }
Configuration holds ACME configuration provided by users.
func (*Configuration) SetDefaults ¶
func (a *Configuration) SetDefaults()
SetDefaults sets the default values.
type DNSChallenge ¶
type DNSChallenge struct { Provider string `` /* 162-byte string literal not displayed */ DelayBeforeCheck ptypes.Duration `` /* 222-byte string literal not displayed */ Resolvers []string `` /* 151-byte string literal not displayed */ DisablePropagationCheck bool `` /* 258-byte string literal not displayed */ }
DNSChallenge contains DNS challenge configuration.
type EAB ¶
type EAB struct { Kid string `` /* 126-byte string literal not displayed */ HmacEncoded string `` /* 159-byte string literal not displayed */ }
EAB contains External Account Binding configuration.
type HTTPChallenge ¶
type HTTPChallenge struct {
EntryPoint string `` /* 137-byte string literal not displayed */
}
HTTPChallenge contains HTTP challenge configuration.
type LocalStore ¶
type LocalStore struct {
// contains filtered or unexported fields
}
LocalStore Stores implementation for local file.
func NewLocalStore ¶
func NewLocalStore(filename string) *LocalStore
NewLocalStore initializes a new LocalStore with a file name.
func (*LocalStore) GetAccount ¶
func (s *LocalStore) GetAccount(resolverName string) (*Account, error)
GetAccount returns ACME Account.
func (*LocalStore) GetCertificates ¶
func (s *LocalStore) GetCertificates(resolverName string) ([]*CertAndStore, error)
GetCertificates returns ACME Certificates list.
func (*LocalStore) SaveAccount ¶
func (s *LocalStore) SaveAccount(resolverName string, account *Account) error
SaveAccount stores ACME Account.
func (*LocalStore) SaveCertificates ¶
func (s *LocalStore) SaveCertificates(resolverName string, certificates []*CertAndStore) error
SaveCertificates stores ACME Certificates list.
type Provider ¶
type Provider struct { *Configuration ResolverName string Store Store `json:"store,omitempty" toml:"store,omitempty" yaml:"store,omitempty"` TLSChallengeProvider challenge.Provider HTTPChallengeProvider challenge.Provider // contains filtered or unexported fields }
Provider holds configurations of the provider.
func (*Provider) ListenConfiguration ¶
func (p *Provider) ListenConfiguration(config dynamic.Configuration)
ListenConfiguration sets a new Configuration into the configFromListenerChan.
func (*Provider) Provide ¶
Provide allows the file provider to provide configurations to traefik using the given Configuration channel.
func (*Provider) SetConfigListenerChan ¶
func (p *Provider) SetConfigListenerChan(configFromListenerChan chan dynamic.Configuration)
SetConfigListenerChan initializes the configFromListenerChan.
func (*Provider) SetTLSManager ¶
func (p *Provider) SetTLSManager(tlsManager *traefiktls.Manager)
SetTLSManager sets the tls manager to use.
func (*Provider) ThrottleDuration ¶
ThrottleDuration returns the throttle duration.
type Store ¶
type Store interface { GetAccount(resolverName string) (*Account, error) SaveAccount(resolverName string, account *Account) error GetCertificates(resolverName string) ([]*CertAndStore, error) SaveCertificates(resolverName string, certificates []*CertAndStore) error }
Store is a generic interface that represents a storage.
type StoredData ¶
type StoredData struct { Account *Account Certificates []*CertAndStore }
StoredData represents the data managed by Store.