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

Add possibility to clone API tokens #15039

Closed
markkuleinio opened this issue Feb 5, 2024 · 3 comments · Fixed by #15626
Closed

Add possibility to clone API tokens #15039

markkuleinio opened this issue Feb 5, 2024 · 3 comments · Fixed by #15626
Assignees
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application

Comments

@markkuleinio
Copy link
Contributor

markkuleinio commented Feb 5, 2024

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

@markkuleinio markkuleinio added the type: feature Introduction of new functionality to the application label Feb 5, 2024
@jeremystretch jeremystretch added the status: needs triage This issue is awaiting triage by a maintainer label Mar 26, 2024
@jeffgdotorg jeffgdotorg added status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation and removed status: needs triage This issue is awaiting triage by a maintainer labels Apr 3, 2024
@jeffgdotorg
Copy link
Contributor

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.

@markkuleinio
Copy link
Contributor Author

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

markkuleinio added a commit to markkuleinio/netbox that referenced this issue Apr 4, 2024
@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation and removed status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation labels Apr 4, 2024
@jeremystretch
Copy link
Member

Thanks @markkuleinio!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants