mirror of
https://github.com/pocket-id/pocket-id.git
synced 2025-12-09 14:53:00 +03:00
[PR #695] [MERGED] fix: Auth fails when client IP is empty on Postgres #672
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/pocket-id/pocket-id/pull/695
Author: @ItalyPaleAle
Created: 6/29/2025
Status: ✅ Merged
Merged: 6/30/2025
Merged by: @stonith404
Base:
main← Head:fix-686📝 Commits (7)
db87516fix: Auth fails when client IP is empty on Postgresc0d2501Merge branch 'main' of https://github.com/pocket-id/pocket-id into fix-686796ad3cMerge branch 'main' of https://github.com/pocket-id/pocket-id into fix-68637dded5Changed per review feedback662e8a6Fixb09f7c2Use simpler types301bfd2Add missing indexes in Postgres📊 Changes
10 files changed (+122 additions, -51 deletions)
View changed files
📝
backend/internal/dto/audit_log_dto.go(+8 -9)📝
backend/internal/dto/validations.go(+6 -6)📝
backend/internal/model/audit_log.go(+1 -1)📝
backend/internal/service/audit_log_service.go(+18 -8)📝
backend/internal/service/geolite_service.go(+9 -5)📝
backend/internal/service/geolite_service_test.go(+11 -22)➕
backend/resources/migrations/postgres/20250628000000_audit_logs_ip_null.down.sql(+4 -0)➕
backend/resources/migrations/postgres/20250628000000_audit_logs_ip_null.up.sql(+5 -0)➕
backend/resources/migrations/sqlite/20250628000000_audit_logs_ip_null.down.sql(+30 -0)➕
backend/resources/migrations/sqlite/20250628000000_audit_logs_ip_null.up.sql(+30 -0)📄 Description
Fixes #686
Auth fails with Postgres when the client IP is empty, for example when proxies connect to Pocket ID via a Unix Domain Socket (UDS).
This was due to the fact that in Postgres we store IPs with the INET column type, which doesn't accept empty values.
The fix involves making the field nullabe.
Additionally, improved error handling throughout the process.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.