sa

package
v0.0.0-...-821c0b8 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2016 License: MPL-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDbMap

func NewDbMap(dbConnect string) (*gorp.DbMap, error)

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.

func NewDbMapFromConfig

func NewDbMapFromConfig(config *mysql.Config) (*gorp.DbMap, error)

NewDbMapFromConfig functions similarly to NewDbMap, but it takes the decomposed form of the connection string, a *mysql.Config.

func SetSQLDebug

func SetSQLDebug(dbMap *gorp.DbMap, log blog.SyslogWriter)

SetSQLDebug enables 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.

func (*SQLLogger) Printf

func (log *SQLLogger) Printf(format string, v ...interface{})

Printf adapts the AuditLogger to GORP's interface

type SQLStorageAuthority

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

SQLStorageAuthority defines a Storage Authority

func NewSQLStorageAuthority

func NewSQLStorageAuthority(dbMap *gorp.DbMap, clk clock.Clock) (*SQLStorageAuthority, error)

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) CountFQDNSets

func (ssa *SQLStorageAuthority) CountFQDNSets(window time.Duration, names []string) (int64, error)

CountFQDNSets returns the number of sets with hash |setHash| within the window |window|

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) FQDNSetExists

func (ssa *SQLStorageAuthority) FQDNSetExists(names []string) (bool, error)

FQDNSetExists returns a bool indicating if one or more FQDN sets |names| exists in the database

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) GetAuthorizationsByRegID

func (ssa *SQLStorageAuthority) GetAuthorizationsByRegID(regID int64, expiresAfter time.Time, limit int64) ([]string, error)

GetAuthorizationsByRegID returns the authorization IDs matching the regID given. The number of IDs returned is dependent on the limit variable. If exiresAfter is before now it willl return the list as if now was given

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) GetValidAuthorizations

func (ssa *SQLStorageAuthority) GetValidAuthorizations(registrationID int64, names []string, now time.Time) (latest map[string]*core.Authorization, err error)

GetValidAuthorizations returns the latest authorization object for all domain names from the parameters that the account has authorizations for.

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) RevokeAuthorizationsByDomain

func (ssa *SQLStorageAuthority) RevokeAuthorizationsByDomain(ident core.AcmeIdentifier) (int64, int64, error)

RevokeAuthorizationsByDomain invalidates all pending or finalized authorizations for a specific domain

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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