mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 08:58:41 +00:00
unreleased fixes for MABM (#21704)
# Checklist for submitter If some of the following don't apply, delete the relevant line. <!-- Note that API documentation changes are now addressed by the product design team. --> - [x] Manual QA for all new/changed functionality
This commit is contained in:
parent
bac0d8376a
commit
6920eedfab
2 changed files with 8 additions and 3 deletions
|
|
@ -583,6 +583,8 @@ the way that the Fleet server works.
|
|||
// backfilled
|
||||
tok := &fleet.ABMToken{
|
||||
EncryptedToken: appleBM.EncryptedToken,
|
||||
// 2000-01-01 is our "zero value" for time
|
||||
RenewAt: time.Date(2000, time.January, 1, 0, 0, 0, 0, time.UTC),
|
||||
}
|
||||
_, err = ds.InsertABMToken(context.Background(), tok)
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -1271,10 +1271,13 @@ func (svc *Service) UpdateABMTokenTeams(ctx context.Context, tokenID uint, macOS
|
|||
// validate the team IDs
|
||||
|
||||
token.MacOSTeam = fleet.ABMTokenTeam{Name: fleet.TeamNameNoTeam}
|
||||
token.MacOSDefaultTeamID = nil
|
||||
token.IOSTeam = fleet.ABMTokenTeam{Name: fleet.TeamNameNoTeam}
|
||||
token.IOSDefaultTeamID = nil
|
||||
token.IPadOSTeam = fleet.ABMTokenTeam{Name: fleet.TeamNameNoTeam}
|
||||
token.IPadOSDefaultTeamID = nil
|
||||
|
||||
if macOSTeamID != nil {
|
||||
if macOSTeamID != nil && *macOSTeamID != 0 {
|
||||
macOSTeam, err := svc.ds.Team(ctx, *macOSTeamID)
|
||||
if err != nil {
|
||||
return nil, &fleet.BadRequestError{
|
||||
|
|
@ -1288,7 +1291,7 @@ func (svc *Service) UpdateABMTokenTeams(ctx context.Context, tokenID uint, macOS
|
|||
token.MacOSDefaultTeamID = macOSTeamID
|
||||
}
|
||||
|
||||
if iOSTeamID != nil {
|
||||
if iOSTeamID != nil && *iOSTeamID != 0 {
|
||||
iOSTeam, err := svc.ds.Team(ctx, *iOSTeamID)
|
||||
if err != nil {
|
||||
return nil, &fleet.BadRequestError{
|
||||
|
|
@ -1301,7 +1304,7 @@ func (svc *Service) UpdateABMTokenTeams(ctx context.Context, tokenID uint, macOS
|
|||
token.IOSDefaultTeamID = iOSTeamID
|
||||
}
|
||||
|
||||
if iPadOSTeamID != nil {
|
||||
if iPadOSTeamID != nil && *iPadOSTeamID != 0 {
|
||||
iPadOSTeam, err := svc.ds.Team(ctx, *iPadOSTeamID)
|
||||
if err != nil {
|
||||
return nil, &fleet.BadRequestError{
|
||||
|
|
|
|||
Loading…
Reference in a new issue