mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-16 05:43:54 +03:00
[PR #5255] [MERGED] Validate the new username when renaming #10449
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/jellyfin/jellyfin/pull/5255
Author: @cvium
Created: 2/17/2021
Status: ✅ Merged
Merged: 2/18/2021
Merged by: @Bond-009
Base:
master← Head:fix_renameuser📝 Commits (2)
442e770Validate the new username when renaming2112d2aRestructure tests📊 Changes
4 files changed (+65 additions, -9 deletions)
View changed files
➕
Jellyfin.Server.Implementations/Properties/AssemblyInfo.cs(+23 -0)📝
Jellyfin.Server.Implementations/Users/UserManager.cs(+13 -9)📝
tests/Jellyfin.Server.Implementations.Tests/Jellyfin.Server.Implementations.Tests.csproj(+1 -0)➕
tests/Jellyfin.Server.Implementations.Tests/Users/UserManagerTests.cs(+28 -0)📄 Description
Changes
Copied AssemblyInfo.cs from Emby.Server.Implementations in order to use
InternalsVisibleTo.Made a new function that throws if the username is invalid. This is used when creating a new user and when renaming an existing user.
I wanted to create an additional test to verify that creation and renaming actually calls the function but it proved to be very annoying to do... so I didn't.
Issues
Fixes #5245
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.