boulder: github.com/letsencrypt/boulder/mocks Index | Files

package mocks

import "github.com/letsencrypt/boulder/mocks"

Index

Package Files

ca.go mocks.go

type Mailer Uses

type Mailer struct {
    Messages []MailerMessage
}

Mailer is a mock

func (*Mailer) Clear Uses

func (m *Mailer) Clear()

Clear removes any previously recorded messages

func (*Mailer) Close Uses

func (m *Mailer) Close() error

Close is a mock

func (*Mailer) Connect Uses

func (m *Mailer) Connect() error

Connect is a mock

func (*Mailer) SendMail Uses

func (m *Mailer) SendMail(to []string, subject, msg string) error

SendMail is a mock

type MailerMessage Uses

type MailerMessage struct {
    To      string
    Subject string
    Body    string
}

MailerMessage holds the captured emails from SendMail()

type MockCA Uses

type MockCA struct {
    PEM []byte
}

MockCA is a mock of a CA that always returns the cert from PEM in response to IssueCertificate.

func (*MockCA) GenerateOCSP Uses

func (ca *MockCA) GenerateOCSP(ctx context.Context, xferObj core.OCSPSigningRequest) (ocsp []byte, err error)

GenerateOCSP is a mock

func (*MockCA) IssueCertificate Uses

func (ca *MockCA) IssueCertificate(ctx context.Context, _ *caPB.IssueCertificateRequest) (core.Certificate, error)

IssueCertificate is a mock

func (*MockCA) IssueCertificateForPrecertificate Uses

func (ca *MockCA) IssueCertificateForPrecertificate(ctx context.Context, req *caPB.IssueCertificateForPrecertificateRequest) (core.Certificate, error)

IssueCertificateForPrecertificate is a mock

func (*MockCA) IssuePrecertificate Uses

func (ca *MockCA) IssuePrecertificate(ctx context.Context, _ *caPB.IssueCertificateRequest) (*caPB.IssuePrecertificateResponse, error)

IssuePrecertificate is a mock

func (*MockCA) RevokeCertificate Uses

func (ca *MockCA) RevokeCertificate(ctx context.Context, serial string, reasonCode revocation.Reason) (err error)

RevokeCertificate is a mock

type Publisher Uses

type Publisher struct {
}

Publisher is a mock

func (*Publisher) SubmitToSingleCTWithResult Uses

func (*Publisher) SubmitToSingleCTWithResult(_ context.Context, _ *pubpb.Request) (*pubpb.Result, error)

SubmitToSingleCTWithResult is a mock

type SAWithFailedChallenges Uses

type SAWithFailedChallenges struct {
    StorageAuthority
    Clk clock.FakeClock
}

mockSAWithFailedChallenges is a mocks.StorageAuthority that has a `GetAuthorization` implementation that can return authorizations with failed challenges.

func (*SAWithFailedChallenges) GetAuthorization2 Uses

func (sa *SAWithFailedChallenges) GetAuthorization2(ctx context.Context, id *sapb.AuthorizationID2) (*corepb.Authorization, error)

type StorageAuthority Uses

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

StorageAuthority is a mock

func NewStorageAuthority Uses

func NewStorageAuthority(clk clock.Clock) *StorageAuthority

NewStorageAuthority creates a new mock storage authority with the given clock.

func (*StorageAuthority) AddCertificate Uses

func (sa *StorageAuthority) AddCertificate(_ context.Context, certDER []byte, regID int64, _ []byte, _ *time.Time) (digest string, err error)

AddCertificate is a mock

func (*StorageAuthority) AddPendingAuthorizations Uses

func (sa *StorageAuthority) AddPendingAuthorizations(ctx context.Context, req *sapb.AddPendingAuthorizationsRequest) (*sapb.AuthorizationIDs, error)

AddPendingAuthorizations is a mock

func (*StorageAuthority) AddPrecertificate Uses

func (sa *StorageAuthority) AddPrecertificate(ctx context.Context, req *sapb.AddCertificateRequest) (empty *corepb.Empty, err error)

AddPrecertificate is a mock

func (*StorageAuthority) AddSerial Uses

func (sa *StorageAuthority) AddSerial(ctx context.Context, req *sapb.AddSerialRequest) (empty *corepb.Empty, err error)

AddSerial is a mock

func (*StorageAuthority) CountCertificatesByNames Uses

func (sa *StorageAuthority) CountCertificatesByNames(_ context.Context, _ []string, _, _ time.Time) (ret []*sapb.CountByNames_MapElement, err error)

CountCertificatesByNames is a mock

func (*StorageAuthority) CountFQDNSets Uses

func (sa *StorageAuthority) CountFQDNSets(_ context.Context, since time.Duration, names []string) (int64, error)

CountFQDNSets is a mock

func (*StorageAuthority) CountInvalidAuthorizations Uses

func (sa *StorageAuthority) CountInvalidAuthorizations(ctx context.Context, req *sapb.CountInvalidAuthorizationsRequest) (count *sapb.Count, err error)

CountInvalidAuthorizations is a mock

func (*StorageAuthority) CountInvalidAuthorizations2 Uses

func (sa *StorageAuthority) CountInvalidAuthorizations2(ctx context.Context, req *sapb.CountInvalidAuthorizationsRequest) (*sapb.Count, error)

func (*StorageAuthority) CountOrders Uses

func (sa *StorageAuthority) CountOrders(_ context.Context, _ int64, _, _ time.Time) (int, error)

CountOrders is a mock

func (*StorageAuthority) CountPendingAuthorizations Uses

func (sa *StorageAuthority) CountPendingAuthorizations(_ context.Context, _ int64) (int, error)

CountPendingAuthorizations is a mock

func (*StorageAuthority) CountPendingAuthorizations2 Uses

func (sa *StorageAuthority) CountPendingAuthorizations2(ctx context.Context, req *sapb.RegistrationID) (*sapb.Count, error)

func (*StorageAuthority) CountRegistrationsByIP Uses

func (sa *StorageAuthority) CountRegistrationsByIP(_ context.Context, _ net.IP, _, _ time.Time) (int, error)

CountRegistrationsByIP is a mock

func (*StorageAuthority) CountRegistrationsByIPRange Uses

func (sa *StorageAuthority) CountRegistrationsByIPRange(_ context.Context, _ net.IP, _, _ time.Time) (int, error)

CountRegistrationsByIPRange is a mock

func (*StorageAuthority) DeactivateAuthorization Uses

func (sa *StorageAuthority) DeactivateAuthorization(_ context.Context, _ string) error

DeactivateAuthorization is a mock

func (*StorageAuthority) DeactivateAuthorization2 Uses

func (sa *StorageAuthority) DeactivateAuthorization2(ctx context.Context, req *sapb.AuthorizationID2) (*corepb.Empty, error)

func (*StorageAuthority) DeactivateRegistration Uses

func (sa *StorageAuthority) DeactivateRegistration(_ context.Context, _ int64) error

DeactivateRegistration is a mock

func (*StorageAuthority) FQDNSetExists Uses

func (sa *StorageAuthority) FQDNSetExists(_ context.Context, names []string) (bool, error)

FQDNSetExists is a mock

func (*StorageAuthority) FinalizeAuthorization Uses

func (sa *StorageAuthority) FinalizeAuthorization(_ context.Context, authz core.Authorization) (err error)

FinalizeAuthorization is a mock

func (*StorageAuthority) FinalizeAuthorization2 Uses

func (sa *StorageAuthority) FinalizeAuthorization2(ctx context.Context, req *sapb.FinalizeAuthorizationRequest) error

func (*StorageAuthority) FinalizeOrder Uses

func (sa *StorageAuthority) FinalizeOrder(_ context.Context, order *corepb.Order) error

FinalizeOrder is a mock

func (*StorageAuthority) GetAuthorization Uses

func (sa *StorageAuthority) GetAuthorization(_ context.Context, id string) (core.Authorization, error)

GetAuthorization is a mock

func (*StorageAuthority) GetAuthorization2 Uses

func (sa *StorageAuthority) GetAuthorization2(ctx context.Context, id *sapb.AuthorizationID2) (*corepb.Authorization, error)

GetAuthorization2 is a mock

func (*StorageAuthority) GetAuthorizations Uses

func (sa *StorageAuthority) GetAuthorizations(ctx context.Context, req *sapb.GetAuthorizationsRequest) (*sapb.Authorizations, error)

GetAuthorizations is a mock

func (*StorageAuthority) GetAuthorizations2 Uses

func (sa *StorageAuthority) GetAuthorizations2(ctx context.Context, req *sapb.GetAuthorizationsRequest) (*sapb.Authorizations, error)

func (*StorageAuthority) GetCertificate Uses

func (sa *StorageAuthority) GetCertificate(_ context.Context, serial string) (core.Certificate, error)

GetCertificate is a mock

func (*StorageAuthority) GetCertificateStatus Uses

func (sa *StorageAuthority) GetCertificateStatus(_ context.Context, serial string) (core.CertificateStatus, error)

GetCertificateStatus is a mock

func (*StorageAuthority) GetOrder Uses

func (sa *StorageAuthority) GetOrder(_ context.Context, req *sapb.OrderRequest) (*corepb.Order, error)

GetOrder is a mock

func (*StorageAuthority) GetOrderForNames Uses

func (sa *StorageAuthority) GetOrderForNames(_ context.Context, _ *sapb.GetOrderForNamesRequest) (*corepb.Order, error)

func (*StorageAuthority) GetPendingAuthorization Uses

func (sa *StorageAuthority) GetPendingAuthorization(ctx context.Context, req *sapb.GetPendingAuthorizationRequest) (*core.Authorization, error)

func (*StorageAuthority) GetPendingAuthorization2 Uses

func (sa *StorageAuthority) GetPendingAuthorization2(ctx context.Context, req *sapb.GetPendingAuthorizationRequest) (*corepb.Authorization, error)

func (*StorageAuthority) GetPrecertificate Uses

func (sa *StorageAuthority) GetPrecertificate(_ context.Context, _ *sapb.Serial) (*corepb.Certificate, error)

GetPrecertificate is a mock

func (*StorageAuthority) GetRegistration Uses

func (sa *StorageAuthority) GetRegistration(_ context.Context, id int64) (core.Registration, error)

GetRegistration is a mock

func (*StorageAuthority) GetRegistrationByKey Uses

func (sa *StorageAuthority) GetRegistrationByKey(_ context.Context, jwk *jose.JSONWebKey) (core.Registration, error)

GetRegistrationByKey is a mock

func (*StorageAuthority) GetValidAuthorizations Uses

func (sa *StorageAuthority) GetValidAuthorizations(_ context.Context, regID int64, names []string, now time.Time) (map[string]*core.Authorization, error)

GetValidAuthorizations is a mock

func (*StorageAuthority) GetValidAuthorizations2 Uses

func (sa *StorageAuthority) GetValidAuthorizations2(ctx context.Context, req *sapb.GetValidAuthorizationsRequest) (*sapb.Authorizations, error)

func (*StorageAuthority) GetValidOrderAuthorizations Uses

func (sa *StorageAuthority) GetValidOrderAuthorizations(_ context.Context, _ *sapb.GetValidOrderAuthorizationsRequest) (map[string]*core.Authorization, error)

func (*StorageAuthority) GetValidOrderAuthorizations2 Uses

func (sa *StorageAuthority) GetValidOrderAuthorizations2(ctx context.Context, req *sapb.GetValidOrderAuthorizationsRequest) (*sapb.Authorizations, error)

func (*StorageAuthority) NewAuthorizations2 Uses

func (sa *StorageAuthority) NewAuthorizations2(ctx context.Context, req *sapb.AddPendingAuthorizationsRequest) (*sapb.Authorization2IDs, error)

NewAuthorizations is a mock

func (*StorageAuthority) NewOrder Uses

func (sa *StorageAuthority) NewOrder(_ context.Context, order *corepb.Order) (*corepb.Order, error)

NewOrder is a mock

func (*StorageAuthority) NewPendingAuthorization Uses

func (sa *StorageAuthority) NewPendingAuthorization(_ context.Context, authz core.Authorization) (core.Authorization, error)

NewPendingAuthorization is a mock

func (*StorageAuthority) NewRegistration Uses

func (sa *StorageAuthority) NewRegistration(_ context.Context, reg core.Registration) (regR core.Registration, err error)

NewRegistration is a mock

func (*StorageAuthority) PreviousCertificateExists Uses

func (sa *StorageAuthority) PreviousCertificateExists(
    _ context.Context,
    _ *sapb.PreviousCertificateExistsRequest,
) (*sapb.Exists, error)

func (*StorageAuthority) RevokeCertificate Uses

func (sa *StorageAuthority) RevokeCertificate(ctx context.Context, req *sapb.RevokeCertificateRequest) error

RevokeCertificate is a mock

func (*StorageAuthority) SetOrderError Uses

func (sa *StorageAuthority) SetOrderError(_ context.Context, order *corepb.Order) error

SetOrderError is a mock

func (*StorageAuthority) SetOrderProcessing Uses

func (sa *StorageAuthority) SetOrderProcessing(_ context.Context, order *corepb.Order) error

SetOrderProcessing is a mock

func (*StorageAuthority) UpdateRegistration Uses

func (sa *StorageAuthority) UpdateRegistration(_ context.Context, reg core.Registration) (err error)

UpdateRegistration is a mock

Package mocks imports 21 packages (graph). Updated 2019-11-11. Refresh now. Tools for package owners.