Generate long-lived JWT tokens for automation, scripts, and external clients.
Generate a JWT token for your account:
pangolin-user get-token --description "PyIceberg automation" --expires-in 90Parameters:
--description(required): Description of what this token will be used for--expires-in(optional): Token expiration in days (default: 90)
Example Output:
✅ Token generated successfully!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Expires: 2025-03-18T12:00:00Z
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠️ Save this token securely. It will not be shown again.
💡 Use this token with PyIceberg:
catalog = load_catalog('my_catalog', uri='...', token='<TOKEN>')
Once you have a token, use it to authenticate with PyIceberg:
from pyiceberg.catalog import load_catalog
catalog = load_catalog(
"my_catalog",
**{
"uri": "http://localhost:8080/v1/my_catalog",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
)
# Now you can use the catalog
table = catalog.load_table("my_namespace.my_table")
df = table.scan().to_arrow()- Store tokens securely: Never commit tokens to version control
- Use environment variables: Store tokens in environment variables or secure vaults
- Set appropriate expiration: Use shorter expiration times for sensitive environments
- Rotate tokens regularly: Generate new tokens periodically
- Revoke unused tokens: Use the token revocation API to revoke tokens you no longer need
Tokens can be revoked using the API:
# Self-revoke (revoke your own token)
curl -X POST http://localhost:8080/api/v1/tokens/revoke/self \
-H "Authorization: Bearer <TOKEN>"
# Admin revoke (revoke another user's token)
curl -X POST http://localhost:8080/api/v1/tokens/revoke/<JTI> \
-H "Authorization: Bearer <ADMIN_TOKEN>"Generate a token for your CI/CD pipeline to automate data operations:
# In your CI/CD setup script
TOKEN=$(pangolin-user get-token --description "GitHub Actions" --expires-in 365)
echo "PANGOLIN_TOKEN=$TOKEN" >> $GITHUB_ENVGenerate a token for Jupyter notebooks:
pangolin-user get-token --description "Jupyter notebook" --expires-in 30Generate tokens for cron jobs or scheduled tasks:
pangolin-user get-token --description "Daily ETL job" --expires-in 180