Share Stats about OIDC use
This commit is contained in:
parent
d2e1ca9078
commit
b6bfc65bc4
4 changed files with 15 additions and 2 deletions
|
|
@ -131,6 +131,10 @@ public sealed record ServerInfoV3Dto
|
|||
/// Is this server using Kavita+
|
||||
/// </summary>
|
||||
public bool ActiveKavitaPlusSubscription { get; set; }
|
||||
/// <summary>
|
||||
/// Is OIDC enabled
|
||||
/// </summary>
|
||||
public bool OidcEnabled { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Users
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using API.Data.Misc;
|
||||
using API.Entities.Enums;
|
||||
using API.Entities.Enums.Device;
|
||||
|
||||
namespace API.DTOs.Stats.V3;
|
||||
|
|
@ -76,6 +77,10 @@ public sealed record UserStatV3
|
|||
/// Roles for this user
|
||||
/// </summary>
|
||||
public ICollection<string> Roles { get; set; }
|
||||
/// <summary>
|
||||
/// Who manages the user (OIDC, Kavita)
|
||||
/// </summary>
|
||||
public AppUserOwner Owner { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,8 +96,9 @@ public class AppUser : IdentityUser<int>, IHasConcurrencyToken
|
|||
/// </summary>
|
||||
public string? ExternalId { get; set; }
|
||||
/// <summary>
|
||||
/// Describes how the account was created
|
||||
/// Describes who manages the account (may further depend on other settings)
|
||||
/// </summary>
|
||||
/// <remarks>Always fallbacks to native</remarks>
|
||||
public AppUserOwner Owner { get; set; } = AppUserOwner.Native;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -248,7 +248,8 @@ public class StatsService : IStatsService
|
|||
DotnetVersion = Environment.Version.ToString(),
|
||||
OpdsEnabled = serverSettings.EnableOpds,
|
||||
EncodeMediaAs = serverSettings.EncodeMediaAs,
|
||||
MatchedMetadataEnabled = mediaSettings.Enabled
|
||||
MatchedMetadataEnabled = mediaSettings.Enabled,
|
||||
OidcEnabled = !string.IsNullOrEmpty(serverSettings.OidcConfig.Authority),
|
||||
};
|
||||
|
||||
dto.OsLocale = CultureInfo.CurrentCulture.EnglishName;
|
||||
|
|
@ -353,7 +354,9 @@ public class StatsService : IStatsService
|
|||
userDto.DevicePlatforms = user.Devices.Select(d => d.Platform).ToList();
|
||||
userDto.SeriesBookmarksCreatedCount = user.Bookmarks.Count;
|
||||
userDto.SmartFilterCreatedCount = user.SmartFilters.Count;
|
||||
userDto.IsSharingReviews = user.UserPreferences.ShareReviews;
|
||||
userDto.WantToReadSeriesCount = user.WantToRead.Count;
|
||||
userDto.Owner = user.Owner;
|
||||
|
||||
if (allLibraries.Count > 0 && userLibraryAccess.TryGetValue(user.Id, out var accessibleLibraries))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue