Files
Umbraco-CMS/src/Umbraco.Core/Constants-Configuration.cs
Nikolaj Geisle 1b34d33eb7 Webhooks administration from Backoffice (#15050)
* Create webhook models

* Define interfaces for service and repository

* Create Webhook dto and corresponding factory

* implement WebhookRepository.cs

* Remove entity name from models, as that should be resolved in mapping instead

* Add new table to schema creator

* Register repo for DI

* Remove more mentions of entityname

* Refactor repository to guids

* Implement WebhookService

* Use scopes in service

* Start creating tests for service

* Refactor delete to use Id and not entire entity

* Rework Webhooks to be able to have multiple entity keys

* Implement GetAll functionality

* Implement webhook controller

* Imeplement get all events action

* Add equalityComparer deletegate to Webhook

* Add datacontract attirbutes to properties

* Implement backoffice webhooks tree

* Implement first webhooks menu

* Make WebHookController authorized

* Update to have tabs with webhooks and logs

* Enable create overlay

* Push to entityKeys array

* Fix up pagination

* Implement delete functionality

* remove pagination

* add log view

* Fix create to be able to select more than one content type

* implement type name resolving for content

* Refactor to use less duplication

* Implement update functionality in frontend

* Rename database table

* Make multiple events possible

* create new event picker

* Refactor to actually add new database table with proper name

* Make it possible to select multiple events

* Fix updating current items

* Fix up update functionality after db rework

* Add webhook icon

* Switch to match heartcore icons

* Refactor to use bases instead of Enum

* Refactor to make IWebhookEvent to Collection, so it can be injected instead of using reflection

* Fix up frontend to match new models

* Fix integration tests

* Remove obsolete entity key from webhookdto

* Introduce constants instead of hard coded strings

* Start implementation of firing mechanism

* Add new GetByEventName method

* Add 1 to many list on WebhookDto

* Implement new repository pattern

* Implement GetByEventName

* Fix up repository to use all async

* Refactor events to fire

* Refactor WebhookEvents to be more DRY

* Add custom header

* Start implementing log repository

* Implement GetPaged

* Implement WebhookLogService

* Implement GetLogs

* Add url to webhook log

* Implement log overview

* Formatting

* Implement details view

* Refactor to get actual retry count

* Refactor firing to fire only when Enabled

* Add Status code to detailed view

* Add configuration to disable webhooks entirely

* Implement custom headers frontend

* Implement persistence of custom headers

* Refactor retry service to also retry on non success status codes.

* Refactor registration of Webhooks, to also register as NotificationHandler

* Add webhooks migration

* Add key for adding webhook headers

* Fix up test

* Change event icon to flag

* Remember event, when editing what events you have chosen

* Refactor reflection to check if INotificationAsyncHandler instead

* Formatting

* Refactor webhook model to no longer derive from EntityBase

* Rename entityKeys to content keys

* Rename controller to lowercase H

* Add null check before trying to access selectedEvents

* Add configuration for maximum number of retries

* Add index to date

* Add webhook Key to logs

* Check for SchedulingPublisher before sending webhooks

* rename requestObject to payload

* Refactor event to send appropriate payloads

* Refactor logging to happen for every try.

* Order date by descending

* Add todo

* Change firing service to use String not ByteContent

* Update Headers to Interface instead of concrete implementation

* Dont return if a table exists already

* Rename updateModel to webhook

* Annotate WebhookController.cs with PluginController attribute

* Add danish translations

* Do not check if fail

* Dont filter when selecting custom items

* Remove delay from WebhookFiringService

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
2023-10-31 10:06:14 +01:00

84 lines
5.1 KiB
C#

namespace Umbraco.Cms.Core;
public static partial class Constants
{
public static class Configuration
{
/// <summary>
/// Case insensitive prefix for all configurations.
/// </summary>
/// <remarks>
/// ":" is used as marker for nested objects in JSON, e.g. <c>"Umbraco:CMS:" = {"Umbraco":{"CMS":{...}}</c>.
/// </remarks>
public const string ConfigPrefix = "Umbraco:CMS:";
public const string ConfigContentPrefix = ConfigPrefix + "Content:";
public const string ConfigContentNotificationsPrefix = ConfigContentPrefix + "Notifications:";
public const string ConfigCorePrefix = ConfigPrefix + "Core:";
public const string ConfigCustomErrorsPrefix = ConfigPrefix + "CustomErrors:";
public const string ConfigGlobalPrefix = ConfigPrefix + "Global:";
public const string ConfigGlobalId = ConfigGlobalPrefix + "Id";
public const string ConfigGlobalDistributedLockingMechanism = ConfigGlobalPrefix + "DistributedLockingMechanism";
public const string ConfigHostingPrefix = ConfigPrefix + "Hosting:";
public const string ConfigModelsBuilderPrefix = ConfigPrefix + "ModelsBuilder:";
public const string ConfigSecurityPrefix = ConfigPrefix + "Security:";
public const string ConfigContentNotificationsEmail = ConfigContentNotificationsPrefix + "Email";
public const string ConfigContentMacroErrors = ConfigContentPrefix + "MacroErrors";
public const string ConfigGlobalUseHttps = ConfigGlobalPrefix + "UseHttps";
public const string ConfigHostingDebug = ConfigHostingPrefix + "Debug";
public const string ConfigCustomErrorsMode = ConfigCustomErrorsPrefix + "Mode";
public const string ConfigActiveDirectory = ConfigPrefix + "ActiveDirectory";
public const string ConfigMarketplace = ConfigPrefix + "Marketplace";
public const string ConfigLegacyPasswordMigration = ConfigPrefix + "LegacyPasswordMigration";
public const string ConfigContent = ConfigPrefix + "Content";
public const string ConfigDeliveryApi = ConfigPrefix + "DeliveryApi";
public const string ConfigCoreDebug = ConfigCorePrefix + "Debug";
public const string ConfigExceptionFilter = ConfigPrefix + "ExceptionFilter";
public const string ConfigGlobal = ConfigPrefix + "Global";
public const string ConfigUnattended = ConfigPrefix + "Unattended";
public const string ConfigHealthChecks = ConfigPrefix + "HealthChecks";
public const string ConfigHosting = ConfigPrefix + "Hosting";
public const string ConfigImaging = ConfigPrefix + "Imaging";
public const string ConfigExamine = ConfigPrefix + "Examine";
public const string ConfigIndexing = ConfigPrefix + "Indexing";
public const string ConfigKeepAlive = ConfigPrefix + "KeepAlive";
public const string ConfigLogging = ConfigPrefix + "Logging";
public const string ConfigMemberPassword = ConfigPrefix + "Security:MemberPassword";
public const string ConfigModelsBuilder = ConfigPrefix + "ModelsBuilder";
public const string ConfigModelsMode = ConfigModelsBuilder + ":ModelsMode";
public const string ConfigNuCache = ConfigPrefix + "NuCache";
public const string ConfigPlugins = ConfigPrefix + "Plugins";
public const string ConfigRequestHandler = ConfigPrefix + "RequestHandler";
public const string ConfigRuntime = ConfigPrefix + "Runtime";
public const string ConfigRuntimeMode = ConfigRuntime + ":Mode";
public const string ConfigRuntimeMinification = ConfigPrefix + "RuntimeMinification";
public const string ConfigRuntimeMinificationVersion = ConfigRuntimeMinification + ":Version";
public const string ConfigSecurity = ConfigPrefix + "Security";
public const string ConfigBasicAuth = ConfigPrefix + "BasicAuth";
public const string ConfigTours = ConfigPrefix + "Tours";
public const string ConfigTypeFinder = ConfigPrefix + "TypeFinder";
public const string ConfigWebRouting = ConfigPrefix + "WebRouting";
public const string ConfigUserPassword = ConfigPrefix + "Security:UserPassword";
public const string ConfigRichTextEditor = ConfigPrefix + "RichTextEditor";
public const string ConfigPackageMigration = ConfigPrefix + "PackageMigration";
public const string ConfigContentDashboard = ConfigPrefix + "ContentDashboard";
public const string ConfigHelpPage = ConfigPrefix + "HelpPage";
public const string ConfigInstallDefaultData = ConfigPrefix + "InstallDefaultData";
public const string ConfigDataTypes = ConfigPrefix + "DataTypes";
public const string ConfigWebhook = ConfigPrefix + "Webhook";
public static class NamedOptions
{
public static class InstallDefaultData
{
public const string Languages = "Languages";
public const string DataTypes = "DataTypes";
public const string MediaTypes = "MediaTypes";
public const string MemberTypes = "MemberTypes";
}
}
}
}