-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsql-cli.example.toml
More file actions
93 lines (74 loc) · 2.84 KB
/
sql-cli.example.toml
File metadata and controls
93 lines (74 loc) · 2.84 KB
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)
[redis_cache]
# Enable Redis cache (can be overridden by SQL_CLI_CACHE env var)
enabled = false
# Redis connection URL (can be overridden by SQL_CLI_REDIS_URL env var)
redis_url = "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
default_duration = 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
[redis_cache.duration_rules]
# Production APIs - cache for 1 hour
"*.bloomberg.com/*" = 3600
"*prod*" = 3600
"*production*" = 3600
# Staging/UAT - cache for 5 minutes
"*staging*" = 300
"*uat*" = 300
# Historical data endpoints - cache for 24 hours
"*/historical/*" = 86400
"*/archive/*" = 86400
"*/trades/20*" = 43200 # Yesterday's trades - 12 hours
# Real-time/volatile data - short cache
"*/realtime/*" = 60
"*/live/*" = 30
"*/prices/*" = 120
# Specific endpoints
"api.barclays.com/trades" = 7200 # 2 hours for Barclays trades
"api.jpmorgan.com/fx" = 1800 # 30 minutes for JPM FX
[web]
# Default timeout for web requests in seconds
timeout = 30
# Maximum response size in MB
max_response_size = 100
# ============================================================================
# TOKEN MANAGEMENT
# ============================================================================
[tokens]
# Auto-refresh tokens before they expire
auto_refresh = false
# Default token lifetime in seconds (1 hour)
default_lifetime = 3600
# Token definitions with refresh commands
# Each token variable (e.g., ${JWT_TOKEN}) needs a command that outputs the token
[tokens.tokens.JWT_TOKEN]
description = "UAT environment JWT token"
# Command that outputs token to stdout
refresh_command = "~/.config/sql-cli/get_uat_token.sh"
lifetime = 3600 # 1 hour
[tokens.tokens.JWT_TOKEN_PROD]
description = "Production environment JWT token"
refresh_command = "~/.config/sql-cli/get_prod_token.sh"
lifetime = 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