mirror of
https://github.com/micromdm/micromdm/
synced 2026-08-11 20:45:32 +08:00
23 lines
492 B
Go
23 lines
492 B
Go
package challenge
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/go-kit/kit/endpoint"
|
|
)
|
|
|
|
type challengeResponse struct {
|
|
Challenge string `json:"string"`
|
|
Err error `json:"err,omitempty"`
|
|
}
|
|
|
|
func (r challengeResponse) Failed() error { return r.Err }
|
|
|
|
func MakeChallengeEndpoint(svc Service) endpoint.Endpoint {
|
|
return func(ctx context.Context, request interface{}) (response interface{}, err error) {
|
|
r := challengeResponse{}
|
|
r.Challenge, r.Err = svc.SCEPChallenge(ctx)
|
|
return r, nil
|
|
}
|
|
}
|