v2.0.3: Webhook user identification by URL token
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 42s
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 42s
- Added webhook_token to telegram_integrations
- Webhooks now identify users by token in URL (/webhook/telegram/{token}, /webhook/todoist/{token})
- Webhook automatically configured for all users on backend startup
- Migration 011: Add webhook_token column
This commit is contained in:
17
play-life-backend/migrations/011_add_webhook_tokens.sql
Normal file
17
play-life-backend/migrations/011_add_webhook_tokens.sql
Normal file
@@ -0,0 +1,17 @@
|
||||
-- Migration: Add webhook_token to telegram_integrations
|
||||
-- This allows identifying user by webhook URL token
|
||||
|
||||
-- Add webhook_token column to telegram_integrations
|
||||
ALTER TABLE telegram_integrations
|
||||
ADD COLUMN IF NOT EXISTS webhook_token VARCHAR(255);
|
||||
|
||||
-- Create unique index on webhook_token for fast lookups
|
||||
CREATE UNIQUE INDEX IF NOT EXISTS idx_telegram_integrations_webhook_token
|
||||
ON telegram_integrations(webhook_token)
|
||||
WHERE webhook_token IS NOT NULL;
|
||||
|
||||
-- Generate webhook tokens for existing integrations
|
||||
-- This will be handled by application code, but we ensure the column exists
|
||||
|
||||
COMMENT ON COLUMN telegram_integrations.webhook_token IS 'Unique token for webhook URL identification (e.g., /webhook/telegram/{token})';
|
||||
|
||||
Reference in New Issue
Block a user