mirror of
https://github.com/absmach/supermq.git
synced 2026-06-23 07:30:25 +00:00
a0c40ba462
* chore(license): update copyright notices Add CI check for non go files to check that the files contain a license Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> * fix(ci): log failed files When the CI fails during check for license header, log the failed file to console so that someone can check on the actual file. Also simplify the grep check to make it more human readable and understandable Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> --------- Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
36 lines
709 B
Go
36 lines
709 B
Go
// Copyright (c) Abstract Machines
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package mocks
|
|
|
|
import (
|
|
context "context"
|
|
|
|
auth "github.com/absmach/magistrala/auth"
|
|
"github.com/stretchr/testify/mock"
|
|
)
|
|
|
|
var _ auth.KeyRepository = (*Keys)(nil)
|
|
|
|
type Keys struct {
|
|
mock.Mock
|
|
}
|
|
|
|
func (m *Keys) Save(ctx context.Context, key auth.Key) (string, error) {
|
|
ret := m.Called(ctx, key)
|
|
|
|
return ret.String(0), ret.Error(1)
|
|
}
|
|
|
|
func (m *Keys) Retrieve(ctx context.Context, issuer, id string) (auth.Key, error) {
|
|
ret := m.Called(ctx, issuer, id)
|
|
|
|
return ret.Get(0).(auth.Key), ret.Error(1)
|
|
}
|
|
|
|
func (m *Keys) Remove(ctx context.Context, issuer, id string) error {
|
|
ret := m.Called(ctx, issuer, id)
|
|
|
|
return ret.Error(0)
|
|
}
|