fix(backend): make API types internal
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
namespace Socialize.Api.Infrastructure.BlobStorage.Configuration;
|
||||
|
||||
public sealed class LocalBlobStorageOptions
|
||||
internal sealed class LocalBlobStorageOptions
|
||||
{
|
||||
public const string SectionName = "LocalBlobStorage";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace Socialize.Api.Infrastructure.BlobStorage.Contracts;
|
||||
|
||||
public static class CommonFileNames
|
||||
internal static class CommonFileNames
|
||||
{
|
||||
public const string ProfilePicture = "profilePicture";
|
||||
public const string LogoPicture = "logoPicture";
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Socialize.Api.Infrastructure.BlobStorage.Contracts;
|
||||
|
||||
public static class ContentTypes
|
||||
internal static class ContentTypes
|
||||
{
|
||||
private const string ImagePng = "image/png";
|
||||
private const string ImageJpeg = "image/jpeg";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace Socialize.Api.Infrastructure.BlobStorage.Contracts;
|
||||
|
||||
public interface IBlobStorage
|
||||
internal interface IBlobStorage
|
||||
{
|
||||
/// <summary>
|
||||
/// Upload a file to blob storage.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace Socialize.Api.Infrastructure.BlobStorage.Contracts;
|
||||
|
||||
public static class SubDirectoryNames
|
||||
internal static class SubDirectoryNames
|
||||
{
|
||||
public const string Profile = "profile";
|
||||
public const string Contents = "contents";
|
||||
|
||||
@@ -4,7 +4,7 @@ using Socialize.Api.Infrastructure.BlobStorage.Contracts;
|
||||
|
||||
namespace Socialize.Api.Infrastructure.BlobStorage.Services;
|
||||
|
||||
public sealed class LocalBlobStorage(
|
||||
internal sealed class LocalBlobStorage(
|
||||
IWebHostEnvironment environment,
|
||||
IHttpContextAccessor httpContextAccessor,
|
||||
IOptions<LocalBlobStorageOptions> options,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace Socialize.Api.Infrastructure.Configuration;
|
||||
|
||||
public class WebsiteOptions
|
||||
internal class WebsiteOptions
|
||||
{
|
||||
public const string SectionName = "Website";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace Socialize.Api.Infrastructure.Emailer.Configuration;
|
||||
|
||||
public class EmailerOptions
|
||||
internal class EmailerOptions
|
||||
{
|
||||
public const string ConfigurationSection = "Emailer";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace Socialize.Api.Infrastructure.Emailer.Contracts;
|
||||
|
||||
public interface IEmailSender
|
||||
internal interface IEmailSender
|
||||
{
|
||||
Task SendEmailAsync(string email, string subject, string message);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ using Socialize.Api.Infrastructure.Emailer.Contracts;
|
||||
|
||||
namespace Socialize.Api.Infrastructure.Emailer.Services;
|
||||
|
||||
public class LoggerEmailSender(ILogger<IEmailSender> logger)
|
||||
internal class LoggerEmailSender(ILogger<IEmailSender> logger)
|
||||
: IEmailSender
|
||||
{
|
||||
public Task SendEmailAsync(string email, string subject, string message)
|
||||
|
||||
@@ -5,7 +5,7 @@ using PostmarkDotNet;
|
||||
|
||||
namespace Socialize.Api.Infrastructure.Emailer.Services;
|
||||
|
||||
public class PostmarkEmailSender : IEmailSender
|
||||
internal class PostmarkEmailSender : IEmailSender
|
||||
{
|
||||
private readonly PostmarkClient _client;
|
||||
private readonly EmailerOptions _options;
|
||||
|
||||
@@ -7,7 +7,7 @@ using Microsoft.Extensions.Options;
|
||||
|
||||
namespace Socialize.Api.Infrastructure.Emailer.Services;
|
||||
|
||||
public class ResendEmailSender : IEmailSender
|
||||
internal class ResendEmailSender : IEmailSender
|
||||
{
|
||||
private static readonly Uri EndpointUri = new("https://api.resend.com/emails");
|
||||
private readonly HttpClient _httpClient;
|
||||
|
||||
@@ -9,7 +9,7 @@ using Socialize.Api.Infrastructure.Payments.Stripe.Configuration;
|
||||
|
||||
namespace Socialize.Api.Infrastructure;
|
||||
|
||||
public static class InfrastructureRegistration
|
||||
internal static class InfrastructureRegistration
|
||||
{
|
||||
public static WebApplicationBuilder AddInfrastructureModule(
|
||||
this WebApplicationBuilder builder)
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Socialize.Api.Infrastructure.Payments.Stripe.Configuration;
|
||||
|
||||
public class StripeOptions
|
||||
internal class StripeOptions
|
||||
{
|
||||
public const string ConfigurationSection = "Stripe";
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using Socialize.Api.Modules.Organizations.Services;
|
||||
|
||||
namespace Socialize.Api.Infrastructure.Security;
|
||||
|
||||
public sealed class AccessScopeService(
|
||||
internal sealed class AccessScopeService(
|
||||
OrganizationAccessService organizationAccessService)
|
||||
{
|
||||
public bool IsManager(ClaimsPrincipal user)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Socialize.Api.Infrastructure.Security;
|
||||
|
||||
public static class ClaimsPrincipalExtensions
|
||||
internal static class ClaimsPrincipalExtensions
|
||||
{
|
||||
public static IReadOnlyCollection<Guid> GetScopeIds(this ClaimsPrincipal claims, string key)
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@ using Microsoft.IdentityModel.Tokens;
|
||||
|
||||
namespace Socialize.Api.Infrastructure.Security;
|
||||
|
||||
public static class JwtTokenHelper
|
||||
internal static class JwtTokenHelper
|
||||
{
|
||||
public static string GenerateJwtToken(
|
||||
TimeSpan expiresIn,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace Socialize.Api.Infrastructure.Security;
|
||||
|
||||
public static class KnownClaims
|
||||
internal static class KnownClaims
|
||||
{
|
||||
public const string Alias = "alias";
|
||||
public const string PortraitUrl = "portraitUrl";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
namespace Socialize.Api.Infrastructure.Security;
|
||||
|
||||
public class MissingClaimException(
|
||||
internal class MissingClaimException(
|
||||
string claimName)
|
||||
: Exception($"Claim '{claimName}' is missing.");
|
||||
|
||||
@@ -4,7 +4,7 @@ using System.Text;
|
||||
namespace Socialize.Api.Infrastructure.Security;
|
||||
|
||||
// If we need to add special characters we can alternate between 2 pools.
|
||||
public static class PasswordGenerator
|
||||
internal static class PasswordGenerator
|
||||
{
|
||||
private const string LowerLetters = "abcdefghijklmnopqrstuvwxyz";
|
||||
private const string UpperLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Security.Cryptography;
|
||||
|
||||
namespace Socialize.Api.Infrastructure.Security;
|
||||
|
||||
public static class RefreshTokenGenerator
|
||||
internal static class RefreshTokenGenerator
|
||||
{
|
||||
public static string Next()
|
||||
{
|
||||
|
||||
@@ -19,7 +19,7 @@ using Microsoft.AspNetCore.Identity;
|
||||
|
||||
namespace Socialize.Api.Infrastructure.TestData;
|
||||
|
||||
public static class TestDataSeedExtensions
|
||||
internal static class TestDataSeedExtensions
|
||||
{
|
||||
private static readonly Guid OrganizationId = Guid.Parse("99999999-9999-9999-9999-999999999999");
|
||||
private static readonly Guid WorkspaceId = Guid.Parse("11111111-1111-1111-1111-111111111111");
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Text.RegularExpressions;
|
||||
|
||||
namespace Socialize.Api.Infrastructure.YouTube;
|
||||
|
||||
public static class YouTubeUrlHelper
|
||||
internal static class YouTubeUrlHelper
|
||||
{
|
||||
private static readonly Regex VideoIdRegex = new(
|
||||
@"(?:youtube\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^""&?/\s]{11})",
|
||||
|
||||
Reference in New Issue
Block a user