mocks

package
v0.0.0-...-5b94510 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: MPL-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mailer

type Mailer struct {
	sync.Mutex
	Messages []MailerMessage
}

Mailer is a mock

func (*Mailer) Clear

func (m *Mailer) Clear()

Clear removes any previously recorded messages

func (*Mailer) Connect

func (m *Mailer) Connect() (mail.Conn, error)

Connect is a mock

type MailerMessage

type MailerMessage struct {
	To      string
	Subject string
	Body    string
}

MailerMessage holds the captured emails from SendMail()

type MockCA

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

func (ca *MockCA) IssueCertificateForPrecertificate(ctx context.Context, req *capb.IssueCertificateForPrecertificateRequest, _ ...grpc.CallOption) (*corepb.Certificate, error)

IssueCertificateForPrecertificate is a mock

func (*MockCA) IssuePrecertificate

IssuePrecertificate is a mock

type MockCRLGenerator

type MockCRLGenerator struct{}

func (*MockCRLGenerator) GenerateCRL

GenerateCRL is a mock

type MockOCSPGenerator

type MockOCSPGenerator struct{}

func (*MockOCSPGenerator) GenerateOCSP

GenerateOCSP is a mock

type PublisherClient

type PublisherClient struct {
}

PublisherClient is a mock

func (*PublisherClient) SubmitToSingleCTWithResult

func (*PublisherClient) SubmitToSingleCTWithResult(_ context.Context, _ *pubpb.Request, _ ...grpc.CallOption) (*pubpb.Result, error)

SubmitToSingleCTWithResult is a mock

type ServerStreamClient

type ServerStreamClient[T any] struct {
	grpc.ClientStream
	Results []*T
	Err     error
}

ServerStreamClient is a mock which satisfies the grpc.ClientStream interface, allowing it to be returned by methods where the server returns a stream of results. It can be populated with a list of results to return, or an error to return.

func (*ServerStreamClient[T]) Recv

func (c *ServerStreamClient[T]) Recv() (*T, error)

Recv returns the error, if populated. Otherwise it returns the next item from the list of results. If it has returned all items already, it returns EOF.

type StorageAuthority

type StorageAuthority struct {
	StorageAuthorityReadOnly
}

StorageAuthority is a mock of sapb.StorageAuthorityClient

func NewStorageAuthority

func NewStorageAuthority(clk clock.Clock) *StorageAuthority

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

func (*StorageAuthority) AddBlockedKey

func (sa *StorageAuthority) AddBlockedKey(ctx context.Context, req *sapb.AddBlockedKeyRequest, _ ...grpc.CallOption) (*emptypb.Empty, error)

AddBlockedKey is a mock

func (*StorageAuthority) AddCertificate

AddCertificate is a mock

func (*StorageAuthority) AddPrecertificate

func (sa *StorageAuthority) AddPrecertificate(ctx context.Context, req *sapb.AddCertificateRequest, _ ...grpc.CallOption) (*emptypb.Empty, error)

AddPrecertificate is a mock

func (*StorageAuthority) AddSerial

AddSerial is a mock

func (*StorageAuthority) CheckIdentifiersPaused

func (sa *StorageAuthority) CheckIdentifiersPaused(_ context.Context, _ *sapb.PauseRequest, _ ...grpc.CallOption) (*sapb.Identifiers, error)

CheckIdentifiersPaused is a mock

func (*StorageAuthority) DeactivateAuthorization2

func (sa *StorageAuthority) DeactivateAuthorization2(ctx context.Context, req *sapb.AuthorizationID2, _ ...grpc.CallOption) (*emptypb.Empty, error)

func (*StorageAuthority) DeactivateRegistration

func (sa *StorageAuthority) DeactivateRegistration(_ context.Context, _ *sapb.RegistrationID, _ ...grpc.CallOption) (*emptypb.Empty, error)

DeactivateRegistration is a mock

func (*StorageAuthority) FinalizeAuthorization2

func (sa *StorageAuthority) FinalizeAuthorization2(ctx context.Context, req *sapb.FinalizeAuthorizationRequest, _ ...grpc.CallOption) (*emptypb.Empty, error)

func (*StorageAuthority) FinalizeOrder

FinalizeOrder is a mock

func (*StorageAuthority) GetPausedIdentifiers

func (sa *StorageAuthority) GetPausedIdentifiers(_ context.Context, _ *sapb.RegistrationID, _ ...grpc.CallOption) (*sapb.Identifiers, error)

GetPausedIdentifiers is a mock

func (*StorageAuthority) GetRevokedCerts

GetRevokedCerts is a mock

func (*StorageAuthority) GetSerialsByAccount

GetSerialsByAccount is a mock

func (*StorageAuthority) GetSerialsByKey

GetSerialsByKey is a mock

func (*StorageAuthority) LeaseCRLShard

LeaseCRLShard is a mock.

func (*StorageAuthority) NewOrderAndAuthzs

func (sa *StorageAuthority) NewOrderAndAuthzs(_ context.Context, req *sapb.NewOrderAndAuthzsRequest, _ ...grpc.CallOption) (*corepb.Order, error)

NewOrderAndAuthzs is a mock

func (*StorageAuthority) NewRegistration

NewRegistration is a mock

func (*StorageAuthority) RevokeCertificate

func (sa *StorageAuthority) RevokeCertificate(ctx context.Context, req *sapb.RevokeCertificateRequest, _ ...grpc.CallOption) (*emptypb.Empty, error)

RevokeCertificate is a mock

func (*StorageAuthority) SerialsForIncident

SerialsForIncident is a mock

func (*StorageAuthority) SetOrderError

SetOrderError is a mock

func (*StorageAuthority) SetOrderProcessing

func (sa *StorageAuthority) SetOrderProcessing(_ context.Context, req *sapb.OrderRequest, _ ...grpc.CallOption) (*emptypb.Empty, error)

SetOrderProcessing is a mock

func (*StorageAuthority) UpdateCRLShard

func (sa *StorageAuthority) UpdateCRLShard(ctx context.Context, req *sapb.UpdateCRLShardRequest, _ ...grpc.CallOption) (*emptypb.Empty, error)

UpdateCRLShard is a mock.

func (*StorageAuthority) UpdateRegistration

func (sa *StorageAuthority) UpdateRegistration(_ context.Context, _ *corepb.Registration, _ ...grpc.CallOption) (*emptypb.Empty, error)

UpdateRegistration is a mock

func (*StorageAuthority) UpdateRevokedCertificate

func (sa *StorageAuthority) UpdateRevokedCertificate(ctx context.Context, req *sapb.RevokeCertificateRequest, _ ...grpc.CallOption) (*emptypb.Empty, error)

UpdateRevokedCertificate is a mock

type StorageAuthorityReadOnly

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

StorageAuthorityReadOnly is a mock of sapb.StorageAuthorityReadOnlyClient

func NewStorageAuthorityReadOnly

func NewStorageAuthorityReadOnly(clk clock.Clock) *StorageAuthorityReadOnly

NewStorageAuthorityReadOnly creates a new mock read-only storage authority with the given clock.

func (*StorageAuthorityReadOnly) CheckIdentifiersPaused

func (sa *StorageAuthorityReadOnly) CheckIdentifiersPaused(_ context.Context, _ *sapb.PauseRequest, _ ...grpc.CallOption) (*sapb.Identifiers, error)

CheckIdentifiersPaused is a mock

func (*StorageAuthorityReadOnly) CountCertificatesByNames

CountCertificatesByNames is a mock

func (*StorageAuthorityReadOnly) CountInvalidAuthorizations2

func (sa *StorageAuthorityReadOnly) CountInvalidAuthorizations2(ctx context.Context, req *sapb.CountInvalidAuthorizationsRequest, _ ...grpc.CallOption) (*sapb.Count, error)

func (*StorageAuthorityReadOnly) CountOrders

CountOrders is a mock

func (*StorageAuthorityReadOnly) CountPendingAuthorizations2

func (sa *StorageAuthorityReadOnly) CountPendingAuthorizations2(ctx context.Context, req *sapb.RegistrationID, _ ...grpc.CallOption) (*sapb.Count, error)

func (*StorageAuthorityReadOnly) FQDNSetExists

FQDNSetExists is a mock

func (*StorageAuthorityReadOnly) FQDNSetTimestampsForWindow

func (sa *StorageAuthorityReadOnly) FQDNSetTimestampsForWindow(_ context.Context, _ *sapb.CountFQDNSetsRequest, _ ...grpc.CallOption) (*sapb.Timestamps, error)

FQDNSetTimestampsForWindow is a mock

func (*StorageAuthorityReadOnly) GetAuthorization2

GetAuthorization2 is a mock

func (*StorageAuthorityReadOnly) GetAuthorizations2

func (*StorageAuthorityReadOnly) GetCertificate

func (sa *StorageAuthorityReadOnly) GetCertificate(_ context.Context, req *sapb.Serial, _ ...grpc.CallOption) (*corepb.Certificate, error)

GetCertificate is a mock

func (*StorageAuthorityReadOnly) GetCertificateStatus

func (sa *StorageAuthorityReadOnly) GetCertificateStatus(_ context.Context, req *sapb.Serial, _ ...grpc.CallOption) (*corepb.CertificateStatus, error)

GetCertificateStatus is a mock

func (*StorageAuthorityReadOnly) GetLintPrecertificate

func (sa *StorageAuthorityReadOnly) GetLintPrecertificate(_ context.Context, req *sapb.Serial, _ ...grpc.CallOption) (*corepb.Certificate, error)

GetLintPrecertificate is a mock

func (*StorageAuthorityReadOnly) GetMaxExpiration

GetMaxExpiration is a mock

func (*StorageAuthorityReadOnly) GetOrder

GetOrder is a mock

func (*StorageAuthorityReadOnly) GetOrderForNames

func (*StorageAuthorityReadOnly) GetPausedIdentifiers

func (sa *StorageAuthorityReadOnly) GetPausedIdentifiers(_ context.Context, _ *sapb.RegistrationID, _ ...grpc.CallOption) (*sapb.Identifiers, error)

GetPausedIdentifiers is a mock

func (*StorageAuthorityReadOnly) GetRegistration

GetRegistration is a mock

func (*StorageAuthorityReadOnly) GetRegistrationByKey

func (sa *StorageAuthorityReadOnly) GetRegistrationByKey(_ context.Context, req *sapb.JSONWebKey, _ ...grpc.CallOption) (*corepb.Registration, error)

GetRegistrationByKey is a mock

func (*StorageAuthorityReadOnly) GetRevocationStatus

func (sa *StorageAuthorityReadOnly) GetRevocationStatus(_ context.Context, req *sapb.Serial, _ ...grpc.CallOption) (*sapb.RevocationStatus, error)

GetRevocationStatus is a mock

func (*StorageAuthorityReadOnly) GetRevokedCerts

GetRevokedCerts is a mock

func (*StorageAuthorityReadOnly) GetSerialMetadata

func (sa *StorageAuthorityReadOnly) GetSerialMetadata(ctx context.Context, req *sapb.Serial, _ ...grpc.CallOption) (*sapb.SerialMetadata, error)

GetSerialMetadata is a mock

func (*StorageAuthorityReadOnly) GetSerialsByAccount

GetSerialsByAccount is a mock

func (*StorageAuthorityReadOnly) GetSerialsByKey

GetSerialsByKey is a mock

func (*StorageAuthorityReadOnly) GetValidAuthorizations2

func (*StorageAuthorityReadOnly) GetValidOrderAuthorizations2

func (*StorageAuthorityReadOnly) IncidentsForSerial

func (sa *StorageAuthorityReadOnly) IncidentsForSerial(ctx context.Context, req *sapb.Serial, _ ...grpc.CallOption) (*sapb.Incidents, error)

IncidentsForSerial is a mock.

func (*StorageAuthorityReadOnly) KeyBlocked

func (sa *StorageAuthorityReadOnly) KeyBlocked(ctx context.Context, req *sapb.SPKIHash, _ ...grpc.CallOption) (*sapb.Exists, error)

KeyBlocked is a mock

func (*StorageAuthorityReadOnly) ReplacementOrderExists

func (sa *StorageAuthorityReadOnly) ReplacementOrderExists(ctx context.Context, req *sapb.Serial, _ ...grpc.CallOption) (*sapb.Exists, error)

ReplacementOrderExists is a mock.

func (*StorageAuthorityReadOnly) SerialsForIncident

SerialsForIncident is a mock

func (*StorageAuthorityReadOnly) SetCertificateStatusReady

func (sa *StorageAuthorityReadOnly) SetCertificateStatusReady(ctx context.Context, req *sapb.Serial, _ ...grpc.CallOption) (*emptypb.Empty, error)

Jump to

Keyboard shortcuts

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