Preauthkey date values timezone difference #46

Closed
opened 2025-12-29 01:21:07 +01:00 by adam · 1 comment
Owner

Originally created by @0xcd0e on GitHub (Oct 12, 2021).

The CreatedAt and Expiration properties of preauthkeys are returned in different timezone formats:

# headscale preauthkeys -n testns list -o json
[
	{
			"ID": 1,
			"Key": "fadadadf8e33c712210a7849a78d4ecd555c34dbfcea9ca8",
			"NamespaceID": 1,
			"Namespace": {
					"ID": 1,
					"CreatedAt": "2021-10-10T18:21:35.561705156+02:00",
					"UpdatedAt": "2021-10-10T18:21:35.561705156+02:00",
					"DeletedAt": null,
					"Name": "testns"
			},
			"Reusable": false,
			"Ephemeral": false,
			"CreatedAt": "2021-10-10T16:46:01.512101112Z",
			"Expiration": "2021-10-11T20:16:09.99374485+02:00"
	}
]

The "Expiration" format is the correct one for my machine.
Tested on v0.10.1

Originally created by @0xcd0e on GitHub (Oct 12, 2021). The CreatedAt and Expiration properties of preauthkeys are returned in different timezone formats: ``` # headscale preauthkeys -n testns list -o json [ { "ID": 1, "Key": "fadadadf8e33c712210a7849a78d4ecd555c34dbfcea9ca8", "NamespaceID": 1, "Namespace": { "ID": 1, "CreatedAt": "2021-10-10T18:21:35.561705156+02:00", "UpdatedAt": "2021-10-10T18:21:35.561705156+02:00", "DeletedAt": null, "Name": "testns" }, "Reusable": false, "Ephemeral": false, "CreatedAt": "2021-10-10T16:46:01.512101112Z", "Expiration": "2021-10-11T20:16:09.99374485+02:00" } ] ``` The "Expiration" format is the correct one for my machine. Tested on v0.10.1
adam added the bug label 2025-12-29 01:21:07 +01:00
adam closed this issue 2025-12-29 01:21:07 +01:00
Author
Owner

@huskyii commented on GitHub (Mar 12, 2022):

@juanfont this issue can be closed, as it disappears in v0.13.0

Output of headscale preauthkeys list -o json:

[
        {
                "namespace": "testns",
                "id": "1",
                "key": "db82ff012ab055fd4f046b48e54241745f0236acda7244b2",
                "expiration": {
                        "seconds": 1647197674,
                        "nanos": 900666322
                },
                "created_at": {
                        "seconds": 1647111274,
                        "nanos": 902574870
                }
        }
]

Output of headscale preauthkeys list -o yaml

- namespace: testns
  id: "1"
  key: db82ff012ab055fd4f046b48e54241745f0236acda7244b2
  reusable: false
  ephemeral: false
  used: false
  expiration:
    seconds: 1647111515
    nanos: 548320116
  createdat:
    seconds: 1647111274
    nanos: 902574870

Output of headscale preauthkeys list

ID | Key                                              | Reusable | Ephemeral | Used  | Expiration          | Created            
1  | db82ff012ab055fd4f046b48e54241745f0236acda7244b2 | false    | false     | false | 2022-03-12 18:58:35 | 2022-03-12 18:54:34
@huskyii commented on GitHub (Mar 12, 2022): @juanfont this issue can be closed, as it disappears in v0.13.0 Output of `headscale preauthkeys list -o json`: ```json [ { "namespace": "testns", "id": "1", "key": "db82ff012ab055fd4f046b48e54241745f0236acda7244b2", "expiration": { "seconds": 1647197674, "nanos": 900666322 }, "created_at": { "seconds": 1647111274, "nanos": 902574870 } } ] ``` Output of `headscale preauthkeys list -o yaml` ```yaml - namespace: testns id: "1" key: db82ff012ab055fd4f046b48e54241745f0236acda7244b2 reusable: false ephemeral: false used: false expiration: seconds: 1647111515 nanos: 548320116 createdat: seconds: 1647111274 nanos: 902574870 ``` Output of `headscale preauthkeys list` ```shell ID | Key | Reusable | Ephemeral | Used | Expiration | Created 1 | db82ff012ab055fd4f046b48e54241745f0236acda7244b2 | false | false | false | 2022-03-12 18:58:35 | 2022-03-12 18:54:34 ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#46