Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push support for Connectors via server sent events #691

Merged
merged 59 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
2d6fe3b
feat: add SseServer project
tnotheis Jun 5, 2024
270ea59
fix: don't raise domain event in FinalizeSyncRun Handler
tnotheis Jun 6, 2024
d60b661
feat: only trigger one DatawalletModifiedDomainEvent, no matter how m…
tnotheis Jun 6, 2024
4d2bbb7
fix: use string for properties in DatawalletModifiedDomainEvent
tnotheis Jun 6, 2024
5ec3d46
chore: move TraceIdMiddleware.cs to BuildingBlocks.API
tnotheis Jun 6, 2024
f3b89ce
chore: formatting
tnotheis Jun 6, 2024
9828418
feat: add JwtSigningCertificate to ConsumerApi appsettings.override.json
tnotheis Jun 6, 2024
83a1409
chore: remove RequestResponseTimeMiddleware ResponseDurationMiddlewar…
tnotheis Jun 6, 2024
cd40a2d
feat: implement SseServer
tnotheis Jun 7, 2024
f513148
feat: add SseConnector
tnotheis Jun 7, 2024
6f13063
chore: throw NotSupportedException instead of NotImplementedException…
tnotheis Jun 7, 2024
1260e21
Merge branch 'refs/heads/main' into server-sent-events
tnotheis Jun 11, 2024
eac5360
chore: cleanup Configuration.cs
tnotheis Jun 11, 2024
258a41a
chore: formatting
tnotheis Jun 11, 2024
9599449
feat: make JwtSigningCertificate config required
tnotheis Jun 11, 2024
61d8a28
refactor: extract method to get push notification name into extension…
tnotheis Jun 11, 2024
05ea92a
feat: catch exception during send in SseServerClient
tnotheis Jun 11, 2024
9249d34
feat: only send event name
tnotheis Jun 11, 2024
d45070c
chore: enable SSE for local development
tnotheis Jun 11, 2024
a161d72
refactor: extract extension method
tnotheis Jun 11, 2024
ddd507c
chore: improve folder structure
tnotheis Jun 11, 2024
62261a2
fix: don't add success if there is no success
tnotheis Jun 11, 2024
fc3c97a
refactor: add ISseServerClient
tnotheis Jun 11, 2024
53690c6
test: add SseConnectorTests.cs
tnotheis Jun 11, 2024
d63bc8c
test: introduce BeEquivalentToJson extension method
tnotheis Jun 11, 2024
84ab225
refactor: extract request building logic into SseMessageBuilder
tnotheis Jun 11, 2024
99a11c0
chore: introduce log event ids
tnotheis Jun 11, 2024
4b61771
refactor: rename SseConnector to ServerSentEventsConnector
tnotheis Jun 11, 2024
2984687
chore: move SseServer project to "SseServer/src" folder
tnotheis Jun 11, 2024
d0c926c
test: add tests for EventQueue
tnotheis Jun 11, 2024
2949d64
chore: rename database health checks from "<moduleName>" to "<moduleN…
tnotheis Jun 12, 2024
003745c
feat: add health check to SseServer
tnotheis Jun 12, 2024
42c5e9c
feat: add SseServer health check to Consumer API health check
tnotheis Jun 12, 2024
4d9b2f5
feat: add Dockerfile for SseServer
tnotheis Jun 12, 2024
f319ec1
chore: add SseServer to Backbone.run.xml
tnotheis Jun 12, 2024
e61e3e4
ci: add sse server to build and publish pipelines
tnotheis Jun 12, 2024
76f74e4
chore: make buildContainerImage.js script executable
tnotheis Jun 12, 2024
7b0b50c
Merge branch 'main' into server-sent-events
tnotheis Jun 12, 2024
18f035b
Merge branch 'server-sent-events' of github.com:nmshd/backbone into s…
tnotheis Jun 12, 2024
86a820b
chore: fix formatting
tnotheis Jun 12, 2024
68f21e6
test: fix test
tnotheis Jun 12, 2024
d1fa99d
feat: add sseserver to helm chart
tnotheis Jun 12, 2024
19ca11f
ci: add sse server to docker-compose.test.yml
tnotheis Jun 12, 2024
babfab2
chore: minor changes
tnotheis Jun 12, 2024
654672a
feat: only enable sse health check if sse is enabled
tnotheis Jun 12, 2024
0c5ca2c
ci: add JwtSigningCertificate to pipeline configs
tnotheis Jun 12, 2024
b051da8
feat: only create sse resources if sse provider is enabled in config
tnotheis Jun 12, 2024
80286cd
test: import FluentAssertions.Json in StringAssertionsExtensions to m…
tnotheis Jun 12, 2024
e16c1a0
test: cleanup
tnotheis Jun 12, 2024
d4a4207
test: remove unused code
tnotheis Jun 12, 2024
1caa086
chore: add local logging overrides for eventhandlerservice
tnotheis Jun 12, 2024
4f5e6a3
chore: explicitly AllowAnonymous for "/{address}/events" route
tnotheis Jun 12, 2024
f78ba3d
chore: remove redundant configuration from sseserver's appsettings.json
tnotheis Jun 12, 2024
9b3c941
feat: make Modules property in SseServer's configuration required
tnotheis Jun 12, 2024
2547d2b
chore: remove commented out code
tnotheis Jun 12, 2024
b25ce16
Merge branch 'main' into server-sent-events
tnotheis Jun 12, 2024
e45f9bc
chore: add explaining comments to the call of the UpdateDeviceRegistr…
tnotheis Jun 12, 2024
becb5ec
ci: fix job name
tnotheis Jun 13, 2024
11a0db8
fix: remove publishing of TierOfIdentityChangedDomainEvent from Handlers
tnotheis Jun 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .ci/appsettings.override.postgres.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
"AccessControlAllowCredentials": true
},
"Authentication": {
"ApiKey": "test"
"ApiKey": "test",
"JwtSigningCertificate": "MIIJ7wIBAzCCCaUGCSqGSIb3DQEHAaCCCZYEggmSMIIJjjCCBAIGCSqGSIb3DQEHBqCCA/MwggPvAgEAMIID6AYJKoZIhvcNAQcBMFcGCSqGSIb3DQEFDTBKMCkGCSqGSIb3DQEFDDAcBAiIVEGIEnzbyAICCAAwDAYIKoZIhvcNAgkFADAdBglghkgBZQMEASoEEC1tOaulJJjkAl2W7xeF3G6AggOAm1VdXzAQ6MhHabp6+rzEuaAyBpuMi8zD8OEl8/xMv47UsFUor38aZjQd14qTTLz5MnksI/qgjQHLuMEmN1eWARsUBkeYvLuz0icl2q9A5Rn9CaKHIemQWq9mIobq3XnXhwDFEd+G/WgjNoK65Ndu20pnuc9LDlfq6fx2eXDbHAWLeUTnlQsEY4M/owNK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RlKYRGpS16yhG0ZdRwBJweDoitK091ooN6Um74eO17dH0jAQw3XPBxgJ64qEdSzfJ/xybM45BSUPAft2wXXlckLOId9Us56oV7WeszTOkOPDKz9GnKT05xPXNDgAqstVZc0nXEq0eFzTORREBP0w2ijwPu9mfPvRACY8p7YMnNbZzMGBvpa3ILezRIgThMbnzf+YiBP2Ddt9bWoxDsIj7jaqDzxjG2WtI1qGEqFyLCeUkSx2UpkbGViCkx8CsMwXJwLrYdoxqjyOg2Oz09EFF5eI1wkLqEtez8dOTLEn7oFjTyFbRkNoynuwvNqHEG2qzbw02Rb82qyrurKmOnNHog7FXLDe0kGFgKuNXbCw+to2lAhWY0CmEe8qfQLeAiV3TsGHSrGSkoegmfPHsuboCdez/ETJZWoodryUPdY3PFNa0xZOJvbtkiG2Vo55Rjq9wbd+MWAGcxhaCVEmEJ0UWWsn3Oe+h4mn3wT9+P+hkAR9duXT6tq+5DmKB2RD3fR3vIc4H5eLaIzOOmjSdfGFvIaj+06jS7SGicuKqF5ND4HPtXJrQgQUdO/gIHCkE9nn4hXCoz/bGkU4FN2WPz5TTMVsYuxMVp1I2UayoQppltkp3oaDb/S36FeO644d5zb7ARayF68NL5MrM/MRK24jhtx2WV4ZN9HIxJTAjBgkqhkiG9w0BCRUxFgQU/S6zDu6S3P4i1WdDz+j3esGxT4UwQTAxMA0GCWCGSAFlAwQCAQUABCCiOwVWGDHil8dA7XvoQNTLTJDm7EwdfGC4KJUV9smgUgQI4ZRrDNXXl8cCAggA",
Dannyps marked this conversation as resolved.
Show resolved Hide resolved
"JwtLifetimeInSeconds": 300
},
"Infrastructure": {
"EventBus": {
Expand Down
4 changes: 3 additions & 1 deletion .ci/appsettings.override.sqlserver.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
"AccessControlAllowCredentials": true
},
"Authentication": {
"ApiKey": "test"
"ApiKey": "test",
"JwtSigningCertificate": "MIIJ7wIBAzCCCaUGCSqGSIb3DQEHAaCCCZYEggmSMIIJ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z+j3esGxT4UwQTAxMA0GCWCGSAFlAwQCAQUABCCiOwVWGDHil8dA7XvoQNTLTJDm7EwdfGC4KJUV9smgUgQI4ZRrDNXXl8cCAggA",
"JwtLifetimeInSeconds": 300
},
"Infrastructure": {
"EventBus": {
Expand Down
11 changes: 11 additions & 0 deletions .ci/docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,17 @@ services:
- source: Config
target: app/appsettings.override.json

sse-server:
container_name: sse-server-test
build:
context: ..
dockerfile: SseServer/src/SseServer/Dockerfile
environment:
- ASPNETCORE_ENVIRONMENT=Development
configs:
- source: Config
target: app/appsettings.override.json

database-migrator:
container_name: database-migrator-test
build:
Expand Down
11 changes: 11 additions & 0 deletions .ci/sses/buildContainerImage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env node

import { $ } from "zx";
import { getRequiredEnvVar } from "../lib.js";

const tag = getRequiredEnvVar("TAG");

const platforms = process.env.PLATFORMS ?? "linux/amd64,linux/arm64";
const push = process.env.PUSH === "1" ? ["--push", "--provenance=true", "--sbom=true"] : "";

await $`docker buildx build --file ./SseServer/src/SseServer/Dockerfile --tag ghcr.io/nmshd/backbone-sse-server:${tag} --platform ${platforms} ${push} .`;
33 changes: 32 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ jobs:
PUSH: 1

publish-identity-deletion-jobs:
name: Publish Identity Deletion Jobs Image
name: Publish Identity Deletion Jobs Container Image
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down Expand Up @@ -195,6 +195,37 @@ jobs:
TAG: ${{ github.ref_name }}
PUSH: 1

publish-sse-server:
name: Publish SSE Server Container Image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install script dependencies
run: npm install --prefix ./.ci
- name: Docker Login
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log in to Docker Hub for accessing the cloud builder
uses: docker/login-action@v3
with:
username: ${{ secrets.CLOUD_BUILDER_USERNAME }}
password: ${{ secrets.CLOUD_BUILDER_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: "lab:latest"
driver: cloud
endpoint: "jssoft/js-soft"
- name: Build and Push Container Image
run: ./.ci/sses/buildContainerImage.js
env:
TAG: ${{ github.ref_name }}
PUSH: 1

publish-helm-chart:
name: Publish Helm Chart
runs-on: ubuntu-latest
Expand Down
18 changes: 17 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ jobs:
PLATFORMS: linux/amd64

build-idj-container-image:
name: Build Database Migrator Container Image
name: Build Identity Deletion Jobs Container Image
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down Expand Up @@ -297,6 +297,22 @@ jobs:
TAG: test
PLATFORMS: linux/amd64

build-sses-container-image:
name: Build SSE Server Container Image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install script dependencies
run: npm install --prefix ./.ci
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build image
run: ./.ci/sses/buildContainerImage.js
env:
TAG: test
PLATFORMS: linux/amd64

build-fsc-container-image:
name: Build Files Sanity Check Container Image
runs-on: ubuntu-latest
Expand Down
14 changes: 13 additions & 1 deletion .run/Backbone.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,19 @@
</ExecutableSnapshot>
</option>
</ExecutableRowSnapshot>
<ExecutableRowSnapshot>
<option name="condition">
<ConditionSnapshot>
<option name="type" value="immediately"/>
</ConditionSnapshot>
</option>
<option name="executable">
<ExecutableSnapshot>
<option name="id" value="runConfig:.NET Launch Settings Profile.SSE Server"/>
</ExecutableSnapshot>
</option>
</ExecutableRowSnapshot>
</rows>
<method v="2" />
</configuration>
</component>
</component>
17 changes: 17 additions & 0 deletions .run/SSE Server.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="SSE Server" type="LaunchSettings" factoryName=".NET Launch Settings Profile">
<option name="LAUNCH_PROFILE_PROJECT_FILE_PATH" value="$PROJECT_DIR$/SseServer/src/SseServer/SseServer.csproj"/>
<option name="LAUNCH_PROFILE_TFM" value="net8.0"/>
<option name="LAUNCH_PROFILE_NAME" value="Default"/>
<option name="USE_EXTERNAL_CONSOLE" value="0"/>
<option name="USE_MONO" value="0"/>
<option name="RUNTIME_ARGUMENTS" value=""/>
<option name="GENERATE_APPLICATIONHOST_CONFIG" value="1"/>
<option name="SHOW_IIS_EXPRESS_OUTPUT" value="0"/>
<option name="SEND_DEBUG_REQUEST" value="1"/>
<option name="ADDITIONAL_IIS_EXPRESS_ARGUMENTS" value=""/>
<method v="2">
<option name="Build"/>
</method>
</configuration>
</component>
2 changes: 0 additions & 2 deletions AdminApi/src/AdminApi/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,6 @@ publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj

Expand Down
22 changes: 22 additions & 0 deletions Backbone.sln
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,16 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DatabaseMigrator", "Databas
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tokens.Domain.Tests", "Modules\Tokens\test\Tokens.Domain.Tests\Tokens.Domain.Tests.csproj", "{EDCB84BE-54C3-4CAD-977E-45EEBEFA1402}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SseServer", "SseServer\src\SseServer\SseServer.csproj", "{434C078E-D738-4C19-AB89-5F56B57EDA7C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SseServer", "SseServer", "{4C2E211B-37C8-4449-9595-7D019AC92AC3}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{AAE548AB-4843-476A-BF61-002CF6FEE713}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{824495A9-A255-487D-AF26-6F6CA92BC715}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SseServerTests", "SseServer\test\SseServerTests\SseServerTests.csproj", "{94A32246-991D-483D-8241-E1E4DD6DE145}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -721,6 +731,14 @@ Global
{EDCB84BE-54C3-4CAD-977E-45EEBEFA1402}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EDCB84BE-54C3-4CAD-977E-45EEBEFA1402}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EDCB84BE-54C3-4CAD-977E-45EEBEFA1402}.Release|Any CPU.Build.0 = Release|Any CPU
{434C078E-D738-4C19-AB89-5F56B57EDA7C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{434C078E-D738-4C19-AB89-5F56B57EDA7C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{434C078E-D738-4C19-AB89-5F56B57EDA7C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{434C078E-D738-4C19-AB89-5F56B57EDA7C}.Release|Any CPU.Build.0 = Release|Any CPU
{94A32246-991D-483D-8241-E1E4DD6DE145}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{94A32246-991D-483D-8241-E1E4DD6DE145}.Debug|Any CPU.Build.0 = Debug|Any CPU
{94A32246-991D-483D-8241-E1E4DD6DE145}.Release|Any CPU.ActiveCfg = Release|Any CPU
{94A32246-991D-483D-8241-E1E4DD6DE145}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -856,6 +874,10 @@ Global
{B4664E79-77A5-41AE-8480-C449ED5B2576} = {D54A9259-7708-45C1-B8D9-448B97F43B80}
{D47E0FE1-23A0-4A96-AF57-E3CE71A132AD} = {2429FCAB-2058-4403-94DA-DA26B1655A7D}
{EDCB84BE-54C3-4CAD-977E-45EEBEFA1402} = {1E437DEA-7657-48AD-ADA0-7B86608E0768}
{AAE548AB-4843-476A-BF61-002CF6FEE713} = {4C2E211B-37C8-4449-9595-7D019AC92AC3}
{434C078E-D738-4C19-AB89-5F56B57EDA7C} = {AAE548AB-4843-476A-BF61-002CF6FEE713}
{824495A9-A255-487D-AF26-6F6CA92BC715} = {4C2E211B-37C8-4449-9595-7D019AC92AC3}
{94A32246-991D-483D-8241-E1E4DD6DE145} = {824495A9-A255-487D-AF26-6F6CA92BC715}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {1F3BD2C6-7CB3-450F-A21A-23EA520D5B7A}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ public static void AddSqlDatabaseHealthCheck(this IServiceCollection services, s
case "SqlServer":
services.AddHealthChecks().AddSqlServer(
connectionString,
name: name
name: $"{name}Database"
);
break;
case "Postgres":
services.AddHealthChecks().AddNpgSql(
connectionString: connectionString,
name: name);
name: $"{name}Database"
);
break;
default:
throw new Exception($"Unsupported database provider: {provider}");
Expand Down Expand Up @@ -53,37 +54,37 @@ public static IServiceCollection AddModule<TModule>(this IServiceCollection serv
public static IServiceCollection AddCustomIdentity(this IServiceCollection services, IHostEnvironment environment)
{
services.AddIdentity<ApplicationUser, IdentityRole>(options =>
{
if (environment.IsDevelopment() || environment.IsLocal())
{
options.Password.RequiredLength = 1;
options.Password.RequireUppercase = false;
options.Password.RequireLowercase = false;
options.Password.RequireDigit = false;
options.Password.RequireNonAlphanumeric = false;
if (environment.IsDevelopment() || environment.IsLocal())
{
options.Password.RequiredLength = 1;
options.Password.RequireUppercase = false;
options.Password.RequireLowercase = false;
options.Password.RequireDigit = false;
options.Password.RequireNonAlphanumeric = false;

options.User.AllowedUserNameCharacters += " ";
options.User.AllowedUserNameCharacters += " ";

options.Lockout.AllowedForNewUsers = true;
options.Lockout.DefaultLockoutTimeSpan = TimeSpan.FromMinutes(1);
options.Lockout.MaxFailedAccessAttempts = 3;
}
else
{
options.Password.RequiredLength = 10;
options.Password.RequireUppercase = true;
options.Password.RequireLowercase = true;
options.Password.RequireDigit = true;
options.Password.RequireNonAlphanumeric = true;
options.Lockout.AllowedForNewUsers = true;
options.Lockout.DefaultLockoutTimeSpan = TimeSpan.FromMinutes(1);
options.Lockout.MaxFailedAccessAttempts = 3;
}
else
{
options.Password.RequiredLength = 10;
options.Password.RequireUppercase = true;
options.Password.RequireLowercase = true;
options.Password.RequireDigit = true;
options.Password.RequireNonAlphanumeric = true;

options.Lockout.AllowedForNewUsers = true;
options.Lockout.DefaultLockoutTimeSpan = TimeSpan.FromMinutes(10);
options.Lockout.MaxFailedAccessAttempts = 3;
}
})
.AddEntityFrameworkStores<DevicesDbContext>()
.AddSignInManager<CustomSigninManager>()
.AddUserStore<CustomUserStore>();
options.Lockout.AllowedForNewUsers = true;
options.Lockout.DefaultLockoutTimeSpan = TimeSpan.FromMinutes(10);
options.Lockout.MaxFailedAccessAttempts = 3;
}
})
.AddEntityFrameworkStores<DevicesDbContext>()
.AddSignInManager<CustomSigninManager>()
.AddUserStore<CustomUserStore>();

services.AddScoped<ILookupNormalizer, CustomLookupNormalizer>();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace Backbone.ConsumerApi.Mvc.Middleware;
using Microsoft.AspNetCore.Http;

namespace Backbone.BuildingBlocks.API.Mvc.Middleware;

public class TraceIdMiddleware
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
namespace Backbone.BuildingBlocks.Application.PushNotifications;

public interface IPushNotification;

public static class IPushNotificationExtensions
{
private const string PUSH_NOTIFICATION_POSTFIX = "PushNotification";

public static string GetEventName(this IPushNotification pushNotification)
{
var notificationTypeName = pushNotification.GetType().Name;

if (notificationTypeName.Contains(PUSH_NOTIFICATION_POSTFIX))
return notificationTypeName.Replace(PUSH_NOTIFICATION_POSTFIX, "");

return "dynamic";
}
}
Loading