Generating API Tokens¶
To execute Mayhem runs and download test cases or coverage files via the CLI, it is necessary to generate and authenticate Mayhem API tokens with the Mayhem server. Developers can use the mayhem login
command along with their API token to authenticate with their Mayhem instance.
Tip
See Installing the Mayhem CLI for more information.
Navigating to the API Tokens Page¶
From the Mayhem UI Home screen, click on your profile in the bottom-left of the main navigation pane and select Account Settings. Then, click on API Tokens and select Create Token.
Managing Your API Tokens¶
Within the API Tokens page, you can view a list of your active API tokens for your user account and when they were last accessed or used.
Here you can perform the following actions:
- Issue a New API Token: Creates an entirely new API token for the current user.
- Revoke an Existing API Token: Deletes the specified API token from the current user.
Note
To adhere to security best practices, the actual API token will only be visible upon its initial creation. In the event that you forget your API token, the recommended approach is to generate a new one. This ensures the ongoing security of your system and protects against unauthorized access.
Summary¶
To perform Mayhem runs and download test cases or coverage files using the Mayhem CLI, it is essential to log in to your Mayhem server deployment using the mayhem login
command and one of your API tokens.
Having knowledge of the location to navigate to for viewing and managing your API tokens will assist you in setting up your environment effectively, enabling seamless utilization of the Mayhem CLI.