diff options
| author | Davide Polonio <poloniodavide@gmail.com> | 2020-03-01 21:38:34 +0100 |
|---|---|---|
| committer | Davide Polonio <poloniodavide@gmail.com> | 2020-03-01 21:46:01 +0100 |
| commit | 5d760b7ee806d3fb00ac5aa7d0981362526f1d11 (patch) | |
| tree | 9ca14af31618c2aebeb10b371f7fb52865cf09f1 /MediaBrowser.Controller/Library/IUserManager.cs | |
| parent | 03a294a706d2610e263fa2621e50b2da0f27f34f (diff) | |
Fix emby/user/public API leaking private data
This commit fixes the emby/user/public API that was returning more data
than necessary. Now only the following information are returned:
- the account name
- the primary image tag
- the field hasPassword
- the field hasConfiguredPassword, useful for the first wizard only
(see
https://github.com/jellyfin/jellyfin/issues/880#issuecomment-465370051)
- the primary image aspect ratio
A new DTO class, PrivateUserDTO has been created, and the route has been
modified in order to return that data object.
Diffstat (limited to 'MediaBrowser.Controller/Library/IUserManager.cs')
| -rw-r--r-- | MediaBrowser.Controller/Library/IUserManager.cs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/MediaBrowser.Controller/Library/IUserManager.cs b/MediaBrowser.Controller/Library/IUserManager.cs index be7b4ce59..ec6cb35eb 100644 --- a/MediaBrowser.Controller/Library/IUserManager.cs +++ b/MediaBrowser.Controller/Library/IUserManager.cs @@ -144,6 +144,14 @@ namespace MediaBrowser.Controller.Library UserDto GetUserDto(User user, string remoteEndPoint = null); /// <summary> + /// Gets the user public dto. + /// </summary> + /// <param name="user">Ther user.</param>\ + /// <param name="remoteEndPoint">The remote end point.</param> + /// <returns>A public UserDto, aka a UserDto stripped of personal data.</returns> + PublicUserDto GetPublicUserDto(User user, string remoteEndPoint = null); + + /// <summary> /// Authenticates the user. /// </summary> Task<User> AuthenticateUser(string username, string password, string passwordSha1, string remoteEndPoint, bool isUserSession); |
