headscale/hscontrol/testdata/apiv1_golden/TestAPIV1AuthRegister_happy_path_parity.json
Kristoffer Dalby 1572ac551d test: add golden parity tests for the v1 API
Pin every endpoint's behaviour with golden fixtures captured from the
retiring grpc-gateway (timestamps and secrets neutralised). Error cases
assert their HTTP status independently of the golden via assertStatus, so
a blind regenerate cannot re-pin a wrong code; HEADSCALE_UPDATE_GOLDEN
rewrites the fixtures. A unit test exercises the API-key auth middleware
on the real server router. Exclude the emitted spec and goldens from
pre-commit checks.
2026-06-19 15:21:00 +02:00

34 lines
821 B
JSON

{
"status": 200,
"body": {
"node": {
"approvedRoutes": [],
"availableRoutes": [],
"createdAt": "\u003ctimestamp\u003e",
"discoKey": "\u003csecret\u003e",
"expiry": null,
"givenName": "regnode",
"id": "1",
"ipAddresses": [],
"lastSeen": "\u003ctimestamp\u003e",
"machineKey": "\u003csecret\u003e",
"name": "regnode",
"nodeKey": "\u003csecret\u003e",
"online": false,
"preAuthKey": null,
"registerMethod": "REGISTER_METHOD_CLI",
"subnetRoutes": [],
"tags": [],
"user": {
"createdAt": "\u003ctimestamp\u003e",
"displayName": "",
"email": "",
"id": "1",
"name": "alice",
"profilePicUrl": "",
"provider": "",
"providerId": ""
}
}
}
}