Added url property on get fleet maintained app endpoint (#25660)
for https://github.com/fleetdm/fleet/issues/25251 - [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/Committing-Changes.md#changes-files) for more information. - [x] Added/updated automated tests
This commit is contained in:
@@ -0,0 +1 @@
|
||||
* Added download url for fleet maintained apps as `url` property on `fleet/software/fleet_maintained_apps/:id`
|
||||
@@ -10,7 +10,7 @@ type MaintainedApp struct {
|
||||
Token string `json:"-" db:"token"`
|
||||
Version string `json:"version" db:"version"`
|
||||
Platform AppleDevicePlatform `json:"platform" db:"platform"`
|
||||
InstallerURL string `json:"-" db:"installer_url"`
|
||||
InstallerURL string `json:"url" db:"installer_url"`
|
||||
SHA256 string `json:"-" db:"sha256"`
|
||||
BundleIdentifier string `json:"-" db:"bundle_identifier"`
|
||||
|
||||
|
||||
@@ -16190,12 +16190,21 @@ func (s *integrationEnterpriseTestSuite) TestMaintainedApps() {
|
||||
var getMAResp getFleetMaintainedAppResponse
|
||||
s.DoJSON(http.MethodGet, fmt.Sprintf("/api/latest/fleet/software/fleet_maintained_apps/%d", listMAResp.FleetMaintainedApps[0].ID), getFleetMaintainedAppRequest{}, http.StatusOK, &getMAResp)
|
||||
// TODO this will change when actual install scripts are created.
|
||||
actualApp := listMAResp.FleetMaintainedApps[0]
|
||||
dbAppRecord, err := s.ds.GetMaintainedAppByID(ctx, listMAResp.FleetMaintainedApps[0].ID)
|
||||
require.NoError(t, err)
|
||||
dbAppResponse := fleet.MaintainedApp{
|
||||
ID: dbAppRecord.ID,
|
||||
Name: dbAppRecord.Name,
|
||||
Version: dbAppRecord.Version,
|
||||
Platform: dbAppRecord.Platform,
|
||||
InstallerURL: dbAppRecord.InstallerURL,
|
||||
InstallScript: dbAppRecord.InstallScript,
|
||||
UninstallScript: dbAppRecord.UninstallScript,
|
||||
}
|
||||
require.NotEmpty(t, getMAResp.FleetMaintainedApp.InstallerURL)
|
||||
require.NotEmpty(t, getMAResp.FleetMaintainedApp.InstallScript)
|
||||
require.NotEmpty(t, getMAResp.FleetMaintainedApp.UninstallScript)
|
||||
getMAResp.FleetMaintainedApp.InstallScript = ""
|
||||
getMAResp.FleetMaintainedApp.UninstallScript = ""
|
||||
require.Equal(t, actualApp, *getMAResp.FleetMaintainedApp)
|
||||
require.Equal(t, dbAppResponse, *getMAResp.FleetMaintainedApp)
|
||||
|
||||
// Try adding ingested app with invalid secret
|
||||
reqInvalidSecret := &addFleetMaintainedAppRequest{
|
||||
|
||||
Reference in New Issue
Block a user