[PR #1053] [MERGED] Validate input of expiration time for setup-keys #13267

Closed
opened 2026-08-05 02:07:56 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/1053
Author: @mlsmaycon
Created: 8/4/2023
Status: Merged
Merged: 8/4/2023
Merged by: @mlsmaycon

Base: mainHead: validate_setupkey_expiration_date


📝 Commits (2)

  • 4489da6 Validate input of expiration time for setup-keys
  • 9495eac update example and fix tests

📊 Changes

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

View changed files

📝 management/server/http/api/openapi.yml (+3 -1)
📝 management/server/http/setupkeys_handler.go (+7 -0)
📝 management/server/http/setupkeys_handler_test.go (+1 -1)

📄 Description

Describe your changes

So far we accepted any value for setup keys, including negative values

Now we are checking if it is less than 1 day or greater than 365 days

https://github.com/netbirdio/dashboard/issues/251

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

🔄 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/netbirdio/netbird/pull/1053 **Author:** [@mlsmaycon](https://github.com/mlsmaycon) **Created:** 8/4/2023 **Status:** ✅ Merged **Merged:** 8/4/2023 **Merged by:** [@mlsmaycon](https://github.com/mlsmaycon) **Base:** `main` ← **Head:** `validate_setupkey_expiration_date` --- ### 📝 Commits (2) - [`4489da6`](https://github.com/netbirdio/netbird/commit/4489da6450c4275ead5f94c3780a0f7ccc42c3a0) Validate input of expiration time for setup-keys - [`9495eac`](https://github.com/netbirdio/netbird/commit/9495eac3b4e029b41785af6858fac2e8ca971c81) update example and fix tests ### 📊 Changes **3 files changed** (+11 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `management/server/http/api/openapi.yml` (+3 -1) 📝 `management/server/http/setupkeys_handler.go` (+7 -0) 📝 `management/server/http/setupkeys_handler_test.go` (+1 -1) </details> ### 📄 Description ## Describe your changes So far we accepted any value for setup keys, including negative values Now we are checking if it is less than 1 day or greater than 365 days ## Issue ticket number and link https://github.com/netbirdio/dashboard/issues/251 ### Checklist - [x] Is it a bug fix - [x] Is a typo/documentation fix - [ ] Is a feature enhancement - [ ] It is a refactor - [ ] Created tests that fail without the change (if possible) - [ ] Extended the README / documentation, if necessary --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 02:07:56 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#13267