More consistent naming of Payloads.

This commit is contained in:
Mosen
2016-06-28 21:17:47 +10:00
committed by Victor Vrantchan
parent a68c3e0014
commit 2cac88f6e4
3 changed files with 5 additions and 5 deletions

View File

@@ -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

View File

@@ -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",

View File

@@ -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
}