Graceful handling of unauthorized requests to the Management API#16836
Merged
Graceful handling of unauthorized requests to the Management API#16836
Conversation
Member
|
LGTM 🚀 |
bergmania
reviewed
Aug 12, 2024
| /// <param name="currentUser">The current user's principal.</param> | ||
| /// <param name="user">The resulting <see cref="IUser" />, if the conversion is successful.</param> | ||
| /// <returns>True if the conversion is successful, false otherwise</returns> | ||
| bool TryGetUmbracoUser(IPrincipal currentUser, [NotNullWhen(true)] out IUser? user); |
Member
Member
There was a problem hiding this comment.
You are right, seems some package validation is missing if it's not catching these things automatically 😢
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prerequisites
Description
#16552 has had the unfortunate side-effect that exceptions are being thrown by the
AllowedApplicationHandler, whenever a request is made to an endpoint that is guarded by this handler ("section" based access), resulting in a 500 error instead of the expected 401:This PR changes
AllowedApplicationHandlerso it doesn't assume a logged-in user by default.Testing this PR
/umbraco/management/api/v1/tree/data-type/root?skip=0&take=100) and verify that the response is a 401.