47fac22230
- .claude/CLAUDE.md - .claude/commands/subagentes.md - .claude/rules/INDEX.md - .mcp.json - bash/functions/cybersecurity/analyze_dns.md - bash/functions/cybersecurity/audit_http_headers.md - bash/functions/cybersecurity/audit_ssh_config.md - bash/functions/cybersecurity/check_firewall.md - bash/functions/cybersecurity/detect_suspicious_users.md - bash/functions/cybersecurity/encrypt_file.md - ... Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2.0 KiB
2.0 KiB
name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, params, output, tested, tests, test_file_path, file_path
| name | kind | lang | domain | version | purity | signature | description | tags | uses_functions | uses_types | returns | returns_optional | error_type | imports | params | output | tested | tests | test_file_path | file_path | |||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| metabase_auth | function | go | infra | 1.0.0 | impure | func MetabaseAuth(baseURL, email, password string) (MetabaseClient, error) | Autentica contra la API de Metabase con email y password. Retorna un MetabaseClient con session token valido por 14 dias (configurable con MAX_SESSION_AGE en Metabase). Endpoint: POST /api/session. |
|
|
|
false | error_go_core |
|
|
cliente MetabaseClient con session token valido por 14 dias | false | functions/infra/metabase_auth.go |
Ejemplo
// Autenticar con credenciales
client, err := MetabaseAuth("http://localhost:3000", "admin@example.com", "password123")
if err != nil {
log.Fatal(err)
}
// client.Token contiene el session token
// Alternativa: usar API key directamente
client := MetabaseNewClient("http://localhost:3000", "mb_api_key_xxxxx")
Notas
Dos formas de obtener un MetabaseClient:
MetabaseAuth: login con email/password, obtiene session token via POST /api/session. Token expira en 14 dias por defecto.MetabaseNewClient: usa una API key creada en el admin UI. No expira. Recomendado para automatizacion.
El token se envia como header X-Metabase-Session en todas las llamadas subsiguientes.
Para un LLM que use estas funciones
- Primero obtener un client con
MetabaseAuth()oMetabaseNewClient() - Pasar el client a todas las funciones CRUD (usuarios, cards, dashboards)
- Si recibes error 401, el token expiro — re-autenticar
- Rate limiting: Metabase limita intentos de login fallidos