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

feat: support client verify for derp (add integration tests) #2046

Merged
merged 13 commits into from
Nov 22, 2024

Conversation

ArcticLampyrid
Copy link
Contributor

  • have read the CONTRIBUTING.md file
  • raised a GitHub issue or discussed it on the projects chat beforehand
  • added unit tests
  • added integration tests
  • updated documentation if needed
  • updated CHANGELOG.md

Fixes #1953

By implementing /verify endpoint, derper can verify whether the client is in the node list of Headscale by specifying the --verify-client-url parameter to /verify in Headscale.

This is a continued work on PR #1957, which includes integration testing to meet Headscale's merge requirements.

I am willing to participate in updating the related documentation and change logs, if needed. (Of course, I believe @117503445 is also willing)

@117503445
Copy link
Contributor

Thank you very much for your work! I have been a bit busy lately, and it would be great if you could help push this matter forward.

@ArcticLampyrid
Copy link
Contributor Author

Rebased onto main.

Can you give a review?

@kradalby
Copy link
Collaborator

kradalby commented Nov 1, 2024

Im away traveling, but ill get back to it in a few weeks when im back.

@yqs112358
Copy link

Very very useful future 👍 Eliminates the need to create Tailscale clients for every derper server I build.

hscontrol/handlers.go Outdated Show resolved Hide resolved
hscontrol/handlers.go Outdated Show resolved Hide resolved
hscontrol/handlers.go Outdated Show resolved Hide resolved
integration/derp_verify_endpoint_test.go Outdated Show resolved Hide resolved
integration/derp_verify_endpoint_test.go Outdated Show resolved Hide resolved
integration/hsic/hsic.go Outdated Show resolved Hide resolved
integration/dsic/dsic.go Outdated Show resolved Hide resolved
@kradalby
Copy link
Collaborator

This looks in general good, some comments, and a couple of failing tests to check out. Thanks!

hscontrol/handlers.go Outdated Show resolved Hide resolved
@kradalby
Copy link
Collaborator

Thank you, given passing tests this should be good to go

@ArcticLampyrid
Copy link
Contributor Author

I believe this PR is ready for review and merging. The failures in the checks seem unrelated to the changes introduced in this PR. Specifically:

  • TestDERPServerWebsocketScenario failure appears to be caused by tailscale/tailscale@020cacb, which no longer links websockets by default other than GOOS=js.
  • The warnings reported by golangci-lint are from files that were not modified in this PR.

Please let me know if there's anything further needed.

@kradalby
Copy link
Collaborator

Since its DERP related, tho I agree it's not related, I would prefer having a pr to fix the failing tests first so we can have this one passing clean.

I might be able to get to it this week, but if you have the opportunity that would be appreciated, or @enoperm who I introduced the websocket stuff

@enoperm
Copy link
Contributor

enoperm commented Nov 17, 2024

Okay... at glance I'm not sure how to fix it without either a custom client (compiled with GOOS=js) or custom client builds, both of which I believe we'd prefer to avoid, since the point is to ensure we are compatible with the official client, right?

On the other hand, I specifically put work into being able to detect this exact scenario (behaviour of the client-under-test changing) in spite of the interface (env var). Seeing it turn red, it feels like it was worth the effort. :)

@kradalby
Copy link
Collaborator

moved discussion to: #2241

@kradalby kradalby merged commit edf9e25 into juanfont:main Nov 22, 2024
122 of 125 checks passed
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.

[Feature] Support for derp's verify-client-url
5 participants