[PR #237] [MERGED] Fix default preauthkey expiration #1336

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

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/237
Author: @cure
Created: 11/26/2021
Status: Merged
Merged: 11/26/2021
Merged by: @cure

Base: mainHead: preauthkeys-fix-default-expiration


📝 Commits (2)

  • c7f3e06 When creating a preauthkey, the default expiration was passed through as
  • 06f05d6 Merge branch 'main' into preauthkeys-fix-default-expiration

📊 Changes

2 files changed (+11 additions, -8 deletions)

View changed files

📝 cmd/headscale/cli/preauthkeys.go (+5 -7)
📝 integration_cli_test.go (+6 -1)

📄 Description

When creating a preauthkey, the default expiration was passed through as a nil value, instead of the default value (24h). This resulted in the preauthkey being created with expiration key '0001-01-01 00:00:00', which meant the key would not work, because it was already expired.

This commit applies the default expiration time (24h) when a preauthkey is created without a specific expiration. It also updates an integration test to make sure this bug does not reoccur.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/juanfont/headscale/pull/237 **Author:** [@cure](https://github.com/cure) **Created:** 11/26/2021 **Status:** ✅ Merged **Merged:** 11/26/2021 **Merged by:** [@cure](https://github.com/cure) **Base:** `main` ← **Head:** `preauthkeys-fix-default-expiration` --- ### 📝 Commits (2) - [`c7f3e06`](https://github.com/juanfont/headscale/commit/c7f3e0632bf7adfe7d5e6bd98deb19ad89510b63) When creating a preauthkey, the default expiration was passed through as - [`06f05d6`](https://github.com/juanfont/headscale/commit/06f05d6cc2229a8df50aedd8150d1501f720a611) Merge branch 'main' into preauthkeys-fix-default-expiration ### 📊 Changes **2 files changed** (+11 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `cmd/headscale/cli/preauthkeys.go` (+5 -7) 📝 `integration_cli_test.go` (+6 -1) </details> ### 📄 Description When creating a preauthkey, the default expiration was passed through as a nil value, instead of the default value (24h). This resulted in the preauthkey being created with expiration key '0001-01-01 00:00:00', which meant the key would not work, because it was already expired. This commit applies the default expiration time (24h) when a preauthkey is created without a specific expiration. It also updates an integration test to make sure this bug does not reoccur. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 02:29:44 +01:00
adam closed this issue 2025-12-29 02:29:44 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#1336