mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 08:58:41 +00:00
Remove unnecessary validation before secret expansion (#24903)
#24549 Remove redundant code introduced in original PR #24624
This commit is contained in:
parent
366ab642fe
commit
dd5cbf68ed
1 changed files with 2 additions and 6 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue