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

PD-1680 / 25.04 / Pd 1680 user linked api tokens #3426

Merged
merged 17 commits into from
Jan 14, 2025
Merged
53 changes: 42 additions & 11 deletions content/SCALE/SCALETutorials/TopToolbar/ManagingAPIKeys.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Managing API Keys"
description: "This tutorial shows how to add, create, or edit an API key in TrueNAS."
description: "This tutorial shows how to add, create, or edit an API key in TrueNAS and access API Documentation."
weight: 30
aliases:
- /scale/scaleclireference/auth/cliapikey/
Expand All @@ -9,35 +9,66 @@ tags:
- apikeys
---

The **API Keys** option on the top right toolbar **Settings** (user icon) dropdown menu displays the **API Keys** screen.
This screen displays a list of API keys added to your system and allows you to add, edit, or delete keys.
The <i class="material-icons" aria-hidden="true" title="laptop" style="vertical-align: top;">laptop</i> **My API Keys** option on the top right toolbar **Settings** (user icon) dropdown menu displays the **User API Keys** screen.
This screen displays a list of API keys added to your system and allows you to add, search, edit, or delete keys.
Click **API Docs** to view [API Documentation](#api-documentation).

{{< trueimage src="/images/SCALE/Dashboard/APIKeysScreen.png" alt="API Keys Screen" id="API Keys Screen" >}}

{{<include file="/static/includes/addcolumnorganizer.md">}}

## Adding an API Key

Click **Add** to display a dialog window that lets users add a new API key.
Click **Add** to open the **Add API Key** screen.

{{< trueimage src="/images/SCALE/Dashboard/APIKeysAdd.png" alt="Add API Key" id="Add API Key" >}}

Type a descriptive name and click **Add**. The system displays a confirmation dialog and adds a new API key to the list.
Type a descriptive name for the key.
Use the **Username** dropdown to select an administrative user to associate with this key.

## Editing or Deleting an API Key
Accept the default **Non-expiring** to create a token with no expiration date.
A non-expiring key remains active until it is manually revoked or updated.

Select the <span class="iconify" data-icon="eva:more-vertical-outline"></span> icon for any API key on the list to display options to manage that API key. Options are **Edit** or **Delete**.
To create a key with a scheduled expiration, click to clear the **Non-expiring** checkbox.
Click on the **Expires at** field and use the calendar dropdown to select the expiration date.

{{< trueimage src="/images/SCALE/Dashboard/APIKeyExpires.png" alt="Key Expiration Settings" id="Key Expiration Settings" >}}

Click **Save** to generate the key.

TrueNAS displays an **API Key** dialog containing the generated key value.

{{< trueimage src="/images/SCALE/Dashboard/APIKeyCopy.png" alt="API Key Success Dialog" id="API Key Success Dialog" >}}

Click **Copy to Clipboard** and save the API key string in a secure location.

{{< include file="/static/includes/APIKeyWarn.md" >}}
DjP-iX marked this conversation as resolved.
Show resolved Hide resolved

Click **Close** to return to the **User API Keys** screen.

## Managing API Keys

### Editing an API Key

Click <i class="material-icons" aria-hidden="true" title="Edit">edit</i> edit for any API key on the list to open the **Edit API Key** window and modify that key.

{{< trueimage src="/images/SCALE/Dashboard/APIKeysEdit.png" alt="Edit API Key" id="Edit API Key" >}}

Select the **Reset** to remove the existing API key and generate a new random key. The dialog displays the new key and the **Copy to Clipboard** option to copy the key to the clipboard.
Select the **Reset** to remove the existing API key and generate a new random key.
The dialog displays the new key and the **Copy to Clipboard** option.
Click to copy the new API key string then save it in a secure location.

{{< include file="/static/includes/APIKeyWarn.md" >}}

To delete, select **Confirm** on the delete dialog to activate the **Delete** button.
### Deleting an API Key

Click <i class="material-icons" aria-hidden="true" title="Delete">delete</i> delete for any API key on the list to remove that key.
TrueNAS opens a **Delete API Key** dialog

{{< trueimage src="/images/SCALE/Dashboard/APIKeysDelete.png" alt="Delete API Key" id="Delete API Key" >}}

## API Key Documentation
Select **Confirm** then click **Delete**.

## API Documentation

Click **API Docs** to access API documentation that is built into the system.
Click **API Docs** to access the TrueNAS API documentation that is built into the system.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "API Keys Screen"
description: "Describes how the API keys screen in TrueNAS."
title: "User API Keys Screen"
description: "Describes how the User API Keys screen in TrueNAS and access API Documentation"
weight: 20
aliases:
- /scale/scaleclireference/auth/cliapikey/
Expand All @@ -9,17 +9,28 @@ tags:
- toolbar
---

The **API Keys** option on the top toolbar **Settings** dropdown menu displays the **API Keys** screen.
This screen displays a list of TrueNAS API keys on your system and allows you to add, edit, or delete keys.
The <i class="material-icons" aria-hidden="true" title="laptop" style="vertical-align: top;">laptop</i> **My API Keys** option on the top right toolbar **Settings** (user icon) dropdown menu displays the **User API Keys** screen.
This screen displays a list of API keys added to your system and allows you to add, search, edit, or delete keys.
**API Docs** opens the [API Documentation](#api-documentation).

{{< trueimage src="/images/SCALE/Dashboard/APIKeysScreen.png" alt="API Keys Screen" id="API Keys Screen" >}}

Click the <span class="iconify" data-icon="eva:more-vertical-outline"></span> icon to the right of an API key to display options for that key. API key options are **Edit** and **Delete**.
**Add** opens the **Add API Key** screen.

Use **Add** to add a new API key to your TrueNAS.
{{< trueimage src="/images/SCALE/Dashboard/APIKeysAdd.png" alt="Add API Key" id="Add API Key" >}}

{{< include file="/static/includes/APIKeyWarn.md" >}}

## API Key Documentation
<i class="material-icons" aria-hidden="true" title="Edit">edit</i> edit for any API key on the list openss the **Edit API Key** window to modify that key.

Click **API Docs** to access API documentation for your system.
{{< trueimage src="/images/SCALE/Dashboard/APIKeysEdit.png" alt="Edit API Key" id="Edit API Key" >}}

**Reset** removes the existing API key and generates a new random key.

<i class="material-icons" aria-hidden="true" title="Delete">delete</i> delete for any API key on the list opens a **Delete API Key** dialog to remove that key.

{{< trueimage src="/images/SCALE/Dashboard/APIKeysDelete.png" alt="Delete API Key" id="Delete API Key" >}}

## API Documentation

**API Docs** opens the TrueNAS API documentation that is built into the system.
Binary file added static/images/SCALE/Dashboard/APIKeyCopy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/images/SCALE/Dashboard/APIKeyExpires.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified static/images/SCALE/Dashboard/APIKeysDelete.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified static/images/SCALE/Dashboard/APIKeysEdit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified static/images/SCALE/Dashboard/APIKeysScreen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions static/includes/25.04FeatureList.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@

* Versioned TrueNAS API

* Improved UI Login Experience ([NAS-130810](https://ixsystems.atlassian.net/browse/NAS-130810)).
* User-linked API Keys (see [Managing API Keys]({{< relref "/scale/scaletutorials/toptoolbar/managingapikeys.md" >}}))

* Improved STIG Compliance and Security Focus ([NAS-127235](https://ixsystems.atlassian.net/browse/NAS-127235))
* Improved UI Login Experience ([NAS-130810](https://ixsystems.atlassian.net/browse/NAS-130810)).

<--->

* Improved STIG Compliance and Security Focus ([NAS-127235](https://ixsystems.atlassian.net/browse/NAS-127235))

* Containers (Sandboxes) with Incus (Experimental Community Feature) ([NAS-130251](https://ixsystems.atlassian.net/browse/NAS-130251))

* Enable support for ZFS Fast Deduplication ([NAS-127088](https://ixsystems.atlassian.net/browse/NAS-127088))
Expand Down
3 changes: 2 additions & 1 deletion static/includes/APIKeyWarn.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
&NewLine;

{{< hint type=warning >}}
Always back up and secure keys. The key string displays only one time, at creation!
Always back up and secure keys.
TrueNAS displays the key string only one time after creation, in the **API Key** confirmation dialog.
{{< /hint >}}
Loading