Skip to content

Commit 5f581da

Browse files
jaxxstormmpminardi
authored andcommitted
devices: support isEphemeral in device response
Signed-off-by: Lee Briggs <[email protected]>
1 parent d692cd6 commit 5f581da

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

devices.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ type Device struct {
8181
Created Time `json:"created"`
8282
Expires Time `json:"expires"`
8383
Hostname string `json:"hostname"`
84+
IsEphemeral bool `json:"isEphemeral"`
8485
IsExternal bool `json:"isExternal"`
8586
LastSeen Time `json:"lastSeen"`
8687
MachineKey string `json:"machineKey"`

devices_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ func TestClient_Devices_Get(t *testing.T) {
6060
LastSeen: Time{time.Date(2022, 3, 9, 20, 3, 42, 0, time.UTC)},
6161
MachineKey: "mkey:test",
6262
NodeKey: "nodekey:test",
63+
IsEphemeral: false,
6364
OS: "windows",
6465
TailnetLockError: "test error",
6566
TailnetLockKey: "tlpub:test",
@@ -162,6 +163,7 @@ func TestClient_Devices_List(t *testing.T) {
162163
Created: Time{time.Date(2022, 2, 10, 11, 50, 23, 0, time.UTC)},
163164
Expires: Time{time.Date(2022, 8, 9, 11, 50, 23, 0, time.UTC)},
164165
Hostname: "test",
166+
IsEphemeral: false,
165167
IsExternal: false,
166168
LastSeen: Time{time.Date(2022, 3, 9, 20, 3, 42, 0, time.UTC)},
167169
MachineKey: "mkey:test",
@@ -234,6 +236,7 @@ func TestDevices_Unmarshal(t *testing.T) {
234236
Hostname: "hello",
235237
ID: "50052",
236238
NodeID: "nTESTJ30",
239+
IsEphemeral: false,
237240
IsExternal: true,
238241
KeyExpiryDisabled: true,
239242
LastSeen: Time{
@@ -260,6 +263,7 @@ func TestDevices_Unmarshal(t *testing.T) {
260263
Hostname: "foo",
261264
ID: "50053",
262265
NodeID: "nTESTJ31",
266+
IsEphemeral: true,
263267
IsExternal: false,
264268
KeyExpiryDisabled: true,
265269
LastSeen: Time{

testdata/devices.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"hostname": "hello",
1414
"id": "50052",
1515
"nodeId": "nTESTJ30",
16+
"isEphemeral": false,
1617
"isExternal": true,
1718
"keyExpiryDisabled": true,
1819
"lastSeen": "2022-04-15T13:24:40Z",
@@ -36,6 +37,7 @@
3637
"hostname": "foo",
3738
"id": "50053",
3839
"nodeId": "nTESTJ31",
40+
"isEphemeral": true,
3941
"isExternal": false,
4042
"keyExpiryDisabled": true,
4143
"lastSeen": "2022-04-15T13:25:21Z",

0 commit comments

Comments
 (0)