headscale icon indicating copy to clipboard operation
headscale copied to clipboard

[Bug] API inconsistencies

Open akelge opened this issue 1 year ago • 1 comments

Is this a support request?

  • [X] This is not a support request

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

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

  • calling /api/v1/node/<nodeId> does not return validTags although tags are present, calling /api/v1/node and getting the node I want, validTags is properly populated
  • registerMethod is always REGISTER_METHOD_UNSPECIFIED even if in the DB the nodes have the correct value for the register method

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

  • [ ] Headscale is behind a (reverse) proxy
  • [X] Headscale runs in a container

Anything else?

No response

akelge avatar Jun 27 '24 10:06 akelge

/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

akelge avatar Jun 28 '24 09:06 akelge

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

bigbozza avatar Jul 17 '24 06:07 bigbozza