mirror of
https://github.com/micromdm/micromdm/
synced 2026-08-12 04:55:39 +08:00
More consistent naming of Payloads.
This commit is contained in:
@@ -53,7 +53,7 @@ func NewPayload(identifier string) *Payload {
|
||||
}
|
||||
}
|
||||
|
||||
type SCEPPayload struct {
|
||||
type SCEPPayloadContent struct {
|
||||
CAFingerprint []byte `plist:"omitempty"` // NSData
|
||||
Challenge string `plist:"omitempty"`
|
||||
Keysize int
|
||||
@@ -65,7 +65,7 @@ type SCEPPayload struct {
|
||||
}
|
||||
|
||||
// TODO: Actually this is one of those non-nested payloads that doesnt respect the PayloadContent key.
|
||||
type MDMPayload struct {
|
||||
type MDMPayloadContent struct {
|
||||
Payload Payload
|
||||
AccessRights int
|
||||
CheckInURL string
|
||||
|
||||
@@ -32,7 +32,7 @@ func (svc service) Enroll() (*Profile, error) {
|
||||
profile.PayloadDisplayName = "Enrollment Profile"
|
||||
profile.PayloadDescription = "The server may alter your settings"
|
||||
|
||||
scepContent := SCEPPayload{
|
||||
scepContent := SCEPPayloadContent{
|
||||
Challenge: svc.SCEPChallenge,
|
||||
URL: svc.SCEPUrl,
|
||||
Keysize: 1024,
|
||||
@@ -47,7 +47,7 @@ func (svc service) Enroll() (*Profile, error) {
|
||||
scepPayload.PayloadDisplayName = "SCEP"
|
||||
scepPayload.PayloadContent = scepContent
|
||||
|
||||
mdmPayload := MDMPayload{
|
||||
mdmPayload := MDMPayloadContent{
|
||||
Payload: Payload{
|
||||
PayloadVersion: 1,
|
||||
PayloadType: "com.apple.mdm",
|
||||
|
||||
@@ -37,7 +37,7 @@ func decodeMDMEnrollRequest(_ context.Context, r *http.Request) (interface{}, er
|
||||
func encodeResponse(ctx context.Context, w http.ResponseWriter, response interface{}) error {
|
||||
resp := response.(mdmEnrollResponse)
|
||||
|
||||
plistData, err := plist.Marshal(resp)
|
||||
plistData, err := plist.Marshal(resp.Profile)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user