fleet/server/mock/scep/config.go
Sarah Gillespie 128a71eb4f
Add backend support for Smallstep CA (#32872)
Co-authored-by: Jordan Montgomery <elijah.jordan.montgomery@gmail.com>
Co-authored-by: Magnus Jensen <magnus@fleetdm.com>
2025-09-25 10:03:36 -05:00

76 lines
2.4 KiB
Go

// Automatically generated by mockimpl. DO NOT EDIT!
package mock
import (
"context"
"sync"
"github.com/fleetdm/fleet/v4/server/fleet"
)
var _ fleet.SCEPConfigService = (*SCEPConfigService)(nil)
type ValidateNDESSCEPAdminURLFunc func(ctx context.Context, proxy fleet.NDESSCEPProxyCA) error
type GetNDESSCEPChallengeFunc func(ctx context.Context, proxy fleet.NDESSCEPProxyCA) (string, error)
type ValidateSCEPURLFunc func(ctx context.Context, url string) error
type ValidateSmallstepChallengeURLFunc func(ctx context.Context, ca fleet.SmallstepSCEPProxyCA) error
type GetSmallstepSCEPChallengeFunc func(ctx context.Context, ca fleet.SmallstepSCEPProxyCA) (string, error)
type SCEPConfigService struct {
ValidateNDESSCEPAdminURLFunc ValidateNDESSCEPAdminURLFunc
ValidateNDESSCEPAdminURLFuncInvoked bool
GetNDESSCEPChallengeFunc GetNDESSCEPChallengeFunc
GetNDESSCEPChallengeFuncInvoked bool
ValidateSCEPURLFunc ValidateSCEPURLFunc
ValidateSCEPURLFuncInvoked bool
ValidateSmallstepChallengeURLFunc ValidateSmallstepChallengeURLFunc
ValidateSmallstepChallengeURLFuncInvoked bool
GetSmallstepSCEPChallengeFunc GetSmallstepSCEPChallengeFunc
GetSmallstepSCEPChallengeFuncInvoked bool
mu sync.Mutex
}
func (s *SCEPConfigService) ValidateNDESSCEPAdminURL(ctx context.Context, proxy fleet.NDESSCEPProxyCA) error {
s.mu.Lock()
s.ValidateNDESSCEPAdminURLFuncInvoked = true
s.mu.Unlock()
return s.ValidateNDESSCEPAdminURLFunc(ctx, proxy)
}
func (s *SCEPConfigService) GetNDESSCEPChallenge(ctx context.Context, proxy fleet.NDESSCEPProxyCA) (string, error) {
s.mu.Lock()
s.GetNDESSCEPChallengeFuncInvoked = true
s.mu.Unlock()
return s.GetNDESSCEPChallengeFunc(ctx, proxy)
}
func (s *SCEPConfigService) ValidateSCEPURL(ctx context.Context, url string) error {
s.mu.Lock()
s.ValidateSCEPURLFuncInvoked = true
s.mu.Unlock()
return s.ValidateSCEPURLFunc(ctx, url)
}
func (s *SCEPConfigService) ValidateSmallstepChallengeURL(ctx context.Context, ca fleet.SmallstepSCEPProxyCA) error {
s.mu.Lock()
s.ValidateSmallstepChallengeURLFuncInvoked = true
s.mu.Unlock()
return s.ValidateSmallstepChallengeURLFunc(ctx, ca)
}
func (s *SCEPConfigService) GetSmallstepSCEPChallenge(ctx context.Context, ca fleet.SmallstepSCEPProxyCA) (string, error) {
s.mu.Lock()
s.GetSmallstepSCEPChallengeFuncInvoked = true
s.mu.Unlock()
return s.GetSmallstepSCEPChallengeFunc(ctx, ca)
}