Preauthkey used-state not present in cli #50

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

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

The state of a non-reusable and non-expiring authkey does not change after it has been used.
The key is created with:

# headscale preauthkeys -n testns create
113e747ffd73ecb662e88ee730b333bbb72288cff633a032

Printing its information returns

# headscale preauthkeys -n testns list -o json
[
        {
                "ID": 1,
                "Key": "113e747ffd73ecb662e88ee730b333bbb72288cff633a032",
                "NamespaceID": 1,
                "Namespace": {
                        "ID": 1,
                        "CreatedAt": "2021-10-12T20:43:56.200650079+02:00",
                        "UpdatedAt": "2021-10-12T20:43:56.200650079+02:00",
                        "DeletedAt": null,
                        "Name": "testns"
                },
                "Reusable": false,
                "Ephemeral": false,
                "CreatedAt": "2021-10-12T18:45:04.474938131Z",
                "Expiration": null
        }
]

It then gets used.
Printing its information again returns the same object without a hint that it has already been used

# headscale preauthkeys -n testns list -o json
[
        {
                "ID": 1,
                "Key": "113e747ffd73ecb662e88ee730b333bbb72288cff633a032",
                "NamespaceID": 1,
                "Namespace": {
                        "ID": 1,
                        "CreatedAt": "2021-10-12T20:43:56.200650079+02:00",
                        "UpdatedAt": "2021-10-12T20:43:56.200650079+02:00",
                        "DeletedAt": null,
                        "Name": "testns"
                },
                "Reusable": false,
                "Ephemeral": false,
                "CreatedAt": "2021-10-12T18:45:04.474938131Z",
                "Expiration": null
        }
]

Trying to use it again doesnt work, so headscale knows that it has already been used.

Tested on v0.10.1

Originally created by @0xcd0e on GitHub (Oct 12, 2021). The state of a non-reusable and non-expiring authkey does not change after it has been used. The key is created with: ``` # headscale preauthkeys -n testns create 113e747ffd73ecb662e88ee730b333bbb72288cff633a032 ``` Printing its information returns ``` # headscale preauthkeys -n testns list -o json [ { "ID": 1, "Key": "113e747ffd73ecb662e88ee730b333bbb72288cff633a032", "NamespaceID": 1, "Namespace": { "ID": 1, "CreatedAt": "2021-10-12T20:43:56.200650079+02:00", "UpdatedAt": "2021-10-12T20:43:56.200650079+02:00", "DeletedAt": null, "Name": "testns" }, "Reusable": false, "Ephemeral": false, "CreatedAt": "2021-10-12T18:45:04.474938131Z", "Expiration": null } ] ``` It then gets used. Printing its information again returns the same object without a hint that it has already been used ``` # headscale preauthkeys -n testns list -o json [ { "ID": 1, "Key": "113e747ffd73ecb662e88ee730b333bbb72288cff633a032", "NamespaceID": 1, "Namespace": { "ID": 1, "CreatedAt": "2021-10-12T20:43:56.200650079+02:00", "UpdatedAt": "2021-10-12T20:43:56.200650079+02:00", "DeletedAt": null, "Name": "testns" }, "Reusable": false, "Ephemeral": false, "CreatedAt": "2021-10-12T18:45:04.474938131Z", "Expiration": null } ] ``` Trying to use it again doesnt work, so headscale knows that it has already been used. Tested on v0.10.1
adam closed this issue 2025-12-29 01:21:10 +01:00
Author
Owner

@juanfont commented on GitHub (Oct 13, 2021):

This is fixed now!

@juanfont commented on GitHub (Oct 13, 2021): This is fixed now!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#50