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

Adds a cleanup webhook called on disconnect and shutdown #567

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

devinchristianson
Copy link

Adds a cleanup webhook called on disconnect and shutdown

Thanks for all of your hard work on this project - I'm enjoying it so much I've built a whole project around it to run labs/demos

This PR

  • adds key cleanupserver with value HTTPClientConfiguration to the main app config
  • converts the configuration to a webhook HTTP client on Backend Handler instantiation
  • POSTs to the webhook OnDisconnect and OnShutdown with the connectionID, expecting a 200 response
    (note that it does not include the username because the Backend Handler does not have the username, presumably because not all backends have usernames, such as the SSH Proxy)

I've been using this code on my own project for a bit now and it's been working great!

Please let me know if you have any questions or would like me to make any changes to this PR as I'm happy to!

closes #486


By contributing to this repository, I agree to the contribution guidelines.

Copy link

codecov bot commented Mar 4, 2024

Codecov Report

Attention: Patch coverage is 18.51852% with 22 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@2e330b6). Learn more about missing BASE report.

Files with missing lines Patch % Lines
internal/backend/handler.go 21.42% 10 Missing and 1 partial ⚠️
internal/backend/handler_factory.go 20.00% 7 Missing and 1 partial ⚠️
config/appconfig.go 0.00% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #567   +/-   ##
=======================================
  Coverage        ?   37.28%           
=======================================
  Files           ?      196           
  Lines           ?    17222           
  Branches        ?        0           
=======================================
  Hits            ?     6422           
  Misses          ?    10207           
  Partials        ?      593           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

Webhook For Teardown
1 participant