DuendeSoftware / BFF

Framework for ASP.NET Core to secure SPAs using the Backend-for-Frontend (BFF) pattern
Other
339 stars 76 forks source link

DefaultDiagnosticsService tied to Development environment #143

Closed PascalAlbrechtComparis closed 2 years ago

PascalAlbrechtComparis commented 2 years ago

I already talked to @AndersAbel about this issue.

I am facing an issue with the DefaultDiagnosticsService while using different environment names than Development (e.g. Localhost). The implementation uses a fixed check against Development: https://github.com/DuendeSoftware/BFF/blob/15fbba8643c948cd2d39c15dfdcfd4adad1b52f7/src/Duende.Bff/EndpointServices/Diagnostics/DefaultDiagnosticsService.cs#L36 It seems that the only way to use the DefaultDiagnosticsService in other environments is to fake a Development environment to it.

While Development is a reasonable default, I think that there should be a convenient option to adjust the environments. This might be implemented as an option to specify environments or a possibility to override the condition.

brockallen commented 2 years ago

Would you ever want more than one environment where this is enabled?

PascalAlbrechtComparis commented 2 years ago

Yes, we would like a way to enable this in multiple environments. E.g. we are currently using Localhost and Development.

brockallen commented 2 years ago

Yep... ok, we'll see what we can do!

brockallen commented 2 years ago

PR submitted -- have a look, please.

PascalAlbrechtComparis commented 2 years ago

Sorry, for my delayed response. I tested the change and it works nicely. Thanks for your efforts!