refactor: rename files and update namespaces for Palantir integration

This commit is contained in:
Christian Werner 2025-03-08 12:08:14 +01:00
parent 8e1212d986
commit 41c2f00834
104 changed files with 247 additions and 223 deletions

View File

@ -0,0 +1,26 @@
using Microsoft.AspNetCore.Mvc;
namespace Suspectus.Gandalf.Bridgekeeper.Api.Controllers;
[ApiController]
[Route("api/[controller]")]
public class AuthController : ControllerBase
{
[HttpGet("[action]")]
public async Task<IActionResult> Check()
{
return Ok(true);
}
[HttpGet("[action]")]
public async Task<IActionResult> Login()
{
return Ok(true);
}
[HttpGet("[action]")]
public async Task<IActionResult> Register()
{
return Ok(true);
}
}

View File

@ -8,6 +8,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.1"/> <PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.1"/>
<PackageReference Include="MediatR" Version="12.4.1" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -1,3 +0,0 @@
namespace Suspectus.Gandalf.Data.Entities.Base;
public interface IMappingEntity;

View File

@ -1,7 +0,0 @@
namespace Suspectus.Gandalf.Data.Entities.Security;
public enum AuthorityType
{
Tenant,
App
}

View File

@ -1,7 +0,0 @@
namespace Suspectus.Gandalf.Data.Entities.Security;
public enum TokenType
{
Application,
User
}

View File

@ -1,8 +0,0 @@
namespace Suspectus.Gandalf.Data.Entities.Subject.SignIn;
public enum SignInMethod
{
Simple,
Google,
Steam
}

View File

@ -1,8 +0,0 @@
using Suspectus.Gandalf.Data.Entities.Base;
namespace Suspectus.Gandalf.Data.Entities.Tenant;
public abstract class OwnerData : VisibilityData
{
public required long OwnerId { get; set; }
}

View File

@ -2,7 +2,7 @@ using System.Collections.Immutable;
using System.Security.Claims; using System.Security.Claims;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
namespace Suspectus.Gandalf.Abstractions; namespace Suspectus.Gandalf.Palantir.Abstractions;
public partial class Invoker public partial class Invoker
{ {

View File

@ -1,4 +1,4 @@
namespace Suspectus.Gandalf.Abstractions; namespace Suspectus.Gandalf.Palantir.Abstractions;
public class InvokerContext public class InvokerContext
{ {

View File

@ -4,7 +4,6 @@
<TargetFramework>net9.0</TargetFramework> <TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<RootNamespace>Suspectus.Gandalf.Abstractions</RootNamespace>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

View File

@ -1,7 +1,7 @@
using LanguageExt.Common; using LanguageExt.Common;
using Suspectus.Gandalf.Data.Dto; using Suspectus.Gandalf.Palantir.Data.Dto;
namespace Suspectus.Gandalf.Api.Commands; namespace Suspectus.Gandalf.Palantir.Api.Commands;
public class AuthCodeRequestCommand : IGrCommand<Result<AuthCodeDto>> public class AuthCodeRequestCommand : IGrCommand<Result<AuthCodeDto>>
{ {

View File

@ -1,7 +1,7 @@
using LanguageExt.Common; using LanguageExt.Common;
using Suspectus.Gandalf.Data.Dto; using Suspectus.Gandalf.Palantir.Data.Dto;
namespace Suspectus.Gandalf.Api.Commands; namespace Suspectus.Gandalf.Palantir.Api.Commands;
public class CreateAuthCodeCommand : IGrCommand<Result<AuthCodeDto>> public class CreateAuthCodeCommand : IGrCommand<Result<AuthCodeDto>>
{ {

View File

@ -1,7 +1,7 @@
using LanguageExt.Common; using LanguageExt.Common;
using Suspectus.Gandalf.Data.Dto; using Suspectus.Gandalf.Palantir.Data.Dto;
namespace Suspectus.Gandalf.Api.Commands; namespace Suspectus.Gandalf.Palantir.Api.Commands;
public class CreateTokensCommand : IGrCommand<Result<TokenDto>> public class CreateTokensCommand : IGrCommand<Result<TokenDto>>
{ {

View File

@ -1,6 +1,6 @@
using LanguageExt.Common; using LanguageExt.Common;
namespace Suspectus.Gandalf.Api.Commands; namespace Suspectus.Gandalf.Palantir.Api.Commands;
public class HashPasswordCommand : IGrCommand<Result<string>> public class HashPasswordCommand : IGrCommand<Result<string>>
{ {

View File

@ -1,5 +1,5 @@
using MediatR; using MediatR;
namespace Suspectus.Gandalf.Api.Commands; namespace Suspectus.Gandalf.Palantir.Api.Commands;
public interface IGrCommand<out T> : IRequest<T>; public interface IGrCommand<out T> : IRequest<T>;

View File

@ -1,7 +1,7 @@
using LanguageExt.Common; using LanguageExt.Common;
using Suspectus.Gandalf.Data.Entities.Subject; using Suspectus.Gandalf.Palantir.Data.Entities.Subject;
namespace Suspectus.Gandalf.Api.Commands; namespace Suspectus.Gandalf.Palantir.Api.Commands;
public class RegisterCommand : IGrCommand<Result<SubjectEntity>> public class RegisterCommand : IGrCommand<Result<SubjectEntity>>
{ {

View File

@ -1,8 +1,8 @@
using MediatR; using MediatR;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Suspectus.Gandalf.Api.Commands; using Suspectus.Gandalf.Palantir.Api.Commands;
namespace Suspectus.Gandalf.Api.Controllers; namespace Suspectus.Gandalf.Palantir.Api.Controllers;
[ApiController] [ApiController]
[Route("api/[controller]")] [Route("api/[controller]")]

View File

@ -1,6 +1,6 @@
using LanguageExt.Common; using LanguageExt.Common;
namespace Suspectus.Gandalf.Api.Extensions; namespace Suspectus.Gandalf.Palantir.Api.Extensions;
public static class ResultExtensions public static class ResultExtensions
{ {

View File

@ -1,6 +1,6 @@
using MediatR; using MediatR;
using Suspectus.Gandalf.Api.Commands; using Suspectus.Gandalf.Palantir.Api.Commands;
namespace Suspectus.Gandalf.Api.Handlers.Commands; namespace Suspectus.Gandalf.Palantir.Api.Handlers.Commands;
public interface IGrCommandHandler<in TCommand, TResult> : IRequestHandler<TCommand, TResult> where TCommand : IGrCommand<TResult>; public interface IGrCommandHandler<in TCommand, TResult> : IRequestHandler<TCommand, TResult> where TCommand : IGrCommand<TResult>;

View File

@ -1,13 +1,13 @@
using LanguageExt.Common; using LanguageExt.Common;
using MediatR; using MediatR;
using Suspectus.Gandalf.Api.Commands; using Suspectus.Gandalf.Palantir.Api.Commands;
using Suspectus.Gandalf.Api.Extensions; using Suspectus.Gandalf.Palantir.Api.Extensions;
using Suspectus.Gandalf.Data.Database.Repositories; using Suspectus.Gandalf.Palantir.Data.Database.Repositories;
using Suspectus.Gandalf.Data.Entities.Base; using Suspectus.Gandalf.Palantir.Data.Entities.Base;
using Suspectus.Gandalf.Data.Entities.Subject; using Suspectus.Gandalf.Palantir.Data.Entities.Subject;
using Suspectus.Gandalf.Data.Entities.Subject.SignIn; using Suspectus.Gandalf.Palantir.Data.Entities.Subject.SignIn;
namespace Suspectus.Gandalf.Api.Handlers.Commands; namespace Suspectus.Gandalf.Palantir.Api.Handlers.Commands;
public class RegisterCommandHandler(ISubjectRepository subjectRepository, IMediator mediator) : IGrCommandHandler<RegisterCommand, Result<SubjectEntity>> public class RegisterCommandHandler(ISubjectRepository subjectRepository, IMediator mediator) : IGrCommandHandler<RegisterCommand, Result<SubjectEntity>>
{ {

View File

@ -2,14 +2,14 @@ using LanguageExt.Common;
using MediatR; using MediatR;
using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Suspectus.Gandalf.Api.Commands; using Suspectus.Gandalf.Palantir.Api.Commands;
using Suspectus.Gandalf.Api.Extensions; using Suspectus.Gandalf.Palantir.Api.Handlers.Commands;
using Suspectus.Gandalf.Api.Handlers.Commands; using Suspectus.Gandalf.Palantir.Api.Extensions;
using Suspectus.Gandalf.Data.Database.Repositories; using Suspectus.Gandalf.Palantir.Data.Database.Repositories;
using Suspectus.Gandalf.Data.Dto; using Suspectus.Gandalf.Palantir.Data.Dto;
using Suspectus.Gandalf.Data.Entities.Subject.SignIn; using Suspectus.Gandalf.Palantir.Data.Entities.Subject.SignIn;
namespace Suspectus.Gandalf.Api.Handlers.Security; namespace Suspectus.Gandalf.Palantir.Api.Handlers.Security;
public class AuthCodeRequestCommandHandler(IPasswordHasher<object> passwordHasher, ISubjectRepository subjectRepository, IMediator mediator) : IGrCommandHandler<AuthCodeRequestCommand, Result<AuthCodeDto>> public class AuthCodeRequestCommandHandler(IPasswordHasher<object> passwordHasher, ISubjectRepository subjectRepository, IMediator mediator) : IGrCommandHandler<AuthCodeRequestCommand, Result<AuthCodeDto>>
{ {

View File

@ -1,13 +1,13 @@
using AutoMapper; using AutoMapper;
using LanguageExt.Common; using LanguageExt.Common;
using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity;
using Suspectus.Gandalf.Api.Commands; using Suspectus.Gandalf.Palantir.Api.Commands;
using Suspectus.Gandalf.Api.Handlers.Commands; using Suspectus.Gandalf.Palantir.Api.Handlers.Commands;
using Suspectus.Gandalf.Data.Database.Repositories; using Suspectus.Gandalf.Palantir.Data.Database.Repositories;
using Suspectus.Gandalf.Data.Dto; using Suspectus.Gandalf.Palantir.Data.Dto;
using Suspectus.Gandalf.Data.Entities.Security; using Suspectus.Gandalf.Palantir.Data.Entities.Security;
namespace Suspectus.Gandalf.Api.Handlers.Security; namespace Suspectus.Gandalf.Palantir.Api.Handlers.Security;
public class CreateAuthCodeCommandHandler(IPasswordHasher<object> passwordHasher, TimeProvider timeProvider, IAuthCodeRepository authCodeRepository, IMapper mapper) : IGrCommandHandler<CreateAuthCodeCommand, Result<AuthCodeDto>> public class CreateAuthCodeCommandHandler(IPasswordHasher<object> passwordHasher, TimeProvider timeProvider, IAuthCodeRepository authCodeRepository, IMapper mapper) : IGrCommandHandler<CreateAuthCodeCommand, Result<AuthCodeDto>>
{ {

View File

@ -3,15 +3,15 @@ using JWT.Algorithms;
using JWT.Builder; using JWT.Builder;
using JWT.Serializers; using JWT.Serializers;
using LanguageExt.Common; using LanguageExt.Common;
using Suspectus.Gandalf.Api.Commands; using Suspectus.Gandalf.Palantir.Api.Commands;
using Suspectus.Gandalf.Api.Extensions; using Suspectus.Gandalf.Palantir.Api.Handlers.Commands;
using Suspectus.Gandalf.Api.Handlers.Commands; using Suspectus.Gandalf.Palantir.Api.Extensions;
using Suspectus.Gandalf.Data.Database.Repositories; using Suspectus.Gandalf.Palantir.Data.Database.Repositories;
using Suspectus.Gandalf.Data.Dto; using Suspectus.Gandalf.Palantir.Data.Dto;
using Suspectus.Gandalf.Data.Entities.Security; using Suspectus.Gandalf.Palantir.Data.Entities.Security;
using Suspectus.Gandalf.Security.Scheme; using Suspectus.Gandalf.Palantir.Security.Scheme;
namespace Suspectus.Gandalf.Api.Handlers.Security; namespace Suspectus.Gandalf.Palantir.Api.Handlers.Security;
public class CreateTokensCommandHandler(TimeProvider timeProvider, IConfiguration configuration, IHashids hashids, ITokenMetadataRepository tokenMetadataRepository) : IGrCommandHandler<CreateTokensCommand, Result<TokenDto>> public class CreateTokensCommandHandler(TimeProvider timeProvider, IConfiguration configuration, IHashids hashids, ITokenMetadataRepository tokenMetadataRepository) : IGrCommandHandler<CreateTokensCommand, Result<TokenDto>>
{ {

View File

@ -3,13 +3,13 @@ using System.Text;
using LanguageExt.Common; using LanguageExt.Common;
using MediatR; using MediatR;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Suspectus.Gandalf.Api.Commands; using Suspectus.Gandalf.Palantir.Api.Commands;
using Suspectus.Gandalf.Api.Extensions; using Suspectus.Gandalf.Palantir.Api.Handlers.Commands;
using Suspectus.Gandalf.Api.Handlers.Commands; using Suspectus.Gandalf.Palantir.Api.Extensions;
using Suspectus.Gandalf.Data.Database.Repositories; using Suspectus.Gandalf.Palantir.Data.Database.Repositories;
using Suspectus.Gandalf.Data.Dto; using Suspectus.Gandalf.Palantir.Data.Dto;
namespace Suspectus.Gandalf.Api.Handlers.Security; namespace Suspectus.Gandalf.Palantir.Api.Handlers.Security;
public class GetTokensCommandHandler(IAuthCodeRepository authCodeRepository, TimeProvider timeProvider, IMediator mediator) : IGrCommandHandler<GetTokensCommand, Result<TokenDto>> public class GetTokensCommandHandler(IAuthCodeRepository authCodeRepository, TimeProvider timeProvider, IMediator mediator) : IGrCommandHandler<GetTokensCommand, Result<TokenDto>>
{ {

View File

@ -1,10 +1,10 @@
using LanguageExt.Common; using LanguageExt.Common;
using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity;
using Suspectus.Gandalf.Api.Commands; using Suspectus.Gandalf.Palantir.Api.Commands;
using Suspectus.Gandalf.Api.Extensions; using Suspectus.Gandalf.Palantir.Api.Handlers.Commands;
using Suspectus.Gandalf.Api.Handlers.Commands; using Suspectus.Gandalf.Palantir.Api.Extensions;
namespace Suspectus.Gandalf.Api.Handlers.Security; namespace Suspectus.Gandalf.Palantir.Api.Handlers.Security;
public class PasswordHashingHandler(IPasswordHasher<object> passwordHasher) : IGrCommandHandler<HashPasswordCommand, Result<string>> public class PasswordHashingHandler(IPasswordHasher<object> passwordHasher) : IGrCommandHandler<HashPasswordCommand, Result<string>>
{ {

View File

@ -3,10 +3,10 @@ using System.Text.Json.Serialization;
using HashidsNet; using HashidsNet;
using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Suspectus.Gandalf.Abstractions; using Suspectus.Gandalf.Palantir.Abstractions;
using Suspectus.Gandalf.Security.Scheme; using Suspectus.Gandalf.Palantir.Security.Scheme;
using Suspectus.Gandalf.Data.Database; using Suspectus.Gandalf.Palantir.Data.Database;
using Suspectus.Gandalf.Data.Database.Repositories; using Suspectus.Gandalf.Palantir.Data.Database.Repositories;
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);
@ -16,7 +16,7 @@ builder.Services.AddEndpointsApiExplorer();
builder.Services.AddDbContext<ApplicationContext>(cfg => cfg builder.Services.AddDbContext<ApplicationContext>(cfg => cfg
.UseNpgsql( .UseNpgsql(
builder.Configuration.GetConnectionString("DefaultConnection"), builder.Configuration.GetConnectionString("DefaultConnection"),
x => x.MigrationsAssembly("Suspectus.Gandalf.Data") x => x.MigrationsAssembly("Suspectus.Gandalf.Palantir.Data")
) )
); );

View File

@ -4,7 +4,6 @@
<TargetFramework>net9.0</TargetFramework> <TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>Suspectus.Gandalf.Api</RootNamespace>
<LangVersion>12</LangVersion> <LangVersion>12</LangVersion>
</PropertyGroup> </PropertyGroup>
@ -23,8 +22,8 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Suspectus.Gandalf.Data\Suspectus.Gandalf.Data.csproj" /> <ProjectReference Include="..\Suspectus.Gandalf.Palantir.Data\Suspectus.Gandalf.Palantir.Data.csproj" />
<ProjectReference Include="..\Suspectus.Gandalf.Security\Suspectus.Gandalf.Security.csproj" /> <ProjectReference Include="..\Suspectus.Gandalf.Palantir.Security\Suspectus.Gandalf.Palantir.Security.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -2,14 +2,14 @@ using HashidsNet;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Suspectus.Gandalf.Abstractions; using Suspectus.Gandalf.Palantir.Abstractions;
using Suspectus.Gandalf.Data.Database; using Suspectus.Gandalf.Palantir.Data.Database;
using Suspectus.Gandalf.Data.Entities.Base; using Suspectus.Gandalf.Palantir.Data.Entities.Base;
using Suspectus.Gandalf.Data.Entities.Security; using Suspectus.Gandalf.Palantir.Data.Entities.Security;
using Suspectus.Gandalf.Data.Entities.Tenant; using Suspectus.Gandalf.Palantir.Data.Entities.Tenant;
using Suspectus.Gandalf.Security; using Suspectus.Gandalf.Palantir.Security;
namespace Suspectus.Gandalf.Api; namespace Suspectus.Gandalf.Palantir.Api;
[ApiController] [ApiController]
[Route("api/[controller]")] [Route("api/[controller]")]

View File

@ -1,9 +1,9 @@
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Suspectus.Gandalf.Abstractions; using Suspectus.Gandalf.Palantir.Abstractions;
using Suspectus.Gandalf.Data.Entities.Base; using Suspectus.Gandalf.Palantir.Data.Entities.Base;
using Suspectus.Gandalf.Data.Entities.Version; using Suspectus.Gandalf.Palantir.Data.Entities.Version;
namespace Suspectus.Gandalf.Data.Database; namespace Suspectus.Gandalf.Palantir.Data.Database;
public sealed class ApplicationContext(DbContextOptions<ApplicationContext> options, InvokerContext invokerContext) : CoreContext<ApplicationContext>(options) public sealed class ApplicationContext(DbContextOptions<ApplicationContext> options, InvokerContext invokerContext) : CoreContext<ApplicationContext>(options)
{ {

View File

@ -1,12 +1,12 @@
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Suspectus.Gandalf.Data.Entities.App; using Suspectus.Gandalf.Palantir.Data.Entities.App;
using Suspectus.Gandalf.Data.Entities.Base; using Suspectus.Gandalf.Palantir.Data.Entities.Security;
using Suspectus.Gandalf.Data.Entities.Security; using Suspectus.Gandalf.Palantir.Data.Entities.Subject;
using Suspectus.Gandalf.Data.Entities.Subject; using Suspectus.Gandalf.Palantir.Data.Entities.Subject.SignIn;
using Suspectus.Gandalf.Data.Entities.Subject.SignIn; using Suspectus.Gandalf.Palantir.Data.Entities.Tenant;
using Suspectus.Gandalf.Data.Entities.Tenant; using Suspectus.Gandalf.Palantir.Data.Entities.Base;
namespace Suspectus.Gandalf.Data.Database; namespace Suspectus.Gandalf.Palantir.Data.Database;
public abstract class CoreContext<T>(DbContextOptions<T> options) : DbContext(options) where T : DbContext public abstract class CoreContext<T>(DbContextOptions<T> options) : DbContext(options) where T : DbContext
{ {

View File

@ -1,9 +1,9 @@
using System.Data; using System.Data;
using System.Data.Common; using System.Data.Common;
using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.EntityFrameworkCore.Diagnostics;
using Suspectus.Gandalf.Abstractions; using Suspectus.Gandalf.Palantir.Abstractions;
namespace Suspectus.Gandalf.Data.Database; namespace Suspectus.Gandalf.Palantir.Data.Database;
public class GrDbConnectionInterceptor(InvokerContext invokerContext) : IDbConnectionInterceptor public class GrDbConnectionInterceptor(InvokerContext invokerContext) : IDbConnectionInterceptor
{ {

View File

@ -1,6 +1,6 @@
using Suspectus.Gandalf.Data.Entities.Security; using Suspectus.Gandalf.Palantir.Data.Entities.Security;
namespace Suspectus.Gandalf.Data.Database.Repositories; namespace Suspectus.Gandalf.Palantir.Data.Database.Repositories;
public class AuthCodeRepository(ApplicationContext context) : GrRepository<AuthCodeEntity>(context), IAuthCodeRepository; public class AuthCodeRepository(ApplicationContext context) : GrRepository<AuthCodeEntity>(context), IAuthCodeRepository;

View File

@ -1,8 +1,8 @@
using LanguageExt.Common; using LanguageExt.Common;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Suspectus.Gandalf.Data.Entities.Base; using Suspectus.Gandalf.Palantir.Data.Entities.Base;
namespace Suspectus.Gandalf.Data.Database.Repositories; namespace Suspectus.Gandalf.Palantir.Data.Database.Repositories;
public abstract class GrRepository<TEntity>(ApplicationContext context) : IGrRepository<TEntity> where TEntity : class, IEntity public abstract class GrRepository<TEntity>(ApplicationContext context) : IGrRepository<TEntity> where TEntity : class, IEntity
{ {

View File

@ -1,7 +1,7 @@
using LanguageExt.Common; using LanguageExt.Common;
using Suspectus.Gandalf.Data.Entities.Base; using Suspectus.Gandalf.Palantir.Data.Entities.Base;
namespace Suspectus.Gandalf.Data.Database.Repositories; namespace Suspectus.Gandalf.Palantir.Data.Database.Repositories;
public interface IGrRepository<TEntity> where TEntity : class, IEntity public interface IGrRepository<TEntity> where TEntity : class, IEntity
{ {

View File

@ -1,6 +1,6 @@
using Suspectus.Gandalf.Data.Entities.Subject; using Suspectus.Gandalf.Palantir.Data.Entities.Subject;
namespace Suspectus.Gandalf.Data.Database.Repositories; namespace Suspectus.Gandalf.Palantir.Data.Database.Repositories;
public class SubjectRepository(ApplicationContext context) : GrRepository<SubjectEntity>(context), ISubjectRepository; public class SubjectRepository(ApplicationContext context) : GrRepository<SubjectEntity>(context), ISubjectRepository;

View File

@ -1,7 +1,6 @@
using Suspectus.Gandalf.Palantir.Data.Entities.Security;
using Suspectus.Gandalf.Data.Entities.Security; namespace Suspectus.Gandalf.Palantir.Data.Database.Repositories;
namespace Suspectus.Gandalf.Data.Database.Repositories;
public class TokenMetadataRepository(ApplicationContext context) : GrRepository<TokenMetadataEntity>(context), ITokenMetadataRepository; public class TokenMetadataRepository(ApplicationContext context) : GrRepository<TokenMetadataEntity>(context), ITokenMetadataRepository;

View File

@ -1,4 +1,4 @@
namespace Suspectus.Gandalf.Data.Dto; namespace Suspectus.Gandalf.Palantir.Data.Dto;
public class AuthCodeDto public class AuthCodeDto
{ {

View File

@ -1,4 +1,4 @@
namespace Suspectus.Gandalf.Data.Dto; namespace Suspectus.Gandalf.Palantir.Data.Dto;
public class TokenDto public class TokenDto
{ {

View File

@ -1,9 +1,9 @@
using Suspectus.Gandalf.Data.Entities.Base; using Suspectus.Gandalf.Palantir.Data.Entities.Base;
using Suspectus.Gandalf.Data.Entities.Subject; using Suspectus.Gandalf.Palantir.Data.Entities.Subject;
using Suspectus.Gandalf.Data.Entities.Tenant; using Suspectus.Gandalf.Palantir.Data.Entities.Tenant;
using Suspectus.Gandalf.Data.Entities.Version; using Suspectus.Gandalf.Palantir.Data.Entities.Version;
namespace Suspectus.Gandalf.Data.Entities.App; namespace Suspectus.Gandalf.Palantir.Data.Entities.App;
public class AppRelationEntity : AppRelationData, IVersionableEntity public class AppRelationEntity : AppRelationData, IVersionableEntity
{ {

View File

@ -1,10 +1,10 @@
using Suspectus.Gandalf.Data.Entities.Base; using Suspectus.Gandalf.Palantir.Data.Entities.Base;
using Suspectus.Gandalf.Data.Entities.Security; using Suspectus.Gandalf.Palantir.Data.Entities.Security;
using Suspectus.Gandalf.Data.Entities.Subject; using Suspectus.Gandalf.Palantir.Data.Entities.Subject;
using Suspectus.Gandalf.Data.Entities.Tenant; using Suspectus.Gandalf.Palantir.Data.Entities.Tenant;
using Suspectus.Gandalf.Data.Entities.Version; using Suspectus.Gandalf.Palantir.Data.Entities.Version;
namespace Suspectus.Gandalf.Data.Entities.App; namespace Suspectus.Gandalf.Palantir.Data.Entities.App;
public class AppSubjectRelationEntity : AppSubjectRelationData<long>, IMappingEntity, IVersionableEntity public class AppSubjectRelationEntity : AppSubjectRelationData<long>, IMappingEntity, IVersionableEntity
{ {

View File

@ -1,4 +1,4 @@
namespace Suspectus.Gandalf.Data.Entities.Base; namespace Suspectus.Gandalf.Palantir.Data.Entities.Base;
public enum EntityVisibility public enum EntityVisibility
{ {

View File

@ -1,4 +1,4 @@
namespace Suspectus.Gandalf.Data.Entities.Base; namespace Suspectus.Gandalf.Palantir.Data.Entities.Base;
public interface IEntity public interface IEntity
{ {

View File

@ -0,0 +1,3 @@
namespace Suspectus.Gandalf.Palantir.Data.Entities.Base;
public interface IMappingEntity;

View File

@ -1,4 +1,4 @@
namespace Suspectus.Gandalf.Data.Entities.Base; namespace Suspectus.Gandalf.Palantir.Data.Entities.Base;
public abstract class IdData : IEntity public abstract class IdData : IEntity
{ {

View File

@ -1,4 +1,4 @@
namespace Suspectus.Gandalf.Data.Entities.Base; namespace Suspectus.Gandalf.Palantir.Data.Entities.Base;
public abstract class SubjectData : VisibilityData public abstract class SubjectData : VisibilityData
{ {

View File

@ -1,4 +1,4 @@
namespace Suspectus.Gandalf.Data.Entities.Base; namespace Suspectus.Gandalf.Palantir.Data.Entities.Base;
public abstract class TenantRelationData : VisibilityData public abstract class TenantRelationData : VisibilityData
{ {

View File

@ -1,4 +1,4 @@
namespace Suspectus.Gandalf.Data.Entities.Base; namespace Suspectus.Gandalf.Palantir.Data.Entities.Base;
public abstract class VisibilityData : IdData public abstract class VisibilityData : IdData
{ {

View File

@ -1,4 +1,4 @@
namespace Suspectus.Gandalf.Data.Entities; namespace Suspectus.Gandalf.Palantir.Data.Entities;
[AttributeUsage(AttributeTargets.Property)] [AttributeUsage(AttributeTargets.Property)]
public class ContentKeyAttribute : Attribute public class ContentKeyAttribute : Attribute

View File

@ -1,10 +1,10 @@
using Suspectus.Gandalf.Data.Entities.App; using Suspectus.Gandalf.Palantir.Data.Entities.App;
using Suspectus.Gandalf.Data.Entities.Base; using Suspectus.Gandalf.Palantir.Data.Entities.Base;
using Suspectus.Gandalf.Data.Entities.Subject; using Suspectus.Gandalf.Palantir.Data.Entities.Subject;
using Suspectus.Gandalf.Data.Entities.Tenant; using Suspectus.Gandalf.Palantir.Data.Entities.Tenant;
using Suspectus.Gandalf.Data.Entities.Version; using Suspectus.Gandalf.Palantir.Data.Entities.Version;
namespace Suspectus.Gandalf.Data.Entities.Security; namespace Suspectus.Gandalf.Palantir.Data.Entities.Security;
public class AppSubjectRelationInternalAuthorityRelationEntity : AppSubjectRelationInternalAuthorityRelationData<long>, IMappingEntity, IVersionableEntity public class AppSubjectRelationInternalAuthorityRelationEntity : AppSubjectRelationInternalAuthorityRelationData<long>, IMappingEntity, IVersionableEntity
{ {

View File

@ -1,6 +1,6 @@
using Suspectus.Gandalf.Data.Entities.Base; using Suspectus.Gandalf.Palantir.Data.Entities.Base;
namespace Suspectus.Gandalf.Data.Entities.Security; namespace Suspectus.Gandalf.Palantir.Data.Entities.Security;
public class AuthCodeEntity : IdData public class AuthCodeEntity : IdData
{ {

View File

@ -1,8 +1,8 @@
using Suspectus.Gandalf.Data.Entities.App; using Suspectus.Gandalf.Palantir.Data.Entities.App;
using Suspectus.Gandalf.Data.Entities.Base; using Suspectus.Gandalf.Palantir.Data.Entities.Base;
using Suspectus.Gandalf.Data.Entities.Tenant; using Suspectus.Gandalf.Palantir.Data.Entities.Tenant;
namespace Suspectus.Gandalf.Data.Entities.Security; namespace Suspectus.Gandalf.Palantir.Data.Entities.Security;
public class AuthorityEntity : IdData public class AuthorityEntity : IdData
{ {

View File

@ -0,0 +1,7 @@
namespace Suspectus.Gandalf.Palantir.Data.Entities.Security;
public enum AuthorityType
{
Tenant,
App
}

View File

@ -1,9 +1,9 @@
using Suspectus.Gandalf.Data.Entities.Base; using Suspectus.Gandalf.Palantir.Data.Entities.Base;
using Suspectus.Gandalf.Data.Entities.Subject; using Suspectus.Gandalf.Palantir.Data.Entities.Subject;
using Suspectus.Gandalf.Data.Entities.Tenant; using Suspectus.Gandalf.Palantir.Data.Entities.Tenant;
using Suspectus.Gandalf.Data.Entities.Version; using Suspectus.Gandalf.Palantir.Data.Entities.Version;
namespace Suspectus.Gandalf.Data.Entities.Security; namespace Suspectus.Gandalf.Palantir.Data.Entities.Security;
public class TenantSubjectRelationInternalAuthorityRelationEntity : TenantSubjectRelationInternalAuthorityRelationData<long>, IMappingEntity, IVersionableEntity public class TenantSubjectRelationInternalAuthorityRelationEntity : TenantSubjectRelationInternalAuthorityRelationData<long>, IMappingEntity, IVersionableEntity
{ {

View File

@ -1,6 +1,6 @@
using Suspectus.Gandalf.Data.Entities.Base; using Suspectus.Gandalf.Palantir.Data.Entities.Base;
namespace Suspectus.Gandalf.Data.Entities.Security; namespace Suspectus.Gandalf.Palantir.Data.Entities.Security;
public class TokenMetadataEntity : IdData public class TokenMetadataEntity : IdData
{ {

View File

@ -0,0 +1,7 @@
namespace Suspectus.Gandalf.Palantir.Data.Entities.Security;
public enum TokenType
{
Application,
User
}

View File

@ -1,6 +1,6 @@
using Suspectus.Gandalf.Data.Entities.Base; using Suspectus.Gandalf.Palantir.Data.Entities.Base;
namespace Suspectus.Gandalf.Data.Entities.Subject.SignIn; namespace Suspectus.Gandalf.Palantir.Data.Entities.Subject.SignIn;
public class SignInEntity : SubjectData public class SignInEntity : SubjectData
{ {

View File

@ -0,0 +1,8 @@
namespace Suspectus.Gandalf.Palantir.Data.Entities.Subject.SignIn;
public enum SignInMethod
{
Simple,
Google,
Steam
}

View File

@ -1,9 +1,9 @@
using Suspectus.Gandalf.Data.Entities.App; using Suspectus.Gandalf.Palantir.Data.Entities.App;
using Suspectus.Gandalf.Data.Entities.Base; using Suspectus.Gandalf.Palantir.Data.Entities.Base;
using Suspectus.Gandalf.Data.Entities.Subject.SignIn; using Suspectus.Gandalf.Palantir.Data.Entities.Subject.SignIn;
using Suspectus.Gandalf.Data.Entities.Tenant; using Suspectus.Gandalf.Palantir.Data.Entities.Tenant;
namespace Suspectus.Gandalf.Data.Entities.Subject; namespace Suspectus.Gandalf.Palantir.Data.Entities.Subject;
public class SubjectEntity : VisibilityData public class SubjectEntity : VisibilityData
{ {

View File

@ -0,0 +1,8 @@
using Suspectus.Gandalf.Palantir.Data.Entities.Base;
namespace Suspectus.Gandalf.Palantir.Data.Entities.Tenant;
public abstract class OwnerData : VisibilityData
{
public required long OwnerId { get; set; }
}

View File

@ -1,8 +1,8 @@
using Suspectus.Gandalf.Data.Entities.App; using Suspectus.Gandalf.Palantir.Data.Entities.App;
using Suspectus.Gandalf.Data.Entities.Subject; using Suspectus.Gandalf.Palantir.Data.Entities.Subject;
using Suspectus.Gandalf.Data.Entities.Version; using Suspectus.Gandalf.Palantir.Data.Entities.Version;
namespace Suspectus.Gandalf.Data.Entities.Tenant; namespace Suspectus.Gandalf.Palantir.Data.Entities.Tenant;
public class TenantEntity : TenantData, IVersionableEntity public class TenantEntity : TenantData, IVersionableEntity
{ {

View File

@ -1,9 +1,9 @@
using Suspectus.Gandalf.Data.Entities.Base; using Suspectus.Gandalf.Palantir.Data.Entities.Base;
using Suspectus.Gandalf.Data.Entities.Security; using Suspectus.Gandalf.Palantir.Data.Entities.Security;
using Suspectus.Gandalf.Data.Entities.Subject; using Suspectus.Gandalf.Palantir.Data.Entities.Subject;
using Suspectus.Gandalf.Data.Entities.Version; using Suspectus.Gandalf.Palantir.Data.Entities.Version;
namespace Suspectus.Gandalf.Data.Entities.Tenant; namespace Suspectus.Gandalf.Palantir.Data.Entities.Tenant;
public class TenantSubjectRelationEntity : TenantSubjectRelationData<long>, IMappingEntity, IVersionableEntity public class TenantSubjectRelationEntity : TenantSubjectRelationData<long>, IMappingEntity, IVersionableEntity
{ {

View File

@ -1,8 +1,8 @@
using Suspectus.Gandalf.Data.Entities.Base; using Suspectus.Gandalf.Palantir.Data.Entities.Base;
using Suspectus.Gandalf.Data.Entities.Subject; using Suspectus.Gandalf.Palantir.Data.Entities.Subject;
using Suspectus.Gandalf.Data.Entities.Tenant; using Suspectus.Gandalf.Palantir.Data.Entities.Tenant;
namespace Suspectus.Gandalf.Data.Entities.Version; namespace Suspectus.Gandalf.Palantir.Data.Entities.Version;
public interface IVersionableBase : IEntity, IVersionableEntity; public interface IVersionableBase : IEntity, IVersionableEntity;

View File

@ -1,4 +1,4 @@
namespace Suspectus.Gandalf.Data.Entities.Version; namespace Suspectus.Gandalf.Palantir.Data.Entities.Version;
public enum VersionAction public enum VersionAction
{ {

View File

@ -1,6 +1,6 @@
using System.Text; using System.Text;
namespace Suspectus.Gandalf.Data.Extensions; namespace Suspectus.Gandalf.Palantir.Data.Extensions;
public static class StringExtensions public static class StringExtensions
{ {

View File

@ -1,8 +1,8 @@
using AutoMapper; using AutoMapper;
using Suspectus.Gandalf.Data.Dto; using Suspectus.Gandalf.Palantir.Data.Dto;
using Suspectus.Gandalf.Data.Entities.Security; using Suspectus.Gandalf.Palantir.Data.Entities.Security;
namespace Suspectus.Gandalf.Data.Mapper; namespace Suspectus.Gandalf.Palantir.Data.Mapper;
public class AuthCodeDtoMappingProfile : Profile public class AuthCodeDtoMappingProfile : Profile
{ {

View File

@ -5,7 +5,7 @@ using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using Suspectus.Gandalf.Data.Database; using Suspectus.Gandalf.Palantir.Data.Database;
#nullable disable #nullable disable

View File

@ -5,7 +5,7 @@ using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using Suspectus.Gandalf.Data.Database; using Suspectus.Gandalf.Palantir.Data.Database;
#nullable disable #nullable disable

View File

@ -5,7 +5,7 @@ using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using Suspectus.Gandalf.Data.Database; using Suspectus.Gandalf.Palantir.Data.Database;
#nullable disable #nullable disable

View File

@ -5,7 +5,7 @@ using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using Suspectus.Gandalf.Data.Database; using Suspectus.Gandalf.Palantir.Data.Database;
#nullable disable #nullable disable

View File

@ -5,7 +5,7 @@ using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using Suspectus.Gandalf.Data.Database; using Suspectus.Gandalf.Palantir.Data.Database;
#nullable disable #nullable disable

View File

@ -5,7 +5,7 @@ using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using Suspectus.Gandalf.Data.Database; using Suspectus.Gandalf.Palantir.Data.Database;
#nullable disable #nullable disable

View File

@ -5,7 +5,7 @@ using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using Suspectus.Gandalf.Data.Database; using Suspectus.Gandalf.Palantir.Data.Database;
#nullable disable #nullable disable

View File

@ -5,7 +5,7 @@ using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using Suspectus.Gandalf.Data.Database; using Suspectus.Gandalf.Palantir.Data.Database;
#nullable disable #nullable disable

View File

@ -5,7 +5,7 @@ using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using Suspectus.Gandalf.Data.Database; using Suspectus.Gandalf.Palantir.Data.Database;
#nullable disable #nullable disable

View File

@ -5,7 +5,7 @@ using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using Suspectus.Gandalf.Data.Database; using Suspectus.Gandalf.Palantir.Data.Database;
#nullable disable #nullable disable

View File

@ -5,7 +5,7 @@ using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using Suspectus.Gandalf.Data.Database; using Suspectus.Gandalf.Palantir.Data.Database;
#nullable disable #nullable disable

View File

@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using Suspectus.Gandalf.Data.Database; using Suspectus.Gandalf.Palantir.Data.Database;
#nullable disable #nullable disable

View File

@ -4,7 +4,6 @@
<TargetFramework>net9.0</TargetFramework> <TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<RootNamespace>Suspectus.Gandalf.Data</RootNamespace>
<LangVersion>12</LangVersion> <LangVersion>12</LangVersion>
</PropertyGroup> </PropertyGroup>
@ -22,7 +21,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Suspectus.Gandalf.Abstractions\Suspectus.Gandalf.Abstractions.csproj" /> <ProjectReference Include="..\Suspectus.Gandalf.Palantir.Abstractions\Suspectus.Gandalf.Palantir.Abstractions.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -2,10 +2,10 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.AspNetCore.Mvc.Filters;
using Suspectus.Gandalf.Abstractions; using Suspectus.Gandalf.Palantir.Abstractions;
using Suspectus.Gandalf.Data.Entities.Security; using Suspectus.Gandalf.Palantir.Data.Entities.Security;
namespace Suspectus.Gandalf.Security; namespace Suspectus.Gandalf.Palantir.Security;
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)]
public class GrAuthorizeAttribute : Attribute, IAuthorizationFilter public class GrAuthorizeAttribute : Attribute, IAuthorizationFilter

View File

@ -1,6 +1,6 @@
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
namespace Suspectus.Gandalf.Security.Scheme; namespace Suspectus.Gandalf.Palantir.Security.Scheme;
public static class GandalfRebornJwtTokenAuthExtensions public static class GandalfRebornJwtTokenAuthExtensions
{ {

Some files were not shown because too many files have changed in this diff Show More