Remove unnecessary validation before secret expansion (#24903)

#24549

Remove redundant code introduced in original PR #24624
This commit is contained in:
Dante Catalfamo 2024-12-19 11:55:47 -05:00 committed by GitHub
parent 366ab642fe
commit dd5cbf68ed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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