36332 Omit Android app configuration (#36348)

<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #36332
This is a small followup to to #35493

# Checklist for submitter

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

## Testing

- [x] Added/updated automated tests
- [ ] Where appropriate, [automated tests simulate multiple hosts and
test for host
isolation](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/reference/patterns-backend.md#unit-testing)
(updates to one hosts's records do not affect another)

- [x] QA'd all new/changed functionality manually
Testing the `GET /api/v1/fleet/software/titles/:id` endpoint
- android title, team id: shows configuration
- android title, no team id: doesn't show configuration at all
- ipados title, with/without team id: doesn't show configuration at all
This commit is contained in:
Jonathan Katz 2025-11-26 16:50:23 -05:00 committed by GitHub
parent 261724f6a5
commit c1a42556bf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 4 deletions

View file

@ -49,7 +49,7 @@ type VPPAppTeam struct {
AddedAutomaticInstallPolicy *Policy `json:"-"`
DisplayName *string `json:"display_name"`
// Configuration is a json file used to customize Android app
// behavior/settings. Relevant to Android only.
// behavior/settings. Applicable to Android apps only.
Configuration json.RawMessage `json:"configuration,omitempty"`
}
@ -106,9 +106,11 @@ type VPPAppStoreApp struct {
AddedAt time.Time `db:"added_at" json:"created_at"`
// Categories is the list of categories to which this software belongs: e.g. "Productivity",
// "Browsers", etc.
Categories []string `json:"categories"`
DisplayName string `json:"display_name"`
Configuration json.RawMessage `json:"configuration"`
Categories []string `json:"categories"`
DisplayName string `json:"display_name"`
// Configuration is a json file used to customize Android app
// behavior/settings. Applicable to Android apps only.
Configuration json.RawMessage `json:"configuration,omitempty"`
}
// VPPAppStatusSummary represents aggregated status metrics for a VPP app.

View file

@ -224,6 +224,14 @@ func (s *integrationMDMTestSuite) TestAndroidAppSelfService() {
// Test Android app configurations
// Title with no configuration should omit it from response
var getAppResp map[string]any
s.DoJSON("GET", fmt.Sprintf("/api/latest/fleet/software/titles/%d", addAppResp.TitleID), &getSoftwareTitleRequest{
ID: addAppResp.TitleID,
TeamID: nil,
}, http.StatusOK, &getAppResp)
require.Nil(t, getAppResp["configuration"])
// Android app with configuration
appConfiguration := json.RawMessage(`{"workProfileWidgets": "WORK_PROFILE_WIDGETS_ALLOWED"}`)
androidAppWithConfig := &fleet.VPPApp{