Documentation ¶
Overview ¶
Package fakekms supports integration testing of kms-plugin by faking CloudKMS.
Index ¶
- type Server
- func (f *Server) Client() *http.Client
- func (f *Server) Close()
- func (f *Server) DecryptRequestsEqual(r []*cloudkms.DecryptRequest) error
- func (f *Server) EncryptRequestsEqual(r []*cloudkms.EncryptRequest) error
- func (f *Server) TestIAMRequestsEqual(r []*cloudkms.TestIamPermissionsRequest) error
- func (f *Server) URL() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server fakes CloudKMS.
func NewWithPipethrough ¶
NewWithPipethrough creates and returns *Server that simply passed through the requests, by replacing ciphertext to cleartext and vice versa. Callers are also responsible for calling Close after completing tests. keyName simulates CloudKMS' keyName and is taken into account when calculating expected URL endpoints.
func NewWithResponses ¶
func NewWithResponses(keyName string, port int, delay time.Duration, responses ...json.Marshaler) (*Server, error)
NewWithResponses creates and returns *Server. It is the responsibility of the caller to supply the expected number of Responses. When the provided Responses are exhausted an error will be returned. Callers are also responsible for calling Close after completing tests. keyName simulates CloudKMS' keyName and is taken into account when calculating expected URL endpoints. delay allows the caller to simulate delayed responses from KMS.
func (*Server) DecryptRequestsEqual ¶
DecryptRequestsEqual validates that the supplied DecryptRequests are equal to the all DecryptRequests processed by the server.
func (*Server) EncryptRequestsEqual ¶
EncryptRequestsEqual validates that the supplied EncryptRequests are equal to all EncryptRequests processed by the server.
func (*Server) TestIAMRequestsEqual ¶
TestIAMRequestsEqual validates that the supplied TestIamPermissionsRequests are equal to the all TestIamPermissionsRequests processed by the server.