Don't make extra queries for unused data when grabbing team config for conditional access (#35337)

For #35333.

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

- [x] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)
This commit is contained in:
Ian Littman 2025-11-06 22:39:10 -06:00 committed by GitHub
parent cfb1480f19
commit 6b638189d4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View file

@ -0,0 +1 @@
* Use a lighter-weight query for checking if a team is enabled for conditional access.

View file

@ -2439,7 +2439,7 @@ func (svc *Service) conditionalAccessConfiguredAndEnabledForTeam(ctx context.Con
}
// Host belongs to a team, thus we load the team configuration.
team, err := svc.ds.Team(ctx, *hostTeamID)
team, err := svc.ds.TeamWithoutExtras(ctx, *hostTeamID)
if err != nil {
return false, false, ctxerr.Wrap(ctx, err, "failed to load team config")
}