Files
accounted/supabase/migrations/20260721115701_suppress_api_key_usage_audit_noise.sql
T
Mattsson e11f70b347 Bug/gh issues fiz (#1103)
* refactor: optimize page loading and data fetching

* fix: resolve recurring production runtime errors

* feat: add MCP company and customer updates

* fix: handle year-end tax adjustments

* feat: harden annual report compliance

* fix: expand invoice logo and font support

* fix: sanitize API route error responses

* fix: sanitize user-facing error messages

* feat: persist onboarding and tax assessment notices

* fix: reduce cloud backup audit churn

* feat: refine invoice editor layout

* fix: show saved tax adjustments in INK2

* fix: complete annual report API mappings

* docs: record operational safeguards and decisions

* fix: harden annual report review findings

* fix: adjust column span for description based on VAT registration

* New css class name
2026-07-21 23:00:15 +02:00

35 lines
1.1 KiB
SQL

-- Keep API-key security and configuration changes in behandlingshistorik, but
-- do not create a full audit row for every authenticated API or MCP request.
-- validate_and_increment_api_key updates only these four telemetry columns.
DROP TRIGGER IF EXISTS audit_api_keys_update ON public.api_keys;
DROP TRIGGER IF EXISTS audit_api_keys ON public.api_keys;
-- Preserve the historical trigger name for account-deletion routines that
-- temporarily disable audit_api_keys while removing a user.
CREATE TRIGGER audit_api_keys
AFTER INSERT OR DELETE ON public.api_keys
FOR EACH ROW EXECUTE FUNCTION public.write_audit_log();
CREATE TRIGGER audit_api_keys_update
AFTER UPDATE ON public.api_keys
FOR EACH ROW
WHEN (
(to_jsonb(OLD) - ARRAY[
'request_count',
'rate_limit_window_start',
'last_used_at',
'updated_at'
]::text[])
IS DISTINCT FROM
(to_jsonb(NEW) - ARRAY[
'request_count',
'rate_limit_window_start',
'last_used_at',
'updated_at'
]::text[])
)
EXECUTE FUNCTION public.write_audit_log();
NOTIFY pgrst, 'reload schema';