-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
362d36f
commit 5c6eb4a
Showing
17 changed files
with
422 additions
and
3 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
src/Umbraco.Core/Webhooks/Events/User/AssignedUserGroupPermissionsWebhookEvent.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,25 @@ | ||
using Microsoft.Extensions.Options; | ||
using Umbraco.Cms.Core.Configuration.Models; | ||
using Umbraco.Cms.Core.Notifications; | ||
using Umbraco.Cms.Core.Services; | ||
using Umbraco.Cms.Core.Sync; | ||
|
||
namespace Umbraco.Cms.Core.Webhooks.Events.User; | ||
|
||
[WebhookEvent("User Group Permissions Assigned")] | ||
public class AssignedUserGroupPermissionsWebhookEvent : WebhookEventBase<AssignedUserGroupPermissionsNotification> | ||
{ | ||
public AssignedUserGroupPermissionsWebhookEvent( | ||
IWebhookFiringService webhookFiringService, | ||
IWebhookService webHookService, | ||
IOptionsMonitor<WebhookSettings> webhookSettings, | ||
IServerRoleAccessor serverRoleAccessor) | ||
: base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) | ||
{ | ||
} | ||
|
||
public override string Alias => "assignedUserGroupPermissions"; | ||
|
||
public override object? ConvertNotificationToRequestPayload(AssignedUserGroupPermissionsNotification notification) | ||
=> notification.EntityPermissions; | ||
} |
39 changes: 39 additions & 0 deletions
39
src/Umbraco.Core/Webhooks/Events/User/UserDeletedWebhookEvent.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,39 @@ | ||
using Microsoft.Extensions.Options; | ||
using Umbraco.Cms.Core.Configuration.Models; | ||
using Umbraco.Cms.Core.Notifications; | ||
using Umbraco.Cms.Core.Services; | ||
using Umbraco.Cms.Core.Sync; | ||
|
||
namespace Umbraco.Cms.Core.Webhooks.Events.User; | ||
|
||
[WebhookEvent("User Deleted")] | ||
public class UserDeletedWebhookEvent : WebhookEventBase<UserDeletedNotification> | ||
{ | ||
public UserDeletedWebhookEvent( | ||
IWebhookFiringService webhookFiringService, | ||
IWebhookService webHookService, | ||
IOptionsMonitor<WebhookSettings> webhookSettings, | ||
IServerRoleAccessor serverRoleAccessor) | ||
: base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) | ||
{ | ||
} | ||
|
||
public override string Alias => "userDeleted"; | ||
|
||
public override object? ConvertNotificationToRequestPayload(UserDeletedNotification notification) | ||
{ | ||
// TODO: Map more stuff here | ||
var result = notification.DeletedEntities.Select(entity => new | ||
{ | ||
entity.Id, | ||
entity.Key, | ||
entity.Name, | ||
entity.Language, | ||
entity.Email, | ||
entity.Username, | ||
entity.FailedPasswordAttempts | ||
}); | ||
|
||
return result; | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/Umbraco.Core/Webhooks/Events/User/UserForgotPasswordRequestedWebhookEvent.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,23 @@ | ||
using Microsoft.Extensions.Options; | ||
using Umbraco.Cms.Core.Configuration.Models; | ||
using Umbraco.Cms.Core.Notifications; | ||
using Umbraco.Cms.Core.Services; | ||
using Umbraco.Cms.Core.Sync; | ||
|
||
namespace Umbraco.Cms.Core.Webhooks.Events.User; | ||
|
||
[WebhookEvent("User Forgot Password Requested")] | ||
public class UserForgotPasswordRequestedWebhookEvent : WebhookEventBase<UserForgotPasswordRequestedNotification> | ||
{ | ||
public UserForgotPasswordRequestedWebhookEvent( | ||
IWebhookFiringService webhookFiringService, | ||
IWebhookService webHookService, | ||
IOptionsMonitor<WebhookSettings> webhookSettings, | ||
IServerRoleAccessor serverRoleAccessor) | ||
: base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) | ||
{ | ||
} | ||
|
||
public override string Alias => "userForgotPasswordRequested"; | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
src/Umbraco.Core/Webhooks/Events/User/UserForgottenPasswordRequestedWebhookEvent.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,22 @@ | ||
using Microsoft.Extensions.Options; | ||
using Umbraco.Cms.Core.Configuration.Models; | ||
using Umbraco.Cms.Core.Notifications; | ||
using Umbraco.Cms.Core.Services; | ||
using Umbraco.Cms.Core.Sync; | ||
|
||
namespace Umbraco.Cms.Core.Webhooks.Events.User; | ||
|
||
[WebhookEvent("User Forgotten Password Requested")] | ||
public class UserForgottenPasswordRequestedWebhookEvent : WebhookEventBase<UserForgotPasswordRequestedNotification> | ||
{ | ||
public UserForgottenPasswordRequestedWebhookEvent( | ||
IWebhookFiringService webhookFiringService, | ||
IWebhookService webHookService, | ||
IOptionsMonitor<WebhookSettings> webhookSettings, | ||
IServerRoleAccessor serverRoleAccessor) | ||
: base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) | ||
{ | ||
} | ||
|
||
public override string Alias => "userForgottenPasswordRequested"; | ||
} |
24 changes: 24 additions & 0 deletions
24
src/Umbraco.Core/Webhooks/Events/User/UserGroupDeletedWebhookEvent.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,24 @@ | ||
using Microsoft.Extensions.Options; | ||
using Umbraco.Cms.Core.Configuration.Models; | ||
using Umbraco.Cms.Core.Notifications; | ||
using Umbraco.Cms.Core.Services; | ||
using Umbraco.Cms.Core.Sync; | ||
|
||
namespace Umbraco.Cms.Core.Webhooks.Events.User; | ||
|
||
[WebhookEvent("User Group Deleted")] | ||
public class UserGroupDeletedWebhookEvent : WebhookEventBase<UserGroupDeletedNotification> | ||
{ | ||
public UserGroupDeletedWebhookEvent( | ||
IWebhookFiringService webhookFiringService, | ||
IWebhookService webHookService, | ||
IOptionsMonitor<WebhookSettings> webhookSettings, | ||
IServerRoleAccessor serverRoleAccessor) | ||
: base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) | ||
{ | ||
} | ||
|
||
public override string Alias => "userGroupDeleted"; | ||
|
||
public override object? ConvertNotificationToRequestPayload(UserGroupDeletedNotification notification) => notification.DeletedEntities; | ||
} |
24 changes: 24 additions & 0 deletions
24
src/Umbraco.Core/Webhooks/Events/User/UserGroupSavedWebhookEvent.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,24 @@ | ||
using Microsoft.Extensions.Options; | ||
using Umbraco.Cms.Core.Configuration.Models; | ||
using Umbraco.Cms.Core.Notifications; | ||
using Umbraco.Cms.Core.Services; | ||
using Umbraco.Cms.Core.Sync; | ||
|
||
namespace Umbraco.Cms.Core.Webhooks.Events.User; | ||
|
||
[WebhookEvent("User Group Saved")] | ||
public class UserGroupSavedWebhookEvent : WebhookEventBase<UserGroupSavedNotification> | ||
{ | ||
public UserGroupSavedWebhookEvent( | ||
IWebhookFiringService webhookFiringService, | ||
IWebhookService webHookService, | ||
IOptionsMonitor<WebhookSettings> webhookSettings, | ||
IServerRoleAccessor serverRoleAccessor) | ||
: base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) | ||
{ | ||
} | ||
|
||
public override string Alias => "userGroupSaved"; | ||
|
||
public override object? ConvertNotificationToRequestPayload(UserGroupSavedNotification notification) => notification.SavedEntities; | ||
} |
22 changes: 22 additions & 0 deletions
22
src/Umbraco.Core/Webhooks/Events/User/UserLockedWebhookEvent.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,22 @@ | ||
using Microsoft.Extensions.Options; | ||
using Umbraco.Cms.Core.Configuration.Models; | ||
using Umbraco.Cms.Core.Notifications; | ||
using Umbraco.Cms.Core.Services; | ||
using Umbraco.Cms.Core.Sync; | ||
|
||
namespace Umbraco.Cms.Core.Webhooks.Events.User; | ||
|
||
[WebhookEvent("User Locked")] | ||
public class UserLockedWebhookEvent : WebhookEventBase<UserLockedNotification> | ||
{ | ||
public UserLockedWebhookEvent( | ||
IWebhookFiringService webhookFiringService, | ||
IWebhookService webHookService, | ||
IOptionsMonitor<WebhookSettings> webhookSettings, | ||
IServerRoleAccessor serverRoleAccessor) | ||
: base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) | ||
{ | ||
} | ||
|
||
public override string Alias => "userLocked"; | ||
} |
22 changes: 22 additions & 0 deletions
22
src/Umbraco.Core/Webhooks/Events/User/UserLoginFailedWebhookEvent.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,22 @@ | ||
using Microsoft.Extensions.Options; | ||
using Umbraco.Cms.Core.Configuration.Models; | ||
using Umbraco.Cms.Core.Notifications; | ||
using Umbraco.Cms.Core.Services; | ||
using Umbraco.Cms.Core.Sync; | ||
|
||
namespace Umbraco.Cms.Core.Webhooks.Events.User; | ||
|
||
[WebhookEvent("User Login Failed")] | ||
public class UserLoginFailedWebhookEvent : WebhookEventBase<UserLoginFailedNotification> | ||
{ | ||
public UserLoginFailedWebhookEvent( | ||
IWebhookFiringService webhookFiringService, | ||
IWebhookService webHookService, | ||
IOptionsMonitor<WebhookSettings> webhookSettings, | ||
IServerRoleAccessor serverRoleAccessor) | ||
: base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) | ||
{ | ||
} | ||
|
||
public override string Alias => "userLoginFailed"; | ||
} |
23 changes: 23 additions & 0 deletions
23
src/Umbraco.Core/Webhooks/Events/User/UserLoginRequiresVerificationWebhookEvent.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,23 @@ | ||
using Microsoft.Extensions.Options; | ||
using Umbraco.Cms.Core.Configuration.Models; | ||
using Umbraco.Cms.Core.Notifications; | ||
using Umbraco.Cms.Core.Services; | ||
using Umbraco.Cms.Core.Sync; | ||
|
||
namespace Umbraco.Cms.Core.Webhooks.Events.User; | ||
|
||
[WebhookEvent("User Login Requires Verification")] | ||
public class UserLoginRequiresVerificationWebhookEvent : WebhookEventBase<UserLoginRequiresVerificationNotification> | ||
{ | ||
public UserLoginRequiresVerificationWebhookEvent( | ||
IWebhookFiringService webhookFiringService, | ||
IWebhookService webHookService, | ||
IOptionsMonitor<WebhookSettings> webhookSettings, | ||
IServerRoleAccessor serverRoleAccessor) | ||
: base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) | ||
{ | ||
} | ||
|
||
public override string Alias => "userLoginRequiresVerification"; | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
src/Umbraco.Core/Webhooks/Events/User/UserLoginSuccessWebhookEvent.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,22 @@ | ||
using Microsoft.Extensions.Options; | ||
using Umbraco.Cms.Core.Configuration.Models; | ||
using Umbraco.Cms.Core.Notifications; | ||
using Umbraco.Cms.Core.Services; | ||
using Umbraco.Cms.Core.Sync; | ||
|
||
namespace Umbraco.Cms.Core.Webhooks.Events.User; | ||
|
||
[WebhookEvent("User Login Success")] | ||
public class UserLoginSuccessWebhookEvent : WebhookEventBase<UserLoginSuccessNotification> | ||
{ | ||
public UserLoginSuccessWebhookEvent( | ||
IWebhookFiringService webhookFiringService, | ||
IWebhookService webHookService, | ||
IOptionsMonitor<WebhookSettings> webhookSettings, | ||
IServerRoleAccessor serverRoleAccessor) | ||
: base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) | ||
{ | ||
} | ||
|
||
public override string Alias => "userLoginSuccess"; | ||
} |
22 changes: 22 additions & 0 deletions
22
src/Umbraco.Core/Webhooks/Events/User/UserLogoutSuccessWebhookEvent.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,22 @@ | ||
using Microsoft.Extensions.Options; | ||
using Umbraco.Cms.Core.Configuration.Models; | ||
using Umbraco.Cms.Core.Notifications; | ||
using Umbraco.Cms.Core.Services; | ||
using Umbraco.Cms.Core.Sync; | ||
|
||
namespace Umbraco.Cms.Core.Webhooks.Events.User; | ||
|
||
[WebhookEvent("User Login Success")] | ||
public class UserLogoutSuccessWebhookEvent : WebhookEventBase<UserLogoutSuccessNotification> | ||
{ | ||
public UserLogoutSuccessWebhookEvent( | ||
IWebhookFiringService webhookFiringService, | ||
IWebhookService webHookService, | ||
IOptionsMonitor<WebhookSettings> webhookSettings, | ||
IServerRoleAccessor serverRoleAccessor) | ||
: base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) | ||
{ | ||
} | ||
|
||
public override string Alias => "userLogoutSuccess"; | ||
} |
23 changes: 23 additions & 0 deletions
23
src/Umbraco.Core/Webhooks/Events/User/UserPasswordChangedWebhookEvent.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,23 @@ | ||
using Microsoft.Extensions.Options; | ||
using Umbraco.Cms.Core.Configuration.Models; | ||
using Umbraco.Cms.Core.Notifications; | ||
using Umbraco.Cms.Core.Services; | ||
using Umbraco.Cms.Core.Sync; | ||
|
||
namespace Umbraco.Cms.Core.Webhooks.Events.User; | ||
|
||
[WebhookEvent("User Password Changed")] | ||
public class UserPasswordChangedWebhookEvent : WebhookEventBase<UserPasswordChangedNotification> | ||
{ | ||
public UserPasswordChangedWebhookEvent( | ||
IWebhookFiringService webhookFiringService, | ||
IWebhookService webHookService, | ||
IOptionsMonitor<WebhookSettings> webhookSettings, | ||
IServerRoleAccessor serverRoleAccessor) | ||
: base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) | ||
{ | ||
} | ||
|
||
public override string Alias => "userPasswordChanged"; | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
src/Umbraco.Core/Webhooks/Events/User/UserPasswordResetWebhookEvent.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,22 @@ | ||
using Microsoft.Extensions.Options; | ||
using Umbraco.Cms.Core.Configuration.Models; | ||
using Umbraco.Cms.Core.Notifications; | ||
using Umbraco.Cms.Core.Services; | ||
using Umbraco.Cms.Core.Sync; | ||
|
||
namespace Umbraco.Cms.Core.Webhooks.Events.User; | ||
|
||
[WebhookEvent("User Password Reset")] | ||
public class UserPasswordResetWebhookEvent : WebhookEventBase<UserPasswordResetNotification> | ||
{ | ||
public UserPasswordResetWebhookEvent( | ||
IWebhookFiringService webhookFiringService, | ||
IWebhookService webHookService, | ||
IOptionsMonitor<WebhookSettings> webhookSettings, | ||
IServerRoleAccessor serverRoleAccessor) | ||
: base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) | ||
{ | ||
} | ||
|
||
public override string Alias => "userPasswordReset"; | ||
} |
39 changes: 39 additions & 0 deletions
39
src/Umbraco.Core/Webhooks/Events/User/UserSavedWebhookEvent.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,39 @@ | ||
using Microsoft.Extensions.Options; | ||
using Umbraco.Cms.Core.Configuration.Models; | ||
using Umbraco.Cms.Core.Notifications; | ||
using Umbraco.Cms.Core.Services; | ||
using Umbraco.Cms.Core.Sync; | ||
|
||
namespace Umbraco.Cms.Core.Webhooks.Events.User; | ||
|
||
[WebhookEvent("User Saved")] | ||
public class UserSavedWebhookEvent : WebhookEventBase<UserSavedNotification> | ||
{ | ||
public UserSavedWebhookEvent( | ||
IWebhookFiringService webhookFiringService, | ||
IWebhookService webHookService, | ||
IOptionsMonitor<WebhookSettings> webhookSettings, | ||
IServerRoleAccessor serverRoleAccessor) | ||
: base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) | ||
{ | ||
} | ||
|
||
public override string Alias => "userSaved"; | ||
|
||
public override object? ConvertNotificationToRequestPayload(UserSavedNotification notification) | ||
{ | ||
// TODO: Map more stuff here | ||
var result = notification.SavedEntities.Select(entity => new | ||
{ | ||
entity.Id, | ||
entity.Key, | ||
entity.Name, | ||
entity.Language, | ||
entity.Email, | ||
entity.Username, | ||
entity.FailedPasswordAttempts | ||
}); | ||
|
||
return result; | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/Umbraco.Core/Webhooks/Events/User/UserTwoFactorRequestedWebhookEvent.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,23 @@ | ||
using Microsoft.Extensions.Options; | ||
using Umbraco.Cms.Core.Configuration.Models; | ||
using Umbraco.Cms.Core.Notifications; | ||
using Umbraco.Cms.Core.Services; | ||
using Umbraco.Cms.Core.Sync; | ||
|
||
namespace Umbraco.Cms.Core.Webhooks.Events.User; | ||
|
||
[WebhookEvent("User Two Factor Requested")] | ||
public class UserTwoFactorRequestedWebhookEvent : WebhookEventBase<UserTwoFactorRequestedNotification> | ||
{ | ||
public UserTwoFactorRequestedWebhookEvent( | ||
IWebhookFiringService webhookFiringService, | ||
IWebhookService webHookService, | ||
IOptionsMonitor<WebhookSettings> webhookSettings, | ||
IServerRoleAccessor serverRoleAccessor) | ||
: base(webhookFiringService, webHookService, webhookSettings, serverRoleAccessor) | ||
{ | ||
} | ||
|
||
public override string Alias => "userTwoFactorRequested"; | ||
|
||
} |
Oops, something went wrong.