Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
2 of 4 tasks
hopleus opened this issue Oct 7, 2024 · 0 comments · Fixed by #2179
Closed
2 of 4 tasks

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

hopleus opened this issue Oct 7, 2024 · 0 comments · Fixed by #2179
Labels
bug Something isn't working
Milestone

Comments

@hopleus
Copy link
Contributor

hopleus commented 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

@hopleus hopleus added the bug Something isn't working label Oct 7, 2024
hopleus added a commit to hopleus/headscale that referenced this issue Oct 7, 2024
hopleus added a commit to hopleus/headscale that referenced this issue Oct 7, 2024
kradalby pushed a commit that referenced this issue Oct 9, 2024
* #2178 Fixed processing of fields in post request in MoveNode rpc

* #2178 Updated CHANGELOG.md
@nblock nblock added this to the v0.24.0 milestone Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants