Add possibility to clone API tokens #9191

Closed
opened 2025-12-29 20:46:48 +01:00 by adam · 3 comments
Owner

Originally created by @markkuleinio on GitHub (Feb 5, 2024).

Originally assigned to: @markkuleinio on GitHub.

NetBox version

v3.7.1

Feature type

New functionality

Proposed functionality

I'm proposing adding a Clone function in API tokens, the similar way the Clone button works for example in prefixes.

Desired functionality:

  • Open an API token
  • Click Clone (the new button proposed here)
  • The resulted form is basically the same as in adding a new token, but:
    • User, Write enabled, Expires, Description and Allowed IPs fields are prepopulated with the previous values (user can change them if needed)
    • Key field is a new randomly generated key, just like when creating a new API token

Use case

The use case is rotating API tokens. Currently it is not possible to edit the Key field of an API token, so you have to use the Add button when rotating the tokens, and this requires you to manually enter the identical/relevant User, Expires, Description and Allowed IPs fields to match the previous API token, most often using two browser windows/tabs.

Adding the cloning possibility removes the need to copy+paste the fields manually to the new token.

Database changes

None

External dependencies

None

Originally created by @markkuleinio on GitHub (Feb 5, 2024). Originally assigned to: @markkuleinio on GitHub. ### NetBox version v3.7.1 ### Feature type New functionality ### Proposed functionality I'm proposing adding a **Clone** function in API tokens, the similar way the Clone button works for example in prefixes. Desired functionality: - Open an API token - Click Clone (the new button proposed here) - The resulted form is basically the same as in adding a new token, but: - User, Write enabled, Expires, Description and Allowed IPs fields are prepopulated with the previous values (user can change them if needed) - Key field is a new randomly generated key, just like when creating a new API token ### Use case The use case is rotating API tokens. Currently it is not possible to edit the Key field of an API token, so you have to use the Add button when rotating the tokens, and this requires you to manually enter the identical/relevant User, Expires, Description and Allowed IPs fields to match the previous API token, most often using two browser windows/tabs. Adding the cloning possibility removes the need to copy+paste the fields manually to the new token. ### Database changes None ### External dependencies None
adam added the status: acceptedtype: feature labels 2025-12-29 20:46:48 +01:00
adam closed this issue 2025-12-29 20:46:48 +01:00
Author
Owner

@jeffgdotorg commented on GitHub (Apr 3, 2024):

Thanks for raising this feature request, and thanks in particular for the clear and concise write-up.

If you are interested in doing the work to implement your idea, please let us know and we will assign the issue to you. Otherwise another developer with spare capacity can pick it up any time.

@jeffgdotorg commented on GitHub (Apr 3, 2024): Thanks for raising this feature request, and thanks in particular for the clear and concise write-up. If you are interested in doing the work to implement your idea, please let us know and we will assign the issue to you. Otherwise another developer with spare capacity can pick it up any time.
Author
Owner

@markkuleinio commented on GitHub (Apr 4, 2024):

Yes, please, assign this to me, I'll have a go on this.

@markkuleinio commented on GitHub (Apr 4, 2024): Yes, please, assign this to me, I'll have a go on this.
Author
Owner

@jeremystretch commented on GitHub (Apr 4, 2024):

Thanks @markkuleinio!

@jeremystretch commented on GitHub (Apr 4, 2024): Thanks @markkuleinio!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9191