Skip to content

allow management endpoints to be overwritten manually#2186

Merged
Erwinvandervalk merged 1 commit into
mainfrom
ev/bff/allow_man_endpoints_to_be_overwritten
Sep 5, 2025
Merged

allow management endpoints to be overwritten manually#2186
Erwinvandervalk merged 1 commit into
mainfrom
ev/bff/allow_man_endpoints_to_be_overwritten

Conversation

@Erwinvandervalk

@Erwinvandervalk Erwinvandervalk commented Aug 26, 2025

Copy link
Copy Markdown
Contributor

What issue does this PR address?
In V3, you could extend the management endpoints by inheriting from the default functionality.

In V4, this is no longer possible as the default impl is internal. You can replace the endpoint entirely (via DI). But if you want to extend the functionality, this was a bit clunky:

        app.Use(async (c, n) =>
        {
            if (c.Request.Path.StartsWithSegments("/bff/login"))
            {
                loginCalled = true;
                await c.RequestServices.GetRequiredService<ILoginEndpoint>().ProcessRequestAsync(c);
                return;
            }
            await n();
        });

Make sure that this is possible:

        app.MapGet(Bff.BffOptions.LoginPath, c =>
        {
            loginCalled = true;
            return c.RequestServices.GetRequiredService<ILoginEndpoint>().ProcessRequestAsync(c);
        });

fixes: https://github.com/DuendeSoftware/products-private/issues/2285

Also, this PR marks the ISilentLoginEndpoint as obsolete. The implementation was already marked as obsolete, but this was an internal implementation.

Important: Any code or remarks in your Pull Request are under the following terms:

If You provide us with any comments, bug reports, feedback, enhancements, or modifications proposed or suggested by You for the Software, such Feedback is provided on a non-confidential basis (notwithstanding any notice to the contrary You may include in any accompanying communication), and Licensor shall have the right to use such Feedback at its discretion, including, but not limited to the incorporation of such suggested changes into the Software. You hereby grant Licensor a perpetual, irrevocable, transferable, sublicensable, nonexclusive license under all rights necessary to incorporate and use your Feedback for any purpose, including to make and sell any products and services.

(see our license, section 7)

@Erwinvandervalk Erwinvandervalk self-assigned this Aug 26, 2025
@Erwinvandervalk Erwinvandervalk force-pushed the ev/bff/allow_man_endpoints_to_be_overwritten branch 2 times, most recently from e19dee1 to 5630eb0 Compare August 26, 2025 12:40
@damianh damianh force-pushed the ev/bff/allow_man_endpoints_to_be_overwritten branch from 5630eb0 to fe2ac3a Compare September 4, 2025 09:57
@Erwinvandervalk Erwinvandervalk force-pushed the ev/bff/allow_man_endpoints_to_be_overwritten branch from 6c5f582 to 0a3eb04 Compare September 5, 2025 08:26
@Erwinvandervalk Erwinvandervalk force-pushed the ev/bff/allow_man_endpoints_to_be_overwritten branch from 0a3eb04 to 9d213d4 Compare September 5, 2025 08:29
@Erwinvandervalk Erwinvandervalk merged commit 6bb4c0c into main Sep 5, 2025
14 checks passed
@Erwinvandervalk Erwinvandervalk deleted the ev/bff/allow_man_endpoints_to_be_overwritten branch September 5, 2025 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants