aspnet / WebHooks

[Archived] Libraries to create and consume web hooks on ASP.NET Core. Project moved to https://github.com/aspnet/AspLabs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WebHookSecurityFilter should use `DefaultIdConfigurationKey` in log when id is null or empty

pranavkm opened this issue · comments

Logger.LogError(
503,
"Could not find a valid configuration for the '{ReceiverName}' WebHook receiver, instance '{Id}'.",
sectionKey,
id);

This prints Could not find a valid configuration for the 'github' WebHook receiver, instance '' when the key is invalid.

Also

"Could not find a valid configuration for the '{ReceiverName}' WebHook receiver, instance " +
"'{Id}'. The value must be between {MinLength} and {MaxLength} characters long.",

Typo:

// Secrete key found but it does not meet the length requirements.

Hello, do you mean that when the key is invalid should it return other message? I would be glad to fix that if you clarify requirements. Thx

@Marusyk no, the intent was to use the term "default id" or something along those lines when the key is the default value. Right now it prints empty quotes, which isn't what the user configures in the log.
Consider

[GitHubWebHook]
public IActionResult Blah() {..}

The log message you see in this case is Could not find a valid configuration for the 'github' WebHook receiver, instance ''. Having '' instance isn't very intuitive. A more appropriate message might be Could not find a valid configuration for the 'github' WebHook receiver, default instance.

Self-assigning this and two other bugs because we want them done in RC1.

@mkArtakMSFT please add cost: XS label in this repo. This issue and #247 fit in that bucket. Perhaps #245 too.

This issue was moved to aspnet/AspLabs#46