Skip to content

Commit

Permalink
Remove unnecessary validation before secret expansion (#24903)
Browse files Browse the repository at this point in the history
#24549

Remove redundant code introduced in original PR #24624
  • Loading branch information
dantecatalfamo authored Dec 19, 2024
1 parent 366ab64 commit dd5cbf6
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 dd5cbf6

Please sign in to comment.