Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new os_distro_name and os_distro_revision device fields for posture reporting. #1073

Merged
merged 1 commit into from
Aug 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/1073.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
teams_account: add support for `os_distro_name` and `os_distro_revision`
```
36 changes: 19 additions & 17 deletions teams_devices.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,25 @@ type TeamsDeviceDetail struct {
}

type TeamsDeviceListItem struct {
User UserItem `json:"user,omitempty"`
ID string `json:"id,omitempty"`
Key string `json:"key,omitempty"`
DeviceType string `json:"device_type,omitempty"`
Name string `json:"name,omitempty"`
Model string `json:"model,omitempty"`
Manufacturer string `json:"manufacturer,omitempty"`
Deleted bool `json:"deleted,omitempty"`
Version string `json:"version,omitempty"`
SerialNumber string `json:"serial_number,omitempty"`
OSVersion string `json:"os_version,omitempty"`
MacAddress string `json:"mac_address,omitempty"`
IP string `json:"ip,omitempty"`
Created string `json:"created,omitempty"`
Updated string `json:"updated,omitempty"`
LastSeen string `json:"last_seen,omitempty"`
RevokedAt string `json:"revoked_at,omitempty"`
User UserItem `json:"user,omitempty"`
ID string `json:"id,omitempty"`
Key string `json:"key,omitempty"`
DeviceType string `json:"device_type,omitempty"`
Name string `json:"name,omitempty"`
Model string `json:"model,omitempty"`
Manufacturer string `json:"manufacturer,omitempty"`
Deleted bool `json:"deleted,omitempty"`
Version string `json:"version,omitempty"`
SerialNumber string `json:"serial_number,omitempty"`
OSVersion string `json:"os_version,omitempty"`
OSDistroName string `json:"os_distro_name,omitempty"`
OsDistroRevision string `json:"os_distro_revision,omitempty"`
MacAddress string `json:"mac_address,omitempty"`
IP string `json:"ip,omitempty"`
Created string `json:"created,omitempty"`
Updated string `json:"updated,omitempty"`
LastSeen string `json:"last_seen,omitempty"`
RevokedAt string `json:"revoked_at,omitempty"`
}

type UserItem struct {
Expand Down
34 changes: 19 additions & 15 deletions teams_devices_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ func TestTeamsDevicesList(t *testing.T) {
"version": "1.0.0",
"serial_number": "EXAMPLEHMD6R",
"os_version": "10.0.0",
"os_distro_name": "ubuntu",
"os_distro_revision": "1.0.0",
"mac_address": "00-00-5E-00-53-00",
"ip": "192.0.2.1",
"created": "2017-06-14T00:00:00Z",
Expand All @@ -58,21 +60,23 @@ func TestTeamsDevicesList(t *testing.T) {
Name: "John Appleseed",
Email: "user@example.com",
},
Key: "yek0SUYoOQ10vMGsIYAevozXUQpQtNFJFfFGqER/BGc=",
DeviceType: "windows",
Name: "My mobile device",
Model: "MyPhone(pro-X)",
Manufacturer: "My phone corp",
Deleted: true,
Version: "1.0.0",
SerialNumber: "EXAMPLEHMD6R",
OSVersion: "10.0.0",
MacAddress: "00-00-5E-00-53-00",
IP: "192.0.2.1",
Created: "2017-06-14T00:00:00Z",
Updated: "2017-06-14T00:00:00Z",
LastSeen: "2017-06-14T00:00:00Z",
RevokedAt: "2017-06-14T00:00:00Z",
Key: "yek0SUYoOQ10vMGsIYAevozXUQpQtNFJFfFGqER/BGc=",
DeviceType: "windows",
Name: "My mobile device",
Model: "MyPhone(pro-X)",
Manufacturer: "My phone corp",
Deleted: true,
Version: "1.0.0",
SerialNumber: "EXAMPLEHMD6R",
OSVersion: "10.0.0",
OSDistroName: "ubuntu",
OsDistroRevision: "1.0.0",
MacAddress: "00-00-5E-00-53-00",
IP: "192.0.2.1",
Created: "2017-06-14T00:00:00Z",
Updated: "2017-06-14T00:00:00Z",
LastSeen: "2017-06-14T00:00:00Z",
RevokedAt: "2017-06-14T00:00:00Z",
}}

mux.HandleFunc("/accounts/"+testAccountID+"/devices", handler)
Expand Down