lab7: безопасность, mTLS, OpenBao и PKI lifecycle

This commit is contained in:
Vladislav Kunetskiy
2026-11-10 10:58:07 +03:00
parent 3d216fbd50
commit 3441f2269a
183 changed files with 216667 additions and 3165 deletions
@@ -308,3 +308,81 @@ func (_c *MockRepository_Revoke_Call) RunAndReturn(run func(ctx context.Context,
_c.Call.Return(run)
return _c
}
// UpdatePasswordHash provides a mock function for the type MockRepository
func (_mock *MockRepository) UpdatePasswordHash(ctx context.Context, userID uuid.UUID, oldHash string, newHash string) (bool, error) {
ret := _mock.Called(ctx, userID, oldHash, newHash)
if len(ret) == 0 {
panic("no return value specified for UpdatePasswordHash")
}
var r0 bool
var r1 error
if returnFunc, ok := ret.Get(0).(func(context.Context, uuid.UUID, string, string) (bool, error)); ok {
return returnFunc(ctx, userID, oldHash, newHash)
}
if returnFunc, ok := ret.Get(0).(func(context.Context, uuid.UUID, string, string) bool); ok {
r0 = returnFunc(ctx, userID, oldHash, newHash)
} else {
r0 = ret.Get(0).(bool)
}
if returnFunc, ok := ret.Get(1).(func(context.Context, uuid.UUID, string, string) error); ok {
r1 = returnFunc(ctx, userID, oldHash, newHash)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// MockRepository_UpdatePasswordHash_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdatePasswordHash'
type MockRepository_UpdatePasswordHash_Call struct {
*mock.Call
}
// UpdatePasswordHash is a helper method to define mock.On call
// - ctx context.Context
// - userID uuid.UUID
// - oldHash string
// - newHash string
func (_e *MockRepository_Expecter) UpdatePasswordHash(ctx any, userID any, oldHash any, newHash any) *MockRepository_UpdatePasswordHash_Call {
return &MockRepository_UpdatePasswordHash_Call{Call: _e.mock.On("UpdatePasswordHash", ctx, userID, oldHash, newHash)}
}
func (_c *MockRepository_UpdatePasswordHash_Call) Run(run func(ctx context.Context, userID uuid.UUID, oldHash string, newHash string)) *MockRepository_UpdatePasswordHash_Call {
_c.Call.Run(func(args mock.Arguments) {
var arg0 context.Context
if args[0] != nil {
arg0 = args[0].(context.Context)
}
var arg1 uuid.UUID
if args[1] != nil {
arg1 = args[1].(uuid.UUID)
}
var arg2 string
if args[2] != nil {
arg2 = args[2].(string)
}
var arg3 string
if args[3] != nil {
arg3 = args[3].(string)
}
run(
arg0,
arg1,
arg2,
arg3,
)
})
return _c
}
func (_c *MockRepository_UpdatePasswordHash_Call) Return(b bool, err error) *MockRepository_UpdatePasswordHash_Call {
_c.Call.Return(b, err)
return _c
}
func (_c *MockRepository_UpdatePasswordHash_Call) RunAndReturn(run func(ctx context.Context, userID uuid.UUID, oldHash string, newHash string) (bool, error)) *MockRepository_UpdatePasswordHash_Call {
_c.Call.Return(run)
return _c
}