Skip to content

api/v2: expose other known device IPs - #3419

Open
bigbozza wants to merge 2 commits into
juanfont:mainfrom
bigbozza:expose-other-known-ips
Open

api/v2: expose other known device IPs#3419
bigbozza wants to merge 2 commits into
juanfont:mainfrom
bigbozza:expose-other-known-ips

Conversation

@bigbozza

Copy link
Copy Markdown

Related: #2272

Summary

Headscale stores the latest endpoint set reported by each node, but this
information is not available through the API.

Add otherKnownIPs to the API v2 Device response. The field contains the
unique IP addresses from the node's last reported endpoints, excluding its
Headscale-assigned tailnet addresses.

Endpoint ports are omitted because the field represents known addresses rather
than connection endpoints. Results are sorted for deterministic responses, and
nodes without known endpoints return an empty array.

No persistence or migration changes are required.

Testing

  • Added GetDevice and ListDevices coverage.
  • Covers IPv4 and IPv6, duplicate endpoints on different ports, tailnet-address
    exclusion, and empty endpoint sets.
  • Regenerated the API v2 client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant