feat: add a return of the data that has been configured
This commit is contained in:
@ -1,16 +1,17 @@
|
||||
using Mirea.Api.Dto.Common;
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Mirea.Api.Dto.Responses;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the response containing information about available OAuth providers.
|
||||
/// </summary>
|
||||
public class AvailableProvidersResponse
|
||||
public class AvailableOAuthProvidersResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the OAuth provider.
|
||||
/// </summary>
|
||||
[Required]
|
||||
public required string ProviderName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
@ -19,7 +20,8 @@ public class AvailableProvidersResponse
|
||||
public OAuthProvider Provider { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the redirect URI for the OAuth provider.
|
||||
/// Gets or sets the redirect URL for the OAuth provider's authorization process.
|
||||
/// </summary>
|
||||
public required Uri Redirect { get; set; }
|
||||
[Required]
|
||||
public required string Redirect { get; set; }
|
||||
}
|
29
ApiDto/Responses/Configuration/CacheResponse.cs
Normal file
29
ApiDto/Responses/Configuration/CacheResponse.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using Mirea.Api.Dto.Common;
|
||||
|
||||
namespace Mirea.Api.Dto.Responses.Configuration;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a response containing cache configuration details.
|
||||
/// </summary>
|
||||
public class CacheResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the type of cache database.
|
||||
/// </summary>
|
||||
public CacheType Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the server address.
|
||||
/// </summary>
|
||||
public string? Server { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the port number.
|
||||
/// </summary>
|
||||
public int Port { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the password.
|
||||
/// </summary>
|
||||
public string? Password { get; set; }
|
||||
}
|
49
ApiDto/Responses/Configuration/DatabaseResponse.cs
Normal file
49
ApiDto/Responses/Configuration/DatabaseResponse.cs
Normal file
@ -0,0 +1,49 @@
|
||||
using Mirea.Api.Dto.Common;
|
||||
|
||||
namespace Mirea.Api.Dto.Responses.Configuration;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a response containing database configuration details.
|
||||
/// </summary>
|
||||
public class DatabaseResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the type of database.
|
||||
/// </summary>
|
||||
public DatabaseType Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the server address.
|
||||
/// </summary>
|
||||
public string? Server { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the port number.
|
||||
/// </summary>
|
||||
public int Port { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the database name.
|
||||
/// </summary>
|
||||
public string? Database { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the username.
|
||||
/// </summary>
|
||||
public string? User { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether SSL is enabled.
|
||||
/// </summary>
|
||||
public bool Ssl { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the password.
|
||||
/// </summary>
|
||||
public string? Password { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the path to database. Only for Sqlite
|
||||
/// </summary>
|
||||
public string? PathToDatabase { get; set; }
|
||||
}
|
17
ApiDto/Responses/TotpKeyResponse.cs
Normal file
17
ApiDto/Responses/TotpKeyResponse.cs
Normal file
@ -0,0 +1,17 @@
|
||||
namespace Mirea.Api.Dto.Responses;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the response containing the TOTP (Time-Based One-Time Password) key details.
|
||||
/// </summary>
|
||||
public class TotpKeyResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the secret key used for TOTP generation.
|
||||
/// </summary>
|
||||
public required string Secret { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the image (QR code) representing the TOTP key.
|
||||
/// </summary>
|
||||
public required string Image { get; set; }
|
||||
}
|
35
ApiDto/Responses/UserResponse.cs
Normal file
35
ApiDto/Responses/UserResponse.cs
Normal file
@ -0,0 +1,35 @@
|
||||
using Mirea.Api.Dto.Common;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Mirea.Api.Dto.Responses;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a response containing user information.
|
||||
/// </summary>
|
||||
public class UserResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the email address of the user.
|
||||
/// </summary>
|
||||
[Required]
|
||||
public required string Email { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the username of the user.
|
||||
/// </summary>
|
||||
[Required]
|
||||
public required string Username { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the user has two-factor authentication enabled.
|
||||
/// </summary>
|
||||
[Required]
|
||||
public bool TwoFactorAuthenticatorEnabled { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a collection of OAuth providers used by the user.
|
||||
/// </summary>
|
||||
[Required]
|
||||
public required IEnumerable<OAuthProvider> UsedOAuthProviders { get; set; }
|
||||
}
|
Reference in New Issue
Block a user