Fix #2284: POST resources/rules delegation check 400 bad request response fix#2345
Open
howieandersen wants to merge 4 commits intomainfrom
Open
Fix #2284: POST resources/rules delegation check 400 bad request response fix#2345howieandersen wants to merge 4 commits intomainfrom
howieandersen wants to merge 4 commits intomainfrom
Conversation
…k failure Add delegation authorization validation to POST/PUT resources/rules endpoints. When delegation check fails, return 400 BadRequest with details about which specific rules the user lacks permission to delegate. - Add DelegationAuthorization rule to ConnectionCombinationRules - Add ValidateDelegationAuthorization composition to ConnectionValidation - Update AddResourceRules and UpdateResourceRules to validate before service calls - Add NotAuthorizedToDelegateRules error message constant
… and validation logic into a private helper method.
|
| var delegationAuthorizationError = await ValidateResourceDelegationAuthorization(fromId, resource, actionKeys.DirectRuleKeys, cancellationToken); | ||
| if (delegationAuthorizationError is { }) | ||
| { | ||
| return delegationAuthorizationError; |
Member
There was a problem hiding this comment.
delegation check'en gjøres vel nå allerede inne i ConnectionService.AddResource : 607
så ville i utgangspunktet forvente at det er responsen der i fra som returnerte feilmodellen i stedet for å gjøre en ekstra sjekk i kontrolleren først.
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.


Return 400 BadRequest with rule details on delegation check failure
Add delegation authorization validation to POST/PUT resources/rules endpoints. When delegation check fails, return 400 BadRequest with details about which specific rules the user lacks permission to delegate.
Description
Related Issue(s)
Verification
Documentation