diff --git a/API/Configuration/RecNetOptions.cs b/API/Configuration/RecNetOptions.cs index a05ecd8..71ab05b 100644 --- a/API/Configuration/RecNetOptions.cs +++ b/API/Configuration/RecNetOptions.cs @@ -1,6 +1,6 @@ -namespace API.Configurations; +namespace API.Configuration; public class RecNetOptions { - public bool UseForwardedHeaders { get; set; } = true; + public bool UseForwardedHeaders { get; set; } } \ No newline at end of file diff --git a/API/Controllers/Profiles/V1/ProfilesController.cs b/API/Controllers/Profiles/V1/ProfilesController.cs index ca5f46f..6d67427 100644 --- a/API/Controllers/Profiles/V1/ProfilesController.cs +++ b/API/Controllers/Profiles/V1/ProfilesController.cs @@ -34,12 +34,12 @@ public class ProfilesController(IProfileService profileService) : ControllerBase { var result = await profileService.LoginAsync( new LoginProfileCommand( + request.AppVersion, request.DeviceId, request.PlatformType, request.PlatformId, - request.PlatformAuthentication), - ct); - + request.PlatformAuthentication + ), ct); if (!result.Succeeded) return BadRequest(result.Message); diff --git a/API/Program.cs b/API/Program.cs index 37b7d5b..eb5f1b8 100644 --- a/API/Program.cs +++ b/API/Program.cs @@ -1,5 +1,5 @@ using System.Text; -using API.Configurations; +using API.Configuration; using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.HttpOverrides; using Microsoft.IdentityModel.Tokens; diff --git a/RecNet.Application/Common/Interfaces/ITokenService.cs b/RecNet.Application/Common/Interfaces/ITokenService.cs index b47859b..c2a3926 100644 --- a/RecNet.Application/Common/Interfaces/ITokenService.cs +++ b/RecNet.Application/Common/Interfaces/ITokenService.cs @@ -1,5 +1,5 @@ using RecNet.Application.Common.Tokens; -using RecNet.Domain.Entities.Profiles; +using RecNet.Domain.Profiles; namespace RecNet.Application.Common.Interfaces; diff --git a/RecNet.Application/Common/Mapping/ApplicationMappingProfile.cs b/RecNet.Application/Common/Mapping/ApplicationMappingProfile.cs index 046bcda..e5658dd 100644 --- a/RecNet.Application/Common/Mapping/ApplicationMappingProfile.cs +++ b/RecNet.Application/Common/Mapping/ApplicationMappingProfile.cs @@ -7,6 +7,6 @@ public class ApplicationMappingProfile : Profile { public ApplicationMappingProfile() { - CreateMap(); + CreateMap(); } } \ No newline at end of file diff --git a/RecNet.Application/Neutrino/NeutrinoAuthorizationService.cs b/RecNet.Application/Neutrino/NeutrinoAuthorizationService.cs index 30da4e0..c5f64a5 100644 --- a/RecNet.Application/Neutrino/NeutrinoAuthorizationService.cs +++ b/RecNet.Application/Neutrino/NeutrinoAuthorizationService.cs @@ -1,5 +1,5 @@ using RecNet.Application.Common.Interfaces; -using RecNet.Domain.Repositories; +using RecNet.Domain.Profiles; namespace RecNet.Application.Neutrino; diff --git a/RecNet.Application/Profiles/LoginProfileCommand.cs b/RecNet.Application/Profiles/LoginProfileCommand.cs index 7359958..faa29fe 100644 --- a/RecNet.Application/Profiles/LoginProfileCommand.cs +++ b/RecNet.Application/Profiles/LoginProfileCommand.cs @@ -3,6 +3,7 @@ using RecNet.Domain.Common; namespace RecNet.Application.Profiles; public sealed record LoginProfileCommand( + string AppVersion, string DeviceId, PlatformType PlatformType, string PlatformId, diff --git a/RecNet.Application/Profiles/NameGenerator.cs b/RecNet.Application/Profiles/NameGenerator.cs index cf6a600..17cd4dc 100644 --- a/RecNet.Application/Profiles/NameGenerator.cs +++ b/RecNet.Application/Profiles/NameGenerator.cs @@ -1,5 +1,5 @@ using RecNet.Application.Common.Interfaces; -using RecNet.Domain.Entities.Profiles.Names; +using RecNet.Domain.Profiles.Names; namespace RecNet.Application.Profiles; diff --git a/RecNet.Application/Profiles/ProfileService.cs b/RecNet.Application/Profiles/ProfileService.cs index 0ab4654..37aa97a 100644 --- a/RecNet.Application/Profiles/ProfileService.cs +++ b/RecNet.Application/Profiles/ProfileService.cs @@ -1,16 +1,18 @@ using AutoMapper; using RecNet.Application.Common.Interfaces; -using RecNet.Domain.Repositories; -using ProfileEntity = RecNet.Domain.Entities.Profiles.Profile; +using RecNet.Domain.GameVersions; +using RecNet.Domain.Profiles; +using ProfileEntity = RecNet.Domain.Profiles.Profile; namespace RecNet.Application.Profiles; public class ProfileService( - NameGenerator nameGenerator, - IProfileRepository profileRepository, - ITokenService tokenService, - IConfigService configService, IEnumerable validators, + IGameVersionRepository gameVersionRepository, + IProfileRepository profileRepository, + IConfigService configService, + NameGenerator nameGenerator, + ITokenService tokenService, IMapper mapper) : IProfileService { public async Task GetProfileAsync(Guid profileId, CancellationToken ct = default) @@ -35,6 +37,15 @@ public class ProfileService( LoginProfileCommand command, CancellationToken ct = default) { + // 1. Validate Game Version + if (string.IsNullOrWhiteSpace(command.AppVersion)) + return LoginProfileResult.Fail("App version is required."); + + var isValidGameVersion = await gameVersionRepository.IsValidAsync(command.AppVersion, ct); + if (!isValidGameVersion) + return LoginProfileResult.Fail("Invalid app version."); + + // 2. Validate Platform Authentication var validator = validators.FirstOrDefault(x => x.PlatformType == command.PlatformType); if (validator is null) return LoginProfileResult.Fail("Invalid platform type"); @@ -48,6 +59,7 @@ public class ProfileService( if (!auth.Succeeded && !ignoreAuthValidation) return LoginProfileResult.Fail($"Platform Auth Failed: {auth.Message}"); + // 3. Get or Create Profile var profile = await profileRepository.GetByPlatform( command.PlatformType, command.PlatformId, @@ -67,7 +79,7 @@ public class ProfileService( if (profile.IsBanned) return LoginProfileResult.Fail("Profile is banned"); - + profile.RecordSuccessfulLogin(command.DeviceId, auth.Name); await profileRepository.SaveChangesAsync(ct); diff --git a/RecNet.Domain/Configuration/IServerConfigRepository.cs b/RecNet.Domain/Configuration/IServerConfigRepository.cs index 6d9bf36..f950c52 100644 --- a/RecNet.Domain/Configuration/IServerConfigRepository.cs +++ b/RecNet.Domain/Configuration/IServerConfigRepository.cs @@ -1,6 +1,4 @@ -using RecNet.Domain.Entities.Configuration; - -namespace RecNet.Domain.Repositories; +namespace RecNet.Domain.Configuration; public interface IServerConfigRepository { diff --git a/RecNet.Domain/Configuration/ServerConfig.cs b/RecNet.Domain/Configuration/ServerConfig.cs index 0c987f0..791e1ba 100644 --- a/RecNet.Domain/Configuration/ServerConfig.cs +++ b/RecNet.Domain/Configuration/ServerConfig.cs @@ -1,6 +1,6 @@ using RecNet.Domain.Exceptions; -namespace RecNet.Domain.Entities.Configuration; +namespace RecNet.Domain.Configuration; public class ServerConfig { diff --git a/RecNet.Domain/GameVersions/GameVersion.cs b/RecNet.Domain/GameVersions/GameVersion.cs new file mode 100644 index 0000000..ad80d88 --- /dev/null +++ b/RecNet.Domain/GameVersions/GameVersion.cs @@ -0,0 +1,31 @@ +using RecNet.Domain.Exceptions; + +namespace RecNet.Domain.GameVersions; + +public class GameVersion +{ + private GameVersion() + { + } + + private GameVersion(string version, bool isValid) + { + Version = RequireValue(version, nameof(version)); + IsValid = isValid; + } + + public string Version { get; private set; } = string.Empty; + public bool IsValid { get; private set; } + + public static GameVersion Create(string version, bool isValid) + => new(version, isValid); + + public void MarkValid() + => IsValid = true; + + public void MarkInvalid() + => IsValid = false; + + private static string RequireValue(string value, string parameterName) + => !string.IsNullOrWhiteSpace(value) ? value : throw new DomainException($"{parameterName} is required."); +} \ No newline at end of file diff --git a/RecNet.Domain/GameVersions/IGameVersionRepository.cs b/RecNet.Domain/GameVersions/IGameVersionRepository.cs new file mode 100644 index 0000000..be8bf0c --- /dev/null +++ b/RecNet.Domain/GameVersions/IGameVersionRepository.cs @@ -0,0 +1,12 @@ +namespace RecNet.Domain.GameVersions; + +public interface IGameVersionRepository +{ + Task GetAsync(string version, CancellationToken ct = default); + + async Task IsValidAsync(string version, CancellationToken ct = default) + { + var gameVersion = await GetAsync(version, ct); + return gameVersion?.IsValid == true; + } +} \ No newline at end of file diff --git a/RecNet.Domain/Profiles/IProfileRepository.cs b/RecNet.Domain/Profiles/IProfileRepository.cs index 164b05f..4d069b5 100644 --- a/RecNet.Domain/Profiles/IProfileRepository.cs +++ b/RecNet.Domain/Profiles/IProfileRepository.cs @@ -1,7 +1,6 @@ using RecNet.Domain.Common; -using RecNet.Domain.Entities.Profiles; -namespace RecNet.Domain.Repositories; +namespace RecNet.Domain.Profiles; public interface IProfileRepository { diff --git a/RecNet.Domain/Profiles/Names/DefaultNameGenConfig.cs b/RecNet.Domain/Profiles/Names/DefaultNameGenConfig.cs index 94b5323..c98298a 100644 --- a/RecNet.Domain/Profiles/Names/DefaultNameGenConfig.cs +++ b/RecNet.Domain/Profiles/Names/DefaultNameGenConfig.cs @@ -1,4 +1,4 @@ -namespace RecNet.Domain.Entities.Profiles.Names; +namespace RecNet.Domain.Profiles.Names; public static class DefaultNameGenConfig { diff --git a/RecNet.Domain/Profiles/Names/NameGenConfig.cs b/RecNet.Domain/Profiles/Names/NameGenConfig.cs index 039923a..f072335 100644 --- a/RecNet.Domain/Profiles/Names/NameGenConfig.cs +++ b/RecNet.Domain/Profiles/Names/NameGenConfig.cs @@ -1,4 +1,4 @@ -namespace RecNet.Domain.Entities.Profiles.Names; +namespace RecNet.Domain.Profiles.Names; public class NameGenConfig { diff --git a/RecNet.Domain/Profiles/Profile.cs b/RecNet.Domain/Profiles/Profile.cs index b97f72c..572736b 100644 --- a/RecNet.Domain/Profiles/Profile.cs +++ b/RecNet.Domain/Profiles/Profile.cs @@ -1,7 +1,7 @@ using RecNet.Domain.Common; using RecNet.Domain.Exceptions; -namespace RecNet.Domain.Entities.Profiles; +namespace RecNet.Domain.Profiles; public class Profile { diff --git a/RecNet.Infrastructure/DependencyInjection.cs b/RecNet.Infrastructure/DependencyInjection.cs index 2f9217b..53a3f10 100644 --- a/RecNet.Infrastructure/DependencyInjection.cs +++ b/RecNet.Infrastructure/DependencyInjection.cs @@ -1,10 +1,13 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using RecNet.Application.Common.Interfaces; -using RecNet.Domain.Repositories; +using RecNet.Domain.Configuration; +using RecNet.Domain.GameVersions; +using RecNet.Domain.Profiles; using RecNet.Infrastructure.Persistence; using RecNet.Infrastructure.Persistence.Repositories; using RecNet.Infrastructure.Services.Configuration; +using RecNet.Infrastructure.Services.Meta; using RecNet.Infrastructure.Services.Steam; using RecNet.Infrastructure.Services.Tokens; @@ -33,7 +36,9 @@ public static class DependencyInjection }); builder.Services.AddScoped(); + builder.Services.AddScoped(); + builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); diff --git a/RecNet.Infrastructure/Persistence/Configurations/GameVersionConfiguration.cs b/RecNet.Infrastructure/Persistence/Configurations/GameVersionConfiguration.cs new file mode 100644 index 0000000..d58465c --- /dev/null +++ b/RecNet.Infrastructure/Persistence/Configurations/GameVersionConfiguration.cs @@ -0,0 +1,20 @@ +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Metadata.Builders; +using RecNet.Domain.GameVersions; + +namespace RecNet.Infrastructure.Persistence.Configurations; + +public class GameVersionConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.HasKey(x => x.Version); + + builder.Property(x => x.Version) + .HasMaxLength(32) + .IsRequired(); + + builder.Property(x => x.IsValid) + .IsRequired(); + } +} \ No newline at end of file diff --git a/RecNet.Infrastructure/Persistence/Configurations/ProfileConfiguration.cs b/RecNet.Infrastructure/Persistence/Configurations/ProfileConfiguration.cs index 9adf203..a65c68a 100644 --- a/RecNet.Infrastructure/Persistence/Configurations/ProfileConfiguration.cs +++ b/RecNet.Infrastructure/Persistence/Configurations/ProfileConfiguration.cs @@ -1,6 +1,6 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; -using RecNet.Domain.Entities.Profiles; +using RecNet.Domain.Profiles; namespace RecNet.Infrastructure.Persistence.Configurations; diff --git a/RecNet.Infrastructure/Persistence/Configurations/ServerConfigConfiguration.cs b/RecNet.Infrastructure/Persistence/Configurations/ServerConfigConfiguration.cs index fb57ebf..7468673 100644 --- a/RecNet.Infrastructure/Persistence/Configurations/ServerConfigConfiguration.cs +++ b/RecNet.Infrastructure/Persistence/Configurations/ServerConfigConfiguration.cs @@ -1,6 +1,6 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; -using RecNet.Domain.Entities.Configuration; +using RecNet.Domain.Configuration; namespace RecNet.Infrastructure.Persistence.Configurations; diff --git a/RecNet.Infrastructure/Persistence/DatabaseContext.cs b/RecNet.Infrastructure/Persistence/DatabaseContext.cs index bc778c5..3b8283e 100644 --- a/RecNet.Infrastructure/Persistence/DatabaseContext.cs +++ b/RecNet.Infrastructure/Persistence/DatabaseContext.cs @@ -1,12 +1,14 @@ using Microsoft.EntityFrameworkCore; -using RecNet.Domain.Entities.Configuration; -using RecNet.Domain.Entities.Profiles; +using RecNet.Domain.Configuration; +using RecNet.Domain.GameVersions; +using RecNet.Domain.Profiles; namespace RecNet.Infrastructure.Persistence; public class DatabaseContext(DbContextOptions options) : DbContext(options) { public DbSet Profiles => Set(); + public DbSet GameVersions => Set(); public DbSet ServerConfigs => Set(); protected override void OnModelCreating(ModelBuilder modelBuilder) diff --git a/RecNet.Infrastructure/Persistence/Migrations/20260619201140_GameVersion.Designer.cs b/RecNet.Infrastructure/Persistence/Migrations/20260619201140_GameVersion.Designer.cs new file mode 100644 index 0000000..da6a9f9 --- /dev/null +++ b/RecNet.Infrastructure/Persistence/Migrations/20260619201140_GameVersion.Designer.cs @@ -0,0 +1,101 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using RecNet.Infrastructure.Persistence; + +#nullable disable + +namespace RecNet.Infrastructure.Persistence.Migrations +{ + [DbContext(typeof(DatabaseContext))] + [Migration("20260619201140_GameVersion")] + partial class GameVersion + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "10.0.8") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("RecNet.Domain.Configuration.ServerConfig", b => + { + b.Property("Key") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("Value") + .IsRequired() + .HasColumnType("jsonb"); + + b.HasKey("Key"); + + b.ToTable("ServerConfigs"); + }); + + modelBuilder.Entity("RecNet.Domain.GameVersions.GameVersion", b => + { + b.Property("Version") + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("IsValid") + .HasColumnType("boolean"); + + b.HasKey("Version"); + + b.ToTable("GameVersions"); + }); + + modelBuilder.Entity("RecNet.Domain.Profiles.Profile", b => + { + b.Property("ProfileId") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.PrimitiveCollection("DeviceIds") + .IsRequired() + .HasColumnType("jsonb"); + + b.Property("IsBanned") + .HasColumnType("boolean"); + + b.Property("IsModerator") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("Platform") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("PlatformId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.HasKey("ProfileId"); + + b.HasIndex("Platform", "PlatformId") + .IsUnique(); + + b.ToTable("Profiles"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/RecNet.Infrastructure/Persistence/Migrations/20260619201140_GameVersion.cs b/RecNet.Infrastructure/Persistence/Migrations/20260619201140_GameVersion.cs new file mode 100644 index 0000000..bace653 --- /dev/null +++ b/RecNet.Infrastructure/Persistence/Migrations/20260619201140_GameVersion.cs @@ -0,0 +1,33 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace RecNet.Infrastructure.Persistence.Migrations +{ + /// + public partial class GameVersion : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "GameVersions", + columns: table => new + { + Version = table.Column(type: "character varying(32)", maxLength: 32, nullable: false), + IsValid = table.Column(type: "boolean", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_GameVersions", x => x.Version); + }); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "GameVersions"); + } + } +} diff --git a/RecNet.Infrastructure/Persistence/Migrations/DatabaseContextModelSnapshot.cs b/RecNet.Infrastructure/Persistence/Migrations/DatabaseContextModelSnapshot.cs index 3f4ef1c..50d5103 100644 --- a/RecNet.Infrastructure/Persistence/Migrations/DatabaseContextModelSnapshot.cs +++ b/RecNet.Infrastructure/Persistence/Migrations/DatabaseContextModelSnapshot.cs @@ -22,7 +22,7 @@ namespace RecNet.Infrastructure.Persistence.Migrations NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - modelBuilder.Entity("RecNet.Domain.Entities.Configuration.ServerConfig", b => + modelBuilder.Entity("RecNet.Domain.Configuration.ServerConfig", b => { b.Property("Key") .HasMaxLength(128) @@ -37,7 +37,21 @@ namespace RecNet.Infrastructure.Persistence.Migrations b.ToTable("ServerConfigs"); }); - modelBuilder.Entity("RecNet.Domain.Entities.Profiles.Profile", b => + modelBuilder.Entity("RecNet.Domain.GameVersions.GameVersion", b => + { + b.Property("Version") + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("IsValid") + .HasColumnType("boolean"); + + b.HasKey("Version"); + + b.ToTable("GameVersions"); + }); + + modelBuilder.Entity("RecNet.Domain.Profiles.Profile", b => { b.Property("ProfileId") .ValueGeneratedOnAdd() diff --git a/RecNet.Infrastructure/Persistence/Repositories/GameVersionRepository.cs b/RecNet.Infrastructure/Persistence/Repositories/GameVersionRepository.cs new file mode 100644 index 0000000..7a3357c --- /dev/null +++ b/RecNet.Infrastructure/Persistence/Repositories/GameVersionRepository.cs @@ -0,0 +1,11 @@ +using Microsoft.EntityFrameworkCore; +using RecNet.Domain.GameVersions; + +namespace RecNet.Infrastructure.Persistence.Repositories; + +public class GameVersionRepository(DatabaseContext dbContext) : IGameVersionRepository +{ + public Task GetAsync(string version, CancellationToken ct = default) + => dbContext.GameVersions + .FirstOrDefaultAsync(x => x.Version == version, ct); +} \ No newline at end of file diff --git a/RecNet.Infrastructure/Persistence/Repositories/ProfileRepository.cs b/RecNet.Infrastructure/Persistence/Repositories/ProfileRepository.cs index 8427d25..473ce9e 100644 --- a/RecNet.Infrastructure/Persistence/Repositories/ProfileRepository.cs +++ b/RecNet.Infrastructure/Persistence/Repositories/ProfileRepository.cs @@ -1,7 +1,6 @@ using Microsoft.EntityFrameworkCore; using RecNet.Domain.Common; -using RecNet.Domain.Entities.Profiles; -using RecNet.Domain.Repositories; +using RecNet.Domain.Profiles; namespace RecNet.Infrastructure.Persistence.Repositories; diff --git a/RecNet.Infrastructure/Persistence/Repositories/ServerConfigRepository.cs b/RecNet.Infrastructure/Persistence/Repositories/ServerConfigRepository.cs index 85254c6..c28a8b6 100644 --- a/RecNet.Infrastructure/Persistence/Repositories/ServerConfigRepository.cs +++ b/RecNet.Infrastructure/Persistence/Repositories/ServerConfigRepository.cs @@ -1,7 +1,6 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Storage; -using RecNet.Domain.Entities.Configuration; -using RecNet.Domain.Repositories; +using RecNet.Domain.Configuration; namespace RecNet.Infrastructure.Persistence.Repositories; diff --git a/RecNet.Infrastructure/Services/Configuration/ConfigService.cs b/RecNet.Infrastructure/Services/Configuration/ConfigService.cs index 8a998e4..9f626a1 100644 --- a/RecNet.Infrastructure/Services/Configuration/ConfigService.cs +++ b/RecNet.Infrastructure/Services/Configuration/ConfigService.cs @@ -1,6 +1,6 @@ using System.Text.Json; using RecNet.Application.Common.Interfaces; -using RecNet.Domain.Repositories; +using RecNet.Domain.Configuration; namespace RecNet.Infrastructure.Services.Configuration; diff --git a/RecNet.Infrastructure/Services/Meta/MetaAuthValidator.cs b/RecNet.Infrastructure/Services/Meta/MetaAuthValidator.cs new file mode 100644 index 0000000..33d3106 --- /dev/null +++ b/RecNet.Infrastructure/Services/Meta/MetaAuthValidator.cs @@ -0,0 +1,15 @@ +using RecNet.Application.Common.Interfaces; +using RecNet.Application.Common.PlatformAuth; +using RecNet.Domain.Common; + +namespace RecNet.Infrastructure.Services.Meta; + +public class MetaAuthValidator : IPlatformAuthValidator +{ + public PlatformType PlatformType + => PlatformType.Meta; + + public Task ValidateAsync(string platformAuthentication, string platformId, + CancellationToken ct = default) + => Task.FromResult(PlatformAuthResult.Success(null)); // TODO: Implement +} \ No newline at end of file diff --git a/RecNet.Infrastructure/Services/Tokens/TokenService.cs b/RecNet.Infrastructure/Services/Tokens/TokenService.cs index 6c972a6..4aaa4df 100644 --- a/RecNet.Infrastructure/Services/Tokens/TokenService.cs +++ b/RecNet.Infrastructure/Services/Tokens/TokenService.cs @@ -5,7 +5,7 @@ using Microsoft.Extensions.Options; using Microsoft.IdentityModel.Tokens; using RecNet.Application.Common.Interfaces; using RecNet.Application.Common.Tokens; -using RecNet.Domain.Entities.Profiles; +using RecNet.Domain.Profiles; namespace RecNet.Infrastructure.Services.Tokens;