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: allow setting node registration expiration via config #2280

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

Conversation

chriswiggins
Copy link

I haven't done any unit / integration tests yet as I'd like to be pointed in the right direction with where it should be.

  • 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 #2277

@chriswiggins chriswiggins force-pushed the feat/configurable-registration-cache branch from 7f739b4 to 7518eba Compare December 11, 2024 21:04
Copy link
Collaborator

@kradalby kradalby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine, I think this actually opens for us to test this, which it isnt atm.
Maybe like a variant of https://github.com/juanfont/headscale/blob/main/integration/auth_web_flow_test.go#L73, where the login flow has a wait to ensure they timeout so they are cleaned up and out of the cache and therefor fail. You can override the setting with a quite short expiry.

Comment on lines +944 to +945
NodeRegistrationCacheExpiration: viper.GetDuration("tuning.node_registration_cache_expiration"),
NodeRegistrationCacheCleanup: viper.GetDuration("tuning.node_registration_cache_cleanup"),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these should be "nestable" in yaml, so

Suggested change
NodeRegistrationCacheExpiration: viper.GetDuration("tuning.node_registration_cache_expiration"),
NodeRegistrationCacheCleanup: viper.GetDuration("tuning.node_registration_cache_cleanup"),
NodeRegistrationCacheExpiration: viper.GetDuration("tuning.node_registration_cache.expiration"),
NodeRegistrationCacheCleanup: viper.GetDuration("tuning.node_registration_cache.cleanup"),

but its fine to keep them as fields in go.

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] Configurable Registration Cache timeouts
2 participants