mirror of
https://github.com/pocket-id/pocket-id.git
synced 2025-12-09 22:52:58 +03:00
[PR #724] [MERGED] fix: ensure user inputs are normalized #655
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/724
Author: @ItalyPaleAle
Created: 7/6/2025
Status: ✅ Merged
Merged: 7/13/2025
Merged by: @kmendell
Base:
main← Head:unorm📝 Commits (9)
658f76afix: ensure user inputs are normalizedb9e9923Fix unit testse41b7a3Merge branch 'main' into unorm5f12952Merge branch 'main' of https://github.com/pocket-id/pocket-id into unorm623f316Merge branch 'main' into unorm6de09b7Use a custom ShouldBindWithNormalizedJSON methodc11a3efMerge branch 'main' of https://github.com/pocket-id/pocket-id into unorm79e6260Missing these files1e1b2c2Merge branch 'main' into unorm📊 Changes
23 files changed (+350 additions, -58 deletions)
View changed files
📝
backend/go.mod(+7 -7)📝
backend/go.sum(+16 -16)📝
backend/internal/bootstrap/db_bootstrap.go(+2 -0)📝
backend/internal/controller/api_key_controller.go(+1 -1)📝
backend/internal/controller/app_config_controller.go(+1 -1)📝
backend/internal/controller/custom_claim_controller.go(+2 -2)📝
backend/internal/controller/user_controller.go(+5 -5)📝
backend/internal/controller/user_group_controller.go(+2 -2)📝
backend/internal/dto/api_key_dto.go(+2 -2)📝
backend/internal/dto/app_config_dto.go(+1 -1)📝
backend/internal/dto/custom_claim_dto.go(+2 -2)➕
backend/internal/dto/dto_normalize.go(+94 -0)➕
backend/internal/dto/dto_normalize_test.go(+84 -0)📝
backend/internal/dto/oidc_dto.go(+1 -1)📝
backend/internal/dto/user_dto.go(+12 -10)📝
backend/internal/dto/user_group_dto.go(+2 -2)📝
backend/internal/service/ldap_service.go(+8 -6)➕
backend/internal/utils/sqlite/sqlite_util.go(+51 -0)📝
backend/internal/utils/testing/database.go(+5 -0)➕
backend/resources/migrations/postgres/20250705000000_normalize.down.sql(+1 -0)...and 3 more files
📄 Description
User inputs such as names can contain UTF-8 sequences, and they may not be in a normalized form, so they may not show up as identical when they should be.
This PR makes sure that all strings that are not identifiers (like UUIDs) are normalized before being stored in the database.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.