fleet/server/service/transport_appconfig.go
Zach Wasserman fb32f0cf40
Remove kolide types and packages from backend (#974)
Generally renamed `kolide` -> `fleet`
2021-06-06 15:07:29 -07:00

27 lines
622 B
Go

package service
import (
"context"
"encoding/json"
"net/http"
"github.com/fleetdm/fleet/server/fleet"
)
func decodeModifyAppConfigRequest(ctx context.Context, r *http.Request) (interface{}, error) {
var payload fleet.AppConfigPayload
if err := json.NewDecoder(r.Body).Decode(&payload); err != nil {
return nil, err
}
return appConfigRequest{Payload: payload}, nil
}
func decodeApplyEnrollSecretSpecRequest(ctx context.Context, r *http.Request) (interface{}, error) {
var req applyEnrollSecretSpecRequest
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
return nil, err
}
return req, nil
}