Documentation ¶
Index ¶
- type BadHSMOCSPSigner
- type BadHSMSigner
- type DNSResolver
- func (mock *DNSResolver) ExchangeOne(hostname string, qt uint16) (rsp *dns.Msg, rtt time.Duration, err error)
- func (mock *DNSResolver) LookupCAA(domain string) ([]*dns.CAA, time.Duration, error)
- func (mock *DNSResolver) LookupCNAME(domain string) (string, time.Duration, error)
- func (mock *DNSResolver) LookupDNAME(domain string) (string, time.Duration, error)
- func (mock *DNSResolver) LookupHost(hostname string) ([]net.IP, time.Duration, error)
- func (mock *DNSResolver) LookupMX(domain string) ([]string, time.Duration, error)
- func (mock *DNSResolver) LookupTXT(hostname string) ([]string, time.Duration, error)
- type LogMessage
- type Publisher
- type Statter
- type StorageAuthority
- func (sa *StorageAuthority) AddCertificate(certDER []byte, regID int64) (digest string, err error)
- func (sa *StorageAuthority) AddSCTReceipt(sct core.SignedCertificateTimestamp) (err error)
- func (sa *StorageAuthority) AlreadyDeniedCSR([]string) (bool, error)
- func (sa *StorageAuthority) CountCertificatesByNames(_ []string, _, _ time.Time) (ret map[string]int, err error)
- func (sa *StorageAuthority) CountCertificatesRange(_, _ time.Time) (int64, error)
- func (sa *StorageAuthority) CountPendingAuthorizations(_ int64) (int, error)
- func (sa *StorageAuthority) CountRegistrationsByIP(_ net.IP, _, _ time.Time) (int, error)
- func (sa *StorageAuthority) FinalizeAuthorization(authz core.Authorization) (err error)
- func (sa *StorageAuthority) GetAuthorization(id string) (core.Authorization, error)
- func (sa *StorageAuthority) GetCertificate(serial string) (core.Certificate, error)
- func (sa *StorageAuthority) GetCertificateStatus(serial string) (core.CertificateStatus, error)
- func (sa *StorageAuthority) GetLatestValidAuthorization(registrationID int64, identifier core.AcmeIdentifier) (authz core.Authorization, err error)
- func (sa *StorageAuthority) GetRegistration(id int64) (core.Registration, error)
- func (sa *StorageAuthority) GetRegistrationByKey(jwk jose.JsonWebKey) (core.Registration, error)
- func (sa *StorageAuthority) GetSCTReceipt(serial string, logID string) (sct core.SignedCertificateTimestamp, err error)
- func (sa *StorageAuthority) MarkCertificateRevoked(serial string, reasonCode core.RevocationCode) (err error)
- func (sa *StorageAuthority) NewPendingAuthorization(authz core.Authorization) (output core.Authorization, err error)
- func (sa *StorageAuthority) NewRegistration(reg core.Registration) (regR core.Registration, err error)
- func (sa *StorageAuthority) UpdateOCSP(serial string, ocspResponse []byte) (err error)
- func (sa *StorageAuthority) UpdatePendingAuthorization(authz core.Authorization) (err error)
- func (sa *StorageAuthority) UpdateRegistration(reg core.Registration) (err error)
- type SyslogWriter
- func (msw *SyslogWriter) Alert(m string) error
- func (msw *SyslogWriter) Clear()
- func (msw *SyslogWriter) Close() error
- func (msw *SyslogWriter) Crit(m string) error
- func (msw *SyslogWriter) Debug(m string) error
- func (msw *SyslogWriter) Emerg(m string) error
- func (msw *SyslogWriter) Err(m string) error
- func (msw *SyslogWriter) GetAll() []*LogMessage
- func (msw *SyslogWriter) GetAllMatching(reString string) (matches []*LogMessage)
- func (msw *SyslogWriter) Info(m string) error
- func (msw *SyslogWriter) Notice(m string) error
- func (msw *SyslogWriter) Warning(m string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BadHSMOCSPSigner ¶
type BadHSMOCSPSigner string
BadHSMOCSPSigner represents a CFSSL OCSP signer that always returns a PKCS#11 error
func (BadHSMOCSPSigner) Sign ¶
func (bhos BadHSMOCSPSigner) Sign(ocsp.SignRequest) ([]byte, error)
Sign always returns a PKCS#11 error, in the format used by github.com/miekg/pkcs11
type BadHSMSigner ¶
type BadHSMSigner string
BadHSMSigner represents a CFSSL signer that always returns a PKCS#11 error.
func (BadHSMSigner) SetPolicy ¶
func (bhs BadHSMSigner) SetPolicy(*config.Signing)
SetPolicy is a mock
func (BadHSMSigner) SigAlgo ¶
func (bhs BadHSMSigner) SigAlgo() x509.SignatureAlgorithm
SigAlgo is a mock
func (BadHSMSigner) Sign ¶
func (bhs BadHSMSigner) Sign(req signer.SignRequest) (cert []byte, err error)
Sign always returns a PKCS#11 error, in the format used by github.com/miekg/pkcs11
type DNSResolver ¶
type DNSResolver struct { }
DNSResolver is a mock
func (*DNSResolver) ExchangeOne ¶
func (mock *DNSResolver) ExchangeOne(hostname string, qt uint16) (rsp *dns.Msg, rtt time.Duration, err error)
ExchangeOne is a mock
func (*DNSResolver) LookupCNAME ¶
LookupCNAME is a mock
func (*DNSResolver) LookupDNAME ¶
LookupDNAME is a mock
func (*DNSResolver) LookupHost ¶
LookupHost is a mock
type LogMessage ¶
type LogMessage struct { Priority syslog.Priority // aka Log level Message string // content of log message }
LogMessage is a log entry that has been sent to a SyslogWriter.
func (*LogMessage) String ¶
func (lm *LogMessage) String() string
type Statter ¶
type Statter struct { statsd.NoopClient Counters map[string]int64 }
Statter is a stat counter that is a no-op except for locally handling Inc calls (which are most of what we use).
func NewStatter ¶
func NewStatter() Statter
NewStatter returns an empty statter with all counters zero
type StorageAuthority ¶
type StorageAuthority struct {
// contains filtered or unexported fields
}
StorageAuthority is a mock
func NewStorageAuthority ¶
func NewStorageAuthority(clk clock.Clock) *StorageAuthority
NewStorageAuthority creates a new mock storage authority with the given clock.
func (*StorageAuthority) AddCertificate ¶
func (sa *StorageAuthority) AddCertificate(certDER []byte, regID int64) (digest string, err error)
AddCertificate is a mock
func (*StorageAuthority) AddSCTReceipt ¶
func (sa *StorageAuthority) AddSCTReceipt(sct core.SignedCertificateTimestamp) (err error)
AddSCTReceipt is a mock
func (*StorageAuthority) AlreadyDeniedCSR ¶
func (sa *StorageAuthority) AlreadyDeniedCSR([]string) (bool, error)
AlreadyDeniedCSR is a mock
func (*StorageAuthority) CountCertificatesByNames ¶
func (sa *StorageAuthority) CountCertificatesByNames(_ []string, _, _ time.Time) (ret map[string]int, err error)
CountCertificatesByNames is a mock
func (*StorageAuthority) CountCertificatesRange ¶
func (sa *StorageAuthority) CountCertificatesRange(_, _ time.Time) (int64, error)
CountCertificatesRange is a mock
func (*StorageAuthority) CountPendingAuthorizations ¶
func (sa *StorageAuthority) CountPendingAuthorizations(_ int64) (int, error)
CountPendingAuthorizations is a mock
func (*StorageAuthority) CountRegistrationsByIP ¶
CountRegistrationsByIP is a mock
func (*StorageAuthority) FinalizeAuthorization ¶
func (sa *StorageAuthority) FinalizeAuthorization(authz core.Authorization) (err error)
FinalizeAuthorization is a mock
func (*StorageAuthority) GetAuthorization ¶
func (sa *StorageAuthority) GetAuthorization(id string) (core.Authorization, error)
GetAuthorization is a mock
func (*StorageAuthority) GetCertificate ¶
func (sa *StorageAuthority) GetCertificate(serial string) (core.Certificate, error)
GetCertificate is a mock
func (*StorageAuthority) GetCertificateStatus ¶
func (sa *StorageAuthority) GetCertificateStatus(serial string) (core.CertificateStatus, error)
GetCertificateStatus is a mock
func (*StorageAuthority) GetLatestValidAuthorization ¶
func (sa *StorageAuthority) GetLatestValidAuthorization(registrationID int64, identifier core.AcmeIdentifier) (authz core.Authorization, err error)
GetLatestValidAuthorization is a mock
func (*StorageAuthority) GetRegistration ¶
func (sa *StorageAuthority) GetRegistration(id int64) (core.Registration, error)
GetRegistration is a mock
func (*StorageAuthority) GetRegistrationByKey ¶
func (sa *StorageAuthority) GetRegistrationByKey(jwk jose.JsonWebKey) (core.Registration, error)
GetRegistrationByKey is a mock
func (*StorageAuthority) GetSCTReceipt ¶
func (sa *StorageAuthority) GetSCTReceipt(serial string, logID string) (sct core.SignedCertificateTimestamp, err error)
GetSCTReceipt is a mock
func (*StorageAuthority) MarkCertificateRevoked ¶
func (sa *StorageAuthority) MarkCertificateRevoked(serial string, reasonCode core.RevocationCode) (err error)
MarkCertificateRevoked is a mock
func (*StorageAuthority) NewPendingAuthorization ¶
func (sa *StorageAuthority) NewPendingAuthorization(authz core.Authorization) (output core.Authorization, err error)
NewPendingAuthorization is a mock
func (*StorageAuthority) NewRegistration ¶
func (sa *StorageAuthority) NewRegistration(reg core.Registration) (regR core.Registration, err error)
NewRegistration is a mock
func (*StorageAuthority) UpdateOCSP ¶
func (sa *StorageAuthority) UpdateOCSP(serial string, ocspResponse []byte) (err error)
UpdateOCSP is a mock
func (*StorageAuthority) UpdatePendingAuthorization ¶
func (sa *StorageAuthority) UpdatePendingAuthorization(authz core.Authorization) (err error)
UpdatePendingAuthorization is a mock
func (*StorageAuthority) UpdateRegistration ¶
func (sa *StorageAuthority) UpdateRegistration(reg core.Registration) (err error)
UpdateRegistration is a mock
type SyslogWriter ¶
type SyslogWriter struct {
// contains filtered or unexported fields
}
SyslogWriter implements the blog.SyslogWriter interface. It stores all logged messages in a buffer for inspection by test functions (via GetAll()) instead of sending them to syslog.
func NewSyslogWriter ¶
func NewSyslogWriter() *SyslogWriter
NewSyslogWriter returns a new SyslogWriter.
func UseMockLog ¶
func UseMockLog() *SyslogWriter
UseMockLog changes the SyslogWriter used by the current singleton audit logger to a new mock logger, and returns the mock. Example:
var log = mocks.UseMockLog() func TestFoo(t *testing.T) { log.Clear() // ... Assert(t, len(log.GetAll()) > 0, "Should have logged something") }
func (*SyslogWriter) Close ¶
func (msw *SyslogWriter) Close() error
Close releases resources. No other methods may be called after this.
func (*SyslogWriter) GetAll ¶
func (msw *SyslogWriter) GetAll() []*LogMessage
GetAll returns all LogMessages logged (since the last call to Clear(), if applicable).
The caller must not modify the returned slice or its elements.
func (*SyslogWriter) GetAllMatching ¶
func (msw *SyslogWriter) GetAllMatching(reString string) (matches []*LogMessage)
GetAllMatching returns all LogMessages logged (since the last Clear()) whose text matches the given regexp. The regexp is accepted as a string and compiled on the fly, because convenience is more important than performance.
The caller must not modify the elements of the returned slice.
func (*SyslogWriter) Notice ¶
func (msw *SyslogWriter) Notice(m string) error
Notice logs at LOG_NOTICE
func (*SyslogWriter) Warning ¶
func (msw *SyslogWriter) Warning(m string) error
Warning logs at LOG_WARNING