mirror of
https://github.com/micromdm/micromdm/
synced 2026-08-10 19:46:07 +08:00
- Upgrade to micromdm/scep v2 & updated API usage - Use interfaces rather than concrete types in a few places - Switch to Mozilla's PKCS7 fork (actually @omorsi's fork of that fork) - Import order: stdlib, project/self, 3rd party
30 lines
543 B
Go
30 lines
543 B
Go
package challenge
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
|
|
"github.com/micromdm/scep/v2/challenge"
|
|
)
|
|
|
|
type Service interface {
|
|
SCEPChallenge(ctx context.Context) (string, error)
|
|
}
|
|
|
|
type ChallengeService struct {
|
|
challenge.Store
|
|
}
|
|
|
|
func (c *ChallengeService) SCEPChallenge(_ context.Context) (string, error) {
|
|
if c.Store == nil {
|
|
return "", errors.New("SCEP challenge store missing")
|
|
}
|
|
return c.Store.SCEPChallenge()
|
|
}
|
|
|
|
func NewService(challengeStore challenge.Store) *ChallengeService {
|
|
return &ChallengeService{
|
|
Store: challengeStore,
|
|
}
|
|
}
|