rama creada apartir de master en j

This commit is contained in:
jrojas
2026-06-26 10:29:23 +02:00
parent 319fd3dfb0
commit c1517fda87
2810 changed files with 1927392 additions and 25392 deletions
@@ -2,6 +2,9 @@ using adas_core.Domain.Models.MongoModels;
namespace adas_core.Domain.Models.AppSettings;
/// <summary>
/// Represents a set of configuration settings used to control authentication behavior.
/// </summary>
public class AuthSettings
{
public JwtConfig? JwtConfig { get; set; }
@@ -9,6 +12,12 @@ public class AuthSettings
public List<string> LoginMethods { get; set; } = [];
}
/// <summary>
/// Represents a JWT configuration class that extends <see cref="JwtExtConfig"/>, providing additional or specialized settings for JSON Web Token processing.
/// </summary>
/// <remarks>
/// This class derives from <see cref="JwtExtConfig"/> and inherits its configuration properties, allowing it to serve as a more specific or customized JWT configuration type.
/// </remarks>
public class JwtConfig : JwtExtConfig
{
public string? Issuer { get; set; }
@@ -20,6 +29,9 @@ public class JwtConfig : JwtExtConfig
public Dictionary<string, JwtExtConfig>? ExternalProviders { get; set; } = null;
}
/// <summary>
/// Represents a configuration class for JWT (JSON Web Token) extension settings.
/// </summary>
public class JwtExtConfig
{
public string? Key { get; set; }
@@ -27,20 +39,48 @@ public class JwtExtConfig
public bool ValidateAudience { get; set; } = true;
}
/// <summary>
/// Represents a configuration collection that defines a whitelist of users, stored as a list of string identifiers.
/// </summary>
/// <remarks>
/// Inherits from a generic list of strings, exposing standard collection semantics for the whitelisted user entries.
/// </remarks>
public class UsersWhiteListConfig : List<string>
{
/// <summary>
/// Determines whether the collection contains a username matching the specified user's username, using a case-insensitive comparison.
/// </summary>
/// <param name="user">The user whose username will be checked against the collection.</param>
/// <returns><c>true</c> if a matching username is found; otherwise, <c>false</c>.</returns>
public bool IsValid(User user)
{
return this.Any(username => username.ToLowerInvariant().Equals(user.UserName.ToLowerInvariant()));
}
{
return this.Any(username => username.ToLowerInvariant().Equals(user.UserName.ToLowerInvariant()));
}
}
/// <summary>
/// Represents a configuration collection of <see cref="ValidGroup"/> instances, exposing them as a strongly-typed list.
/// </summary>
/// <remarks>
/// This type inherits from <see cref="List{T}"/> where T is <see cref="ValidGroup"/>, providing standard list operations for managing the configured valid groups.
/// </remarks>
/// <summary>
/// Represents a validation group used to organize or aggregate related validation rules.
/// </summary>
/// <remarks>
/// This type serves as a container or marker for grouping validation logic within a broader validation framework.
/// </remarks>
public class ValidGroupsConfig : List<ValidGroup>
{
/// <summary>
/// Determines whether the specified user is considered valid by checking that it is not null.
/// </summary>
/// <param name="user">The user instance to validate.</param>
/// <returns><see langword="true"/> if <paramref name="user"/> is not null; otherwise, <see langword="false"/>.</returns>
public bool IsValid(User? user)
{
return user != null;
}
{
return user != null;
}
}
public class ValidGroup