Skip to content

Commit a6c2951

Browse files
feature(#22): this commit refactor to include secret rotation service and ensure secret exists during realm creation
1 parent 83e9373 commit a6c2951

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Applications/Backend/Source/HttpsRichardy.Federation.Application/Handlers/Realm/RealmCreationHandler.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
namespace HttpsRichardy.Federation.Application.Handlers.Realm;
22

3-
public sealed class RealmCreationHandler(IRealmCollection collection, IClientCredentialsGenerator credentialsGenerator) :
3+
public sealed class RealmCreationHandler(
4+
IRealmCollection collection,
5+
IClientCredentialsGenerator credentialsGenerator,
6+
ISecretRotationService secretRotationService) :
47
IDispatchHandler<RealmCreationScheme, Result<RealmDetailsScheme>>
58
{
69
public async Task<Result<RealmDetailsScheme>> HandleAsync(
@@ -31,6 +34,7 @@ public async Task<Result<RealmDetailsScheme>> HandleAsync(
3134
.ToList();
3235

3336
await collection.InsertAsync(realm, cancellation: cancellation);
37+
await secretRotationService.EnsureSecretExistsAsync(realm, cancellation);
3438

3539
return Result<RealmDetailsScheme>.Success(RealmMapper.AsResponse(realm));
3640
}

0 commit comments

Comments
 (0)