[PR #20918] [MERGED] Closes #20917: Show example API usage for tokens #16087

Closed
opened 2025-12-30 00:25:43 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/20918
Author: @jeremystretch
Created: 12/3/2025
Status: Merged
Merged: 12/4/2025
Merged by: @jnovinger

Base: featureHead: 20917-api-token-examples


📝 Commits (1)

📊 Changes

7 files changed (+64 additions, -69 deletions)

View changed files

📝 netbox/account/views.py (+11 -0)
netbox/templates/users/panels/token_example.html (+9 -0)
📝 netbox/templates/users/token.html (+0 -69)
📝 netbox/users/models/tokens.py (+9 -0)
netbox/users/ui/__init__.py (+0 -0)
netbox/users/ui/panels.py (+25 -0)
📝 netbox/users/views.py (+10 -0)

📄 Description

Closes: #20917

  • Add the get_auth_header_prefix() method on the Token model
  • Convert TokenView and UserTokenView to use the new layout mechanism
  • Add a panel to TokenView showing example usage of the token, including a copy-to-clipboard button

🔄 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/netbox-community/netbox/pull/20918 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 12/3/2025 **Status:** ✅ Merged **Merged:** 12/4/2025 **Merged by:** [@jnovinger](https://github.com/jnovinger) **Base:** `feature` ← **Head:** `20917-api-token-examples` --- ### 📝 Commits (1) - [`c103649`](https://github.com/netbox-community/netbox/commit/c103649298508e29084ff9ea2afe24a2f5a80ab3) Closes #20917: Show example API usage for tokens ### 📊 Changes **7 files changed** (+64 additions, -69 deletions) <details> <summary>View changed files</summary> 📝 `netbox/account/views.py` (+11 -0) ➕ `netbox/templates/users/panels/token_example.html` (+9 -0) 📝 `netbox/templates/users/token.html` (+0 -69) 📝 `netbox/users/models/tokens.py` (+9 -0) ➕ `netbox/users/ui/__init__.py` (+0 -0) ➕ `netbox/users/ui/panels.py` (+25 -0) 📝 `netbox/users/views.py` (+10 -0) </details> ### 📄 Description ### Closes: #20917 - Add the `get_auth_header_prefix()` method on the Token model - Convert TokenView and UserTokenView to use the new layout mechanism - Add a panel to TokenView showing example usage of the token, including a copy-to-clipboard button --- <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-30 00:25:43 +01:00
adam closed this issue 2025-12-30 00:25:43 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#16087