veza/veza-backend-api/internal/models
senke 3cfefaa24c [BE-SEC-012] be-sec: Implement API key authentication for webhooks
- Added APIKey field to Webhook model with unique index
- Implemented GenerateAPIKey() method using crypto/rand for secure key generation
- Implemented ValidateAPIKey() method to authenticate webhook requests
- Implemented RegenerateAPIKey() method to rotate API keys
- Created WebhookAPIKeyMiddleware for validating API keys in requests
- Middleware supports X-API-Key header and Authorization: Bearer format
- Added endpoint POST /api/v1/webhooks/:id/regenerate-key
- API keys are prefixed with 'whk_' for identification
- Comprehensive unit tests for all API key functionality
- Inactive webhooks cannot authenticate with their API keys

Phase: PHASE-4
Priority: P2
Progress: 119/267 (44.57%)
2025-12-24 18:03:52 +01:00
..
admin.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
bitrate_adaptation.go [BE-DB-004] be-db: Add created_at and updated_at timestamps to all models 2025-12-24 15:08:43 +01:00
bitrate_adaptation_test.go report generation and future tasks selection 2025-12-08 19:57:54 +01:00
chat_message.go report generation and future tasks selection 2025-12-08 19:57:54 +01:00
contest.go STABILISATION: phase 3–5 – API contract, tests & chat-server hardening 2025-12-06 17:21:59 +01:00
custom_claims.go STABILISATION: phase 3–5 – API contract, tests & chat-server hardening 2025-12-06 17:21:59 +01:00
federated_identity.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
hardware.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
hls_stream.go STABILISATION: phase 3–5 – API contract, tests & chat-server hardening 2025-12-06 17:21:59 +01:00
hls_stream_test.go STABILISATION: phase 3–5 – API contract, tests & chat-server hardening 2025-12-06 17:21:59 +01:00
hls_transcode_queue.go [BE-DB-004] be-db: Add created_at and updated_at timestamps to all models 2025-12-24 15:08:43 +01:00
hls_transcode_queue_test.go STABILISATION: phase 3–5 – API contract, tests & chat-server hardening 2025-12-06 17:21:59 +01:00
message.go stabilizing veza-backend-api: phase 1 2025-12-16 11:23:49 -05:00
mfa_config.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
notification.go [BE-SVC-009] be-svc: Implement notification service 2025-12-24 16:41:11 +01:00
playback_analytics.go [BE-DB-004] be-db: Add created_at and updated_at timestamps to all models 2025-12-24 15:08:43 +01:00
playback_analytics_test.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
playlist.go report generation and future tasks selection 2025-12-08 19:57:54 +01:00
playlist_collaborator.go STABILISATION: phase 3–5 – API contract, tests & chat-server hardening 2025-12-06 17:21:59 +01:00
playlist_collaborator_test.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
playlist_follow.go STABILISATION: phase 3–5 – API contract, tests & chat-server hardening 2025-12-06 17:21:59 +01:00
playlist_share_link.go STABILISATION: phase 3–5 – API contract, tests & chat-server hardening 2025-12-06 17:21:59 +01:00
playlist_test.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
playlist_version.go [BE-DB-004] be-db: Add created_at and updated_at timestamps to all models 2025-12-24 15:08:43 +01:00
recovery_code.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
refresh_token.go [BE-DB-004] be-db: Add created_at and updated_at timestamps to all models 2025-12-24 15:08:43 +01:00
requests.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
responses.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
role.go report generation and future tasks selection 2025-12-08 19:57:54 +01:00
role_test.go report generation and future tasks selection 2025-12-08 19:57:54 +01:00
room.go stabilizing veza-backend-api: phase 1 2025-12-16 11:23:49 -05:00
royalty.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
session.go stabilizing veza-backend-api: phase 1 2025-12-16 11:23:49 -05:00
track.go stabilizing veza-backend-api: phase 1 2025-12-16 11:23:49 -05:00
track_comment.go STABILISATION: phase 3–5 – API contract, tests & chat-server hardening 2025-12-06 17:21:59 +01:00
track_comment_test.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
track_history.go [BE-DB-004] be-db: Add created_at and updated_at timestamps to all models 2025-12-24 15:08:43 +01:00
track_history_test.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
track_like.go [BE-DB-004] be-db: Add created_at and updated_at timestamps to all models 2025-12-24 15:08:43 +01:00
track_like_test.go report generation and future tasks selection 2025-12-08 19:57:54 +01:00
track_play.go STABILISATION: phase 3–5 – API contract, tests & chat-server hardening 2025-12-06 17:21:59 +01:00
track_play_test.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
track_share.go STABILISATION: phase 3–5 – API contract, tests & chat-server hardening 2025-12-06 17:21:59 +01:00
track_share_test.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
track_status.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
track_version.go report generation and future tasks selection 2025-12-08 19:57:54 +01:00
track_version_test.go report generation and future tasks selection 2025-12-08 19:57:54 +01:00
user.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
user_settings.go adding initial backend API (Go) 2025-12-03 20:29:37 +01:00
webhook.go [BE-SEC-012] be-sec: Implement API key authentication for webhooks 2025-12-24 18:03:52 +01:00