[Bug] Does not receive ‘user’ field when changing node owner via API #820

Closed
opened 2025-12-29 02:24:26 +01:00 by adam · 0 comments
Owner

Originally created by @hopleus on GitHub (Oct 7, 2024).

Is this a support request?

  • This is not a support request

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

The passed user field in the v1.MoveNodeRequest (API) request does not come in. Only nodeId is received, because it is passed in url query params

Request payload:

{
"nodeId": 12,
"user": "test"
}

Request in v1.MoveNodeRequest:

{
"nodeId": 12,
"user": ""
}

Current rpc method in headscale.proto

rpc MoveNode(MoveNodeRequest) returns (MoveNodeResponse) {
    option (google.api.http) = {
        post: "/api/v1/node/{node_id}/user"
    };
}

Expected Behavior

The passed user field in the v1.MoveNodeRequest (API) request arrives correctly.

Request payload:

{
"nodeId": 12,
"user": "test"
}

Request in v1.MoveNodeRequest:

{
"nodeId": 12,
"user": "test"
}

Fixed rpc method in headscale.proto

rpc MoveNode(MoveNodeRequest) returns (MoveNodeResponse) {
    option (google.api.http) = {
        post: "/api/v1/node/{node_id}/user",
        body: "*"
    };
}

Steps To Reproduce

  1. Send POST request with valid data to /api/v1/node/{nodeId}/user
  2. Get error user not found

Environment

- OS: MacOS 15
- Headscale version: 0.22.3
- Tailscale version: 1.74.0

Runtime environment

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

Anything else?

No response

Originally created by @hopleus on GitHub (Oct 7, 2024). ### 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 The passed `user` field in the `v1.MoveNodeRequest` (API) request does not come in. Only nodeId is received, because it is passed in url query params Request payload: ```json { "nodeId": 12, "user": "test" } ``` Request in v1.MoveNodeRequest: ```json { "nodeId": 12, "user": "" } ``` Current rpc method in `headscale.proto` ```proto rpc MoveNode(MoveNodeRequest) returns (MoveNodeResponse) { option (google.api.http) = { post: "/api/v1/node/{node_id}/user" }; } ``` ### Expected Behavior The passed `user` field in the v1.MoveNodeRequest (API) request arrives correctly. Request payload: ```json { "nodeId": 12, "user": "test" } ``` Request in v1.MoveNodeRequest: ```json { "nodeId": 12, "user": "test" } ``` Fixed rpc method in `headscale.proto` ```proto rpc MoveNode(MoveNodeRequest) returns (MoveNodeResponse) { option (google.api.http) = { post: "/api/v1/node/{node_id}/user", body: "*" }; } ``` ### Steps To Reproduce 1. Send POST request with valid data to `/api/v1/node/{nodeId}/user` 2. Get error `user not found` ### Environment ```markdown - OS: MacOS 15 - Headscale version: 0.22.3 - Tailscale version: 1.74.0 ``` ### Runtime environment - [ ] Headscale is behind a (reverse) proxy - [ ] Headscale runs in a container ### Anything else? _No response_
adam added the bug label 2025-12-29 02:24:26 +01:00
adam closed this issue 2025-12-29 02:24:26 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#820