1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# SQL-CLI Configuration File
# Copy this file to:
# ~/.config/sql-cli/config.toml (Linux/Mac)
# %APPDATA%\sql-cli\config.toml (Windows)
[]
# Enable Redis cache (can be overridden by SQL_CLI_CACHE env var)
= false
# Redis connection URL (can be overridden by SQL_CLI_REDIS_URL env var)
= "redis://127.0.0.1:6379"
# Default cache duration in seconds when CACHE is specified without a value
# or when no CACHE directive is present in the query
= 600 # 10 minutes
# Cache duration rules based on URL patterns
# Pattern matching uses simple glob syntax (* for wildcards)
# These override the default_duration for matching URLs
[]
# Production APIs - cache for 1 hour
= 3600
= 3600
= 3600
# Staging/UAT - cache for 5 minutes
= 300
= 300
# Historical data endpoints - cache for 24 hours
= 86400
= 86400
= 43200 # Yesterday's trades - 12 hours
# Real-time/volatile data - short cache
= 60
= 30
= 120
# Specific endpoints
= 7200 # 2 hours for Barclays trades
= 1800 # 30 minutes for JPM FX
[]
# Default timeout for web requests in seconds
= 30
# Maximum response size in MB
= 100
# ============================================================================
# TOKEN MANAGEMENT
# ============================================================================
[]
# Auto-refresh tokens before they expire
= false
# Default token lifetime in seconds (1 hour)
= 3600
# Token definitions with refresh commands
# Each token variable (e.g., ${JWT_TOKEN}) needs a command that outputs the token
[]
= "UAT environment JWT token"
# Command that outputs token to stdout
= "~/.config/sql-cli/get_uat_token.sh"
= 3600 # 1 hour
[]
= "Production environment JWT token"
= "~/.config/sql-cli/get_prod_token.sh"
= 7200 # 2 hours
# More examples:
# Azure CLI token
# [tokens.tokens.AZURE_TOKEN]
# description = "Azure access token"
# refresh_command = "az account get-access-token --resource https://api.example.com --query accessToken -o tsv"
# lifetime = 3600
# OAuth2 client credentials flow
# [tokens.tokens.OAUTH_TOKEN]
# description = "OAuth2 bearer token"
# refresh_command = "curl -s -X POST https://auth.example.com/oauth/token -d 'client_id=xxx&client_secret=yyy&grant_type=client_credentials' | jq -r .access_token"
# lifetime = 3600
# Custom script that handles all auth logic
# [tokens.tokens.CUSTOM_TOKEN]
# description = "Custom auth token"
# refresh_command = "/opt/bin/get-auth-token --env=prod --format=raw"
# lifetime = 1800