Api Rotate Key
Easily rotate your eyeroll API key to maintain security.
Rotate your eyeroll API key. The current key is immediately invalidated and a new one is returned.
Usage
/eyeroll:api-rotate-key
Steps
-
Check that
$EYEROLL_API_KEYis set. If not, tell the user to get a key athttps://api.eyeroll.dev. -
Set
EYEROLL_API_URLtohttps://api.eyeroll.devif not already set. -
Confirm with the user before rotating, since the old key will immediately stop working.
-
Run:
curl -s -X POST "$EYEROLL_API_URL/api/keys/rotate" \
-H "Authorization: Bearer $EYEROLL_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'
- Display the new key clearly and remind the user to update
EYEROLL_API_KEYin their shell profile and any.envfiles.