Documentation ¶
Index ¶
- Variables
- func GetCert(ctx context.Context, IssuerName string, SerialNumber string, caType string) (lamassuca.Cert, error)
- func NewLamassuCaClientMock(logger log.Logger) (lamassuca.LamassuCaClient, error)
- type DmsDB
- type LamassuCaClientConfig
- func (c *LamassuCaClientConfig) GetCAs(ctx context.Context, caType string) (lamassuca.Certs, error)
- func (c *LamassuCaClientConfig) GetCert(ctx context.Context, IssuerName string, SerialNumber string, caType string) (lamassuca.Cert, error)
- func (c *LamassuCaClientConfig) RevokeCert(ctx context.Context, IssuerName string, serialNumberToRevoke string, ...) error
- func (c *LamassuCaClientConfig) SignCertificateRequest(ctx context.Context, signingCaName string, csr *x509.CertificateRequest, ...) (*x509.Certificate, error)
- type MockDB
- func (db *MockDB) DeleteDevice(ctx context.Context, id string) error
- func (db *MockDB) InsertDevice(ctx context.Context, alias string, deviceID string, dmsID string, ...) error
- func (db *MockDB) InsertDeviceCertHistory(ctx context.Context, l device.DeviceCertHistory) error
- func (db *MockDB) InsertLog(ctx context.Context, l device.DeviceLog) error
- func (db *MockDB) SelectAllDevices(ctx context.Context, queryParameters device.QueryParameters) ([]device.Device, int, error)
- func (db *MockDB) SelectAllDevicesByDmsId(ctx context.Context, dms_id string) ([]device.Device, error)
- func (db *MockDB) SelectByDMSIDAuthorizedCAs(ctx context.Context, dmsid string) ([]dms.AuthorizedCAs, error)
- func (db *MockDB) SelectBySerialNumber(ctx context.Context, SerialNumber string) (string, error)
- func (db *MockDB) SelectDeviceById(ctx context.Context, id string) (device.Device, error)
- func (db *MockDB) SelectDeviceCertHistory(ctx context.Context, deviceId string) ([]device.DeviceCertHistory, error)
- func (db *MockDB) SelectDeviceCertHistoryBySerialNumber(ctx context.Context, serialNumber string) (device.DeviceCertHistory, error)
- func (db *MockDB) SelectDeviceCertHistoryLastThirtyDays(ctx context.Context, queryParameters device.QueryParameters) ([]device.DeviceCertHistory, error)
- func (db *MockDB) SelectDeviceLogs(ctx context.Context, deviceId string) ([]device.DeviceLog, error)
- func (db *MockDB) SelectDmssLastIssuedCert(ctx context.Context, queryParameters device.QueryParameters) ([]device.DMSLastIssued, error)
- func (db *MockDB) UpdateByID(ctx context.Context, alias string, deviceID string, dmsID string, ...) error
- func (db *MockDB) UpdateDeviceCertHistory(ctx context.Context, deviceId string, serialNumber string, newStatus string) error
- func (db *MockDB) UpdateDeviceCertificateSerialNumberByID(ctx context.Context, id string, serialNumber string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Client errors ErrInvalidDeviceRequest = errors.New("unable to parse device, is invalid") //400 ErrInvalidDMSId = errors.New("unable to parse DMS ID, is invalid") //400 ErrInvalidDeviceId = errors.New("unable to parse Device ID, is invalid") //400 ErrIncorrectType = errors.New("unsupported media type") //415 ErrEmptyBody = errors.New("empty body") //Server errors ErrInvalidOperation = errors.New("invalid operation") ErrActiveCert = errors.New("can't isuee certificate. The device has a valid cert") ErrResponseEncode = errors.New("error encoding response") ErrInsertLog = errors.New("Could not insert log") ErrInsertDevice = errors.New("Could not insert device") ErrDeviceById = errors.New("Could not find device by Id") ErrSerialNumber = errors.New("No Serial Number") )
Functions ¶
func NewLamassuCaClientMock ¶
func NewLamassuCaClientMock(logger log.Logger) (lamassuca.LamassuCaClient, error)
Types ¶
type DmsDB ¶ added in v0.0.10
func (*DmsDB) SelectByDMSIDAuthorizedCAs ¶ added in v0.0.10
type LamassuCaClientConfig ¶
type LamassuCaClientConfig struct {
// contains filtered or unexported fields
}
func (*LamassuCaClientConfig) RevokeCert ¶
func (*LamassuCaClientConfig) SignCertificateRequest ¶
func (c *LamassuCaClientConfig) SignCertificateRequest(ctx context.Context, signingCaName string, csr *x509.CertificateRequest, caType string, signVerbatim bool) (*x509.Certificate, error)
type MockDB ¶
func (*MockDB) InsertDevice ¶
func (*MockDB) InsertDeviceCertHistory ¶
func (*MockDB) SelectAllDevices ¶
func (*MockDB) SelectAllDevicesByDmsId ¶
func (*MockDB) SelectByDMSIDAuthorizedCAs ¶ added in v0.0.10
func (*MockDB) SelectBySerialNumber ¶ added in v0.0.10
func (*MockDB) SelectDeviceById ¶
func (*MockDB) SelectDeviceCertHistory ¶
func (*MockDB) SelectDeviceCertHistoryBySerialNumber ¶
func (*MockDB) SelectDeviceCertHistoryLastThirtyDays ¶
func (db *MockDB) SelectDeviceCertHistoryLastThirtyDays(ctx context.Context, queryParameters device.QueryParameters) ([]device.DeviceCertHistory, error)
func (*MockDB) SelectDeviceLogs ¶
func (*MockDB) SelectDmssLastIssuedCert ¶
func (db *MockDB) SelectDmssLastIssuedCert(ctx context.Context, queryParameters device.QueryParameters) ([]device.DMSLastIssued, error)
func (*MockDB) UpdateByID ¶ added in v0.0.10
func (*MockDB) UpdateDeviceCertHistory ¶
func (*MockDB) UpdateDeviceCertificateSerialNumberByID ¶
func (db *MockDB) UpdateDeviceCertificateSerialNumberByID(ctx context.Context, id string, serialNumber string) error
func (db *MockDB) UpdateDeviceStatusByID(ctx context.Context, id string, newStatus string) error { if ctx.Value("DBUpdateStatus") != nil { failDBLog := ctx.Value("DBUpdateStatus").(bool) if failDBLog { return errors.New("Error Update Status") } } else { if id == "errorUpdateStatus" { return errors.New("error") } return nil } return nil }
Click to show internal directories.
Click to hide internal directories.