WIP making ClientCreate endpoint

This commit is contained in:
eelke 2026-02-20 17:35:38 +01:00
parent 138f335af0
commit eb872a4f44
28 changed files with 365 additions and 121 deletions

View file

@ -20,20 +20,20 @@ public class KeyMapperTests
RSAParameters parameters = rsa.ExportParameters(includePrivateParameters: false);
Key key = new()
RealmKey realmKey = new()
{
Id = new("60bb79cf-4bac-4521-87f2-ac87cc15541f"),
CreatedAt = DateTime.UtcNow,
Priority = 10,
};
key.SetPrivateKey(_encryptionService, rsa.ExportPkcs8PrivateKey());
realmKey.SetPrivateKey(_encryptionService, rsa.ExportPkcs8PrivateKey());
// Act
KeyMapper mapper = new(_encryptionService);
JsonWebKey jwk = mapper.KeyToJsonWebKey(key);
JsonWebKey jwk = mapper.KeyToJsonWebKey(realmKey);
Assert.Equal("RSA", jwk.KeyType);
Assert.Equal(key.Id.ToString(), jwk.KeyId);
Assert.Equal(realmKey.Id.ToString(), jwk.KeyId);
Assert.Equal("sig", jwk.Use);
Assert.Equal(parameters.Exponent, WebEncoders.Base64UrlDecode(jwk.Exponent));
Assert.Equal(parameters.Modulus, WebEncoders.Base64UrlDecode(jwk.Modulus));