juanfont / headscale

An open source, self-hosted implementation of the Tailscale control server
BSD 3-Clause "New" or "Revised" License
22.55k stars 1.25k forks source link

[Bug] API inconsistencies #1996

Closed akelge closed 2 months ago

akelge commented 3 months ago

Is this a support request?

Is there an existing issue for this?

Current Behavior

I am finding some bugs in the API responses, especially:

Expected Behavior

I would expect that a call to /api/v1/node/<nodeid> would return the correct set of tags and that the registerMethod would be set to the correct value

Steps To Reproduce

Do an API call to /api/v1/node/<nodeid> and inspect the response

Environment

- OS: docker
- Headscale version: v0.23.0-alpha12
- Tailscale version: not relevant

Runtime environment

Anything else?

No response

akelge commented 3 months ago

/api/v1/node/backfillips fails, I think that the route is not matched, so it tries to retrieve info on node with id backfillips, failing, of course

bigbozza commented 2 months ago

for what it is worth, I've tested this and it worked: "nodes":[{"id":"1","machineKey":"mkey:1538e343afbf96495e98bf98385c2d14254c682ec71436ed1a294f1f21100c63","nodeKey":"nodekey:f5ab18e3dde949988ec6fdcf31c42ec1440cd96d6d77c7048f725fba2003f869","discoKey":"discokey:16ef4ff594f66440486015c341c64d3b414b922f84e1d1635e31958286bf684b","ipAddresses":["100.64.0.1","fd7a:115c:a1e0::1"],"name":"Veeam","user":{"id":"1","name":"boz","createdAt":"2024-07-17T06:22:27.041754446Z"},"lastSeen":"2024-07-17T06:24:42.982663920Z","expiry":"0001-01-01T00:00:00Z","preAuthKey":null,"createdAt":"2024-07-17T06:24:38.276313596Z","registerMethod":"REGISTER_METHOD_CLI","forcedTags":[],"invalidTags":[],"validTags":[],"givenName":"veeam","online":true}]}

REGISTER_METHOD_CLI