-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Cancel events. * Fix tests * Update dependencies * Fix mail catcher.
- Loading branch information
1 parent
2077395
commit 61e3168
Showing
58 changed files
with
1,114 additions
and
298 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
backend/src/Notifo.Domain/UserNotifications/CancelRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// ========================================================================== | ||
// Notifo.io | ||
// ========================================================================== | ||
// Copyright (c) Sebastian Stehle | ||
// All rights reserved. Licensed under the MIT license. | ||
// ========================================================================== | ||
|
||
namespace Notifo.Domain.UserNotifications; | ||
|
||
public sealed class CancelRequest | ||
{ | ||
public string AppId { get; set; } | ||
|
||
public string UserId { get; set; } | ||
|
||
public string EventId { get; set; } | ||
|
||
public string? GroupKey { get; set; } | ||
|
||
public bool Test { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// ========================================================================== | ||
// Notifo.io | ||
// ========================================================================== | ||
// Copyright (c) Sebastian Stehle | ||
// All rights reserved. Licensed under the MIT license. | ||
// ========================================================================== | ||
|
||
using System.Security.Claims; | ||
using Microsoft.AspNetCore.Authentication.OpenIdConnect; | ||
|
||
namespace Notifo.Identity; | ||
|
||
public sealed class OidcHandler : OpenIdConnectEvents | ||
{ | ||
private readonly NotifoIdentityOptions options; | ||
|
||
public OidcHandler(NotifoIdentityOptions options) | ||
{ | ||
this.options = options; | ||
} | ||
|
||
public override Task RedirectToIdentityProviderForSignOut(RedirectContext context) | ||
{ | ||
if (!string.IsNullOrEmpty(options.OidcOnSignoutRedirectUrl)) | ||
{ | ||
var logoutUri = options.OidcOnSignoutRedirectUrl; | ||
|
||
context.Response.Redirect(logoutUri); | ||
context.HandleResponse(); | ||
|
||
return Task.CompletedTask; | ||
} | ||
|
||
return base.RedirectToIdentityProviderForSignOut(context); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...d/src/Notifo.Infrastructure/Collections/Bson/ReadonlyDictionarySerializer{TKey,TValue}.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// ========================================================================== | ||
// Notifo.io | ||
// ========================================================================== | ||
// Copyright (c) Sebastian Stehle | ||
// All rights reserved. Licensed under the MIT license. | ||
// ========================================================================== | ||
|
||
using MongoDB.Bson.Serialization; | ||
using MongoDB.Bson.Serialization.Serializers; | ||
|
||
namespace Notifo.Infrastructure.Collections.Bson; | ||
|
||
public sealed class ReadonlyDictionarySerializer<TKey, TValue> : ClassSerializerBase<ReadonlyDictionary<TKey, TValue>> where TKey : notnull | ||
{ | ||
private readonly Type innerType = typeof(Dictionary<TKey, TValue>); | ||
|
||
protected override ReadonlyDictionary<TKey, TValue> DeserializeValue(BsonDeserializationContext context, BsonDeserializationArgs args) | ||
{ | ||
var inner = BsonSerializer.Deserialize<Dictionary<TKey, TValue>>(context.Reader); | ||
|
||
return new ReadonlyDictionary<TKey, TValue>(inner); | ||
} | ||
|
||
protected override void SerializeValue(BsonSerializationContext context, BsonSerializationArgs args, ReadonlyDictionary<TKey, TValue> value) | ||
{ | ||
var inner = new Dictionary<TKey, TValue>(value); | ||
|
||
BsonSerializer.Serialize(context.Writer, innerType, inner); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.