mirror of
https://github.com/micromdm/micromdm/
synced 2026-08-09 19:15:58 +08:00
Don't forget the endpoint definition for certificates!
This commit is contained in:
27
management/endpoint_certificates.go
Normal file
27
management/endpoint_certificates.go
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
package management
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/go-kit/kit/endpoint"
|
||||||
|
"github.com/micromdm/micromdm/certificates"
|
||||||
|
"golang.org/x/net/context"
|
||||||
|
)
|
||||||
|
|
||||||
|
type certificatesRequest struct {
|
||||||
|
UUID string
|
||||||
|
}
|
||||||
|
|
||||||
|
type certificatesResponse struct {
|
||||||
|
certificates []certificates.Certificate
|
||||||
|
Err error `json:"error,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func makeCertificatesEndpoint(svc Service) endpoint.Endpoint {
|
||||||
|
return func(ctx context.Context, request interface{}) (interface{}, error) {
|
||||||
|
req := request.(certificatesRequest)
|
||||||
|
certs, err := svc.Certificates(req.UUID)
|
||||||
|
if err != nil {
|
||||||
|
return certificatesResponse{Err: err}, nil
|
||||||
|
}
|
||||||
|
return certificatesResponse{certificates: certs}, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user