Skip to content

Commit

Permalink
Remove unnecessary validation before secret expandion
Browse files Browse the repository at this point in the history
  • Loading branch information
dantecatalfamo committed Dec 19, 2024
1 parent 0065c92 commit e4eda79
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions server/service/apple_mdm.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,14 +380,10 @@ func (svc *Service) NewMDMAppleConfigProfile(ctx context.Context, teamID uint, r
})
}

if err := svc.ds.ValidateEmbeddedSecrets(ctx, []string{string(b)}); err != nil {
return nil, fleet.NewInvalidArgumentError("profile", err.Error())
}

// Expand secrets in profile for validation
// Expand and validate secrets in profile
expanded, err := svc.ds.ExpandEmbeddedSecrets(ctx, string(b))
if err != nil {
return nil, ctxerr.Wrap(ctx, err, "expanding secrets in profile for parsing")
return nil, ctxerr.Wrap(ctx, fleet.NewInvalidArgumentError("profile", err.Error()))
}

cp, err := fleet.NewMDMAppleConfigProfile([]byte(expanded), &teamID)
Expand Down

0 comments on commit e4eda79

Please sign in to comment.