As discussed in #5579 (comment), this should be completed before bringing Desktop out of beta.
Currently defined /device endpoints:
|
// device-authenticated endpoints |
|
de := newDeviceAuthenticatedEndpointer(svc, logger, opts, r, apiVersions...) |
|
de.GET("/api/_version_/fleet/device/{token}", getDeviceHostEndpoint, getDeviceHostRequest{}) |
|
de.POST("/api/_version_/fleet/device/{token}/refetch", refetchDeviceHostEndpoint, refetchDeviceHostRequest{}) |
|
de.GET("/api/_version_/fleet/device/{token}/device_mapping", listDeviceHostDeviceMappingEndpoint, listDeviceHostDeviceMappingRequest{}) |
|
de.GET("/api/_version_/fleet/device/{token}/macadmins", getDeviceMacadminsDataEndpoint, getDeviceMacadminsDataRequest{}) |
We need to add one to fetch the host's policies (+ their results, similar to how they are returned in the /api/_version_/fleet/device/{token} endpoint).
NOTE(lucas): We should expose this endpoint to be used by Go code (the Fleet Desktop tray application is made in Go: orbit/cmd/desktop/desktop.go). Should be similar to what we have for fleetctl in the server/service/client_*.go files.
Why? @sharvilshah had to copy the types to be able to make requests and parse the responses: e.g.
|
type Response struct { |
|
Host struct { |
|
Policies []struct { |
|
ID int `json:"id"` |
|
Name string `json:"name"` |
|
Query string `json:"query"` |
|
Description string `json:"description"` |
|
AuthorID int `json:"author_id"` |
|
AuthorName string `json:"author_name"` |
|
AuthorEmail string `json:"author_email"` |
|
TeamID interface{} `json:"team_id"` |
|
Resolution string `json:"resolution"` |
|
Platform string `json:"platform"` |
|
CreatedAt time.Time `json:"created_at"` |
|
UpdatedAt time.Time `json:"updated_at"` |
|
Response string `json:"response"` |
|
} `json:"policies"` |
|
Status string `json:"status"` |
|
DisplayText string `json:"display_text"` |
|
} `json:"host"` |
|
License struct { |
|
Tier string `json:"tier"` |
|
Organization string `json:"organization"` |
|
DeviceCount int `json:"device_count"` |
|
Expiration time.Time `json:"expiration"` |
|
Note string `json:"note"` |
|
} `json:"license"` |
|
} |
As discussed in #5579 (comment), this should be completed before bringing Desktop out of beta.
Currently defined
/deviceendpoints:fleet/server/service/handler.go
Lines 391 to 396 in d84d600
We need to add one to fetch the host's policies (+ their results, similar to how they are returned in the
/api/_version_/fleet/device/{token}endpoint).NOTE(lucas): We should expose this endpoint to be used by Go code (the Fleet Desktop tray application is made in Go:
orbit/cmd/desktop/desktop.go). Should be similar to what we have forfleetctlin theserver/service/client_*.gofiles.Why? @sharvilshah had to copy the types to be able to make requests and parse the responses: e.g.
fleet/orbit/cmd/desktop/desktop.go
Lines 22 to 49 in 8e5cedf