fix(Kryptograph): Umbenannt in Krypto-Fabrik.

This commit is contained in:
Developer 02
2025-01-09 20:10:45 +01:00
parent d98b3f2867
commit 079f0c69c7
4 changed files with 9 additions and 9 deletions

View File

@@ -13,13 +13,13 @@ namespace DigitalData.Core.Security
private readonly IMapper _mapper;
private readonly ICryptograph _cryptograph;
private readonly ICryptoFactory _cryptoFactory;
public JwtSignatureHandler(IOptions<ClaimDescriptor<TPrincipal>> claimDescriptorOptions, IMapper mapper, ICryptograph cryptograph)
public JwtSignatureHandler(IOptions<ClaimDescriptor<TPrincipal>> claimDescriptorOptions, IMapper mapper, ICryptoFactory cryptoFactory)
{
_claimDescriptor = claimDescriptorOptions.Value;
_mapper = mapper;
_cryptograph = cryptograph;
_cryptoFactory = cryptoFactory;
}
public SecurityToken CreateToken(TPrincipal subject, IAsymmetricTokenDescriptor descriptor)
@@ -32,14 +32,14 @@ namespace DigitalData.Core.Security
public SecurityToken CreateToken(TPrincipal subject, string issuer, string audience)
{
var descriptor = _cryptograph.TokenDescriptors.Get(issuer: issuer, audience: audience)
var descriptor = _cryptoFactory.TokenDescriptors.Get(issuer: issuer, audience: audience)
?? throw new InvalidOperationException($"No or multiple token description found for issuer '{issuer}' and audience '{audience}'.");
return CreateToken(subject: subject, descriptor: descriptor);
}
public SecurityToken CreateToken(TPrincipal subject, string apiRoute)
{
var desc = _cryptograph.TokenDescriptors.SingleOrDefault(desc => desc.ApiRoute == apiRoute)
var desc = _cryptoFactory.TokenDescriptors.SingleOrDefault(desc => desc.ApiRoute == apiRoute)
?? throw new InvalidOperationException($"No or multiple token description found for api route '{apiRoute}'.");
return CreateToken(subject: subject, descriptor: desc);