mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 08:58:41 +00:00
Add method to fleetDesktopResponse to satisfy the errorer interface (#8457)
This commit is contained in:
parent
b32bfc2988
commit
fdcbbaac7e
2 changed files with 9 additions and 0 deletions
|
|
@ -46,6 +46,8 @@ type fleetDesktopResponse struct {
|
|||
FailingPolicies *uint `json:"failing_policies_count,omitempty"`
|
||||
}
|
||||
|
||||
func (r fleetDesktopResponse) error() error { return r.Err }
|
||||
|
||||
type getFleetDesktopRequest struct {
|
||||
Token string `url:"token"`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -135,6 +135,13 @@ func (s *integrationTestSuite) TestDeviceAuthenticatedEndpoints() {
|
|||
json.NewDecoder(res.Body).Decode(&getHostResp)
|
||||
res.Body.Close()
|
||||
require.Nil(t, listPoliciesResp.Policies)
|
||||
|
||||
// /device/desktop is not accessible for free endpoints
|
||||
getDesktopResp := fleetDesktopResponse{}
|
||||
res = s.DoRawNoAuth("GET", "/api/latest/fleet/device/"+token+"/desktop", nil, http.StatusPaymentRequired)
|
||||
json.NewDecoder(res.Body).Decode(&getDesktopResp)
|
||||
res.Body.Close()
|
||||
require.Nil(t, getDesktopResp.FailingPolicies)
|
||||
}
|
||||
|
||||
// TestDefaultTransparencyURL tests that Fleet Free licensees are restricted to the default transparency url.
|
||||
|
|
|
|||
Loading…
Reference in a new issue