Documentation ¶
Index ¶
- func NewDbMap(dbConnect string) (*gorp.DbMap, error)
- func SetSQLDebug(dbMap *gorp.DbMap, state bool)
- type BoulderTypeConverter
- type ErrDuplicateReceipt
- type ErrNoReceipt
- type SQLLogger
- type SQLStorageAuthority
- func (ssa *SQLStorageAuthority) AddCertificate(certDER []byte, regID int64) (digest string, err error)
- func (ssa *SQLStorageAuthority) AddSCTReceipt(sct core.SignedCertificateTimestamp) error
- func (ssa *SQLStorageAuthority) AlreadyDeniedCSR(names []string) (already bool, err error)
- func (ssa *SQLStorageAuthority) CountCertificatesByNames(domains []string, earliest, latest time.Time) (map[string]int, error)
- func (ssa *SQLStorageAuthority) CountCertificatesRange(start, end time.Time) (count int64, err error)
- func (ssa *SQLStorageAuthority) CountPendingAuthorizations(regID int64) (count int, err error)
- func (ssa *SQLStorageAuthority) CountRegistrationsByIP(ip net.IP, earliest time.Time, latest time.Time) (int, error)
- func (ssa *SQLStorageAuthority) FinalizeAuthorization(authz core.Authorization) (err error)
- func (ssa *SQLStorageAuthority) GetAuthorization(id string) (authz core.Authorization, err error)
- func (ssa *SQLStorageAuthority) GetCertificate(serial string) (core.Certificate, error)
- func (ssa *SQLStorageAuthority) GetCertificateStatus(serial string) (status core.CertificateStatus, err error)
- func (ssa *SQLStorageAuthority) GetLatestValidAuthorization(registrationID int64, identifier core.AcmeIdentifier) (authz core.Authorization, err error)
- func (ssa *SQLStorageAuthority) GetRegistration(id int64) (core.Registration, error)
- func (ssa *SQLStorageAuthority) GetRegistrationByKey(key jose.JsonWebKey) (core.Registration, error)
- func (ssa *SQLStorageAuthority) GetSCTReceipt(serial string, logID string) (receipt core.SignedCertificateTimestamp, err error)
- func (ssa *SQLStorageAuthority) MarkCertificateRevoked(serial string, reasonCode core.RevocationCode) (err error)
- func (ssa *SQLStorageAuthority) NewPendingAuthorization(authz core.Authorization) (output core.Authorization, err error)
- func (ssa *SQLStorageAuthority) NewRegistration(reg core.Registration) (core.Registration, error)
- func (ssa *SQLStorageAuthority) SetSQLDebug(state bool)
- func (ssa *SQLStorageAuthority) UpdateOCSP(serial string, ocspResponse []byte) (err error)
- func (ssa *SQLStorageAuthority) UpdatePendingAuthorization(authz core.Authorization) (err error)
- func (ssa *SQLStorageAuthority) UpdateRegistration(reg core.Registration) error
- type TooManyCertificatesError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDbMap ¶
NewDbMap creates the root gorp mapping object. Create one of these for each database schema you wish to map. Each DbMap contains a list of mapped tables. It automatically maps the tables for the primary parts of Boulder around the Storage Authority. This may require some further work when we use a disjoint schema, like that for `certificate-authority-data.go`.
func SetSQLDebug ¶
SetSQLDebug enables/disables GORP SQL-level Debugging
Types ¶
type BoulderTypeConverter ¶
type BoulderTypeConverter struct{}
BoulderTypeConverter is used by Gorp for storing objects in DB.
func (BoulderTypeConverter) FromDb ¶
func (tc BoulderTypeConverter) FromDb(target interface{}) (gorp.CustomScanner, bool)
FromDb converts a DB representation back into a Boulder object.
func (BoulderTypeConverter) ToDb ¶
func (tc BoulderTypeConverter) ToDb(val interface{}) (interface{}, error)
ToDb converts a Boulder object to one suitable for the DB representation.
type ErrDuplicateReceipt ¶
type ErrDuplicateReceipt string
ErrDuplicateReceipt is an error type for duplicate SCT receipts
func (ErrDuplicateReceipt) Error ¶
func (e ErrDuplicateReceipt) Error() string
type ErrNoReceipt ¶
type ErrNoReceipt string
ErrNoReceipt is an error type for non-existent SCT receipt
func (ErrNoReceipt) Error ¶
func (e ErrNoReceipt) Error() string
type SQLLogger ¶
type SQLLogger struct {
// contains filtered or unexported fields
}
SQLLogger adapts the AuditLogger to a format GORP can use.
type SQLStorageAuthority ¶
type SQLStorageAuthority struct {
// contains filtered or unexported fields
}
SQLStorageAuthority defines a Storage Authority
func NewSQLStorageAuthority ¶
NewSQLStorageAuthority provides persistence using a SQL backend for Boulder. It will modify the given gorp.DbMap by adding relevant tables.
func (*SQLStorageAuthority) AddCertificate ¶
func (ssa *SQLStorageAuthority) AddCertificate(certDER []byte, regID int64) (digest string, err error)
AddCertificate stores an issued certificate.
func (*SQLStorageAuthority) AddSCTReceipt ¶
func (ssa *SQLStorageAuthority) AddSCTReceipt(sct core.SignedCertificateTimestamp) error
AddSCTReceipt adds a new SCT receipt to the (append-only) sctReceipts table
func (*SQLStorageAuthority) AlreadyDeniedCSR ¶
func (ssa *SQLStorageAuthority) AlreadyDeniedCSR(names []string) (already bool, err error)
AlreadyDeniedCSR queries to find if the name list has already been denied.
func (*SQLStorageAuthority) CountCertificatesByNames ¶
func (ssa *SQLStorageAuthority) CountCertificatesByNames(domains []string, earliest, latest time.Time) (map[string]int, error)
CountCertificatesByNames counts, for each input domain, the number of certificates issued in the given time range for that domain and its subdomains. It returns a map from domains to counts, which is guaranteed to contain an entry for each input domain, so long as err is nil. The highest count this function can return is 10,000. If there are more certificates than that matching one of the provided domain names, it will return TooManyCertificatesError.
func (*SQLStorageAuthority) CountCertificatesRange ¶
func (ssa *SQLStorageAuthority) CountCertificatesRange(start, end time.Time) (count int64, err error)
CountCertificatesRange returns the number of certificates issued in a specific date range
func (*SQLStorageAuthority) CountPendingAuthorizations ¶
func (ssa *SQLStorageAuthority) CountPendingAuthorizations(regID int64) (count int, err error)
CountPendingAuthorizations returns the number of pending, unexpired authorizations for the give registration.
func (*SQLStorageAuthority) CountRegistrationsByIP ¶
func (ssa *SQLStorageAuthority) CountRegistrationsByIP(ip net.IP, earliest time.Time, latest time.Time) (int, error)
CountRegistrationsByIP returns the number of registrations created in the time range in an IP range. For IPv4 addresses, that range is limited to the single IP. For IPv6 addresses, that range is a /48, since it's not uncommon for one person to have a /48 to themselves.
func (*SQLStorageAuthority) FinalizeAuthorization ¶
func (ssa *SQLStorageAuthority) FinalizeAuthorization(authz core.Authorization) (err error)
FinalizeAuthorization converts a Pending Authorization to a final one
func (*SQLStorageAuthority) GetAuthorization ¶
func (ssa *SQLStorageAuthority) GetAuthorization(id string) (authz core.Authorization, err error)
GetAuthorization obtains an Authorization by ID
func (*SQLStorageAuthority) GetCertificate ¶
func (ssa *SQLStorageAuthority) GetCertificate(serial string) (core.Certificate, error)
GetCertificate takes a serial number and returns the corresponding certificate, or error if it does not exist.
func (*SQLStorageAuthority) GetCertificateStatus ¶
func (ssa *SQLStorageAuthority) GetCertificateStatus(serial string) (status core.CertificateStatus, err error)
GetCertificateStatus takes a hexadecimal string representing the full 128-bit serial number of a certificate and returns data about that certificate's current validity.
func (*SQLStorageAuthority) GetLatestValidAuthorization ¶
func (ssa *SQLStorageAuthority) GetLatestValidAuthorization(registrationID int64, identifier core.AcmeIdentifier) (authz core.Authorization, err error)
GetLatestValidAuthorization gets the valid authorization with biggest expire date for a given domain and registrationId
func (*SQLStorageAuthority) GetRegistration ¶
func (ssa *SQLStorageAuthority) GetRegistration(id int64) (core.Registration, error)
GetRegistration obtains a Registration by ID
func (*SQLStorageAuthority) GetRegistrationByKey ¶
func (ssa *SQLStorageAuthority) GetRegistrationByKey(key jose.JsonWebKey) (core.Registration, error)
GetRegistrationByKey obtains a Registration by JWK
func (*SQLStorageAuthority) GetSCTReceipt ¶
func (ssa *SQLStorageAuthority) GetSCTReceipt(serial string, logID string) (receipt core.SignedCertificateTimestamp, err error)
GetSCTReceipt gets a specific SCT receipt for a given certificate serial and CT log ID
func (*SQLStorageAuthority) MarkCertificateRevoked ¶
func (ssa *SQLStorageAuthority) MarkCertificateRevoked(serial string, reasonCode core.RevocationCode) (err error)
MarkCertificateRevoked stores the fact that a certificate is revoked, along with a timestamp and a reason.
func (*SQLStorageAuthority) NewPendingAuthorization ¶
func (ssa *SQLStorageAuthority) NewPendingAuthorization(authz core.Authorization) (output core.Authorization, err error)
NewPendingAuthorization stores a new Pending Authorization
func (*SQLStorageAuthority) NewRegistration ¶
func (ssa *SQLStorageAuthority) NewRegistration(reg core.Registration) (core.Registration, error)
NewRegistration stores a new Registration
func (*SQLStorageAuthority) SetSQLDebug ¶
func (ssa *SQLStorageAuthority) SetSQLDebug(state bool)
SetSQLDebug enables/disables GORP SQL-level Debugging
func (*SQLStorageAuthority) UpdateOCSP ¶
func (ssa *SQLStorageAuthority) UpdateOCSP(serial string, ocspResponse []byte) (err error)
UpdateOCSP stores an updated OCSP response.
func (*SQLStorageAuthority) UpdatePendingAuthorization ¶
func (ssa *SQLStorageAuthority) UpdatePendingAuthorization(authz core.Authorization) (err error)
UpdatePendingAuthorization updates a Pending Authorization
func (*SQLStorageAuthority) UpdateRegistration ¶
func (ssa *SQLStorageAuthority) UpdateRegistration(reg core.Registration) error
UpdateRegistration stores an updated Registration
type TooManyCertificatesError ¶
type TooManyCertificatesError string
TooManyCertificatesError indicates that the number of certificates returned by CountCertificates exceeded the hard-coded limit of 10,000 certificates.
func (TooManyCertificatesError) Error ¶
func (t TooManyCertificatesError) Error() string