Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return noTarget if the valuePath target a non existing object #44

Merged
merged 1 commit into from
Nov 15, 2020

Conversation

thomaspoignant
Copy link
Owner

@thomaspoignant thomaspoignant commented Nov 15, 2020

Following issue #42, this PR avoids the library to crash if we filter on a target that is undefined.

The RFC specify :

o If the target location is a complex multi-valued attribute with a
value selection filter ("valuePath") and a specific sub-attribute
(e.g., "addresses[type eq "work"].streetAddress"), the matching
sub-attribute of all matching records is replaced.

o If the target location is a multi-valued attribute for which a
value selection filter ("valuePath") has been supplied and no
record match was made, the service provider SHALL indicate failure
by returning HTTP status code 400 and a "scimType" error code of
"noTarget".

You will now receive a NoTarget exception if you try to do a filter on a non-existing target.

@sonarcloud
Copy link

sonarcloud bot commented Nov 15, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@thomaspoignant thomaspoignant changed the title Return noTarget if the valuePath target a non existing object in a re… Return noTarget if the valuePath target a non existing object Nov 15, 2020
@thomaspoignant thomaspoignant self-assigned this Nov 15, 2020
@thomaspoignant thomaspoignant added the bug Something isn't working label Nov 15, 2020
@thomaspoignant thomaspoignant marked this pull request as ready for review November 15, 2020 15:18
@thomaspoignant thomaspoignant merged commit edc77d1 into master Nov 15, 2020
@thomaspoignant thomaspoignant deleted the fix/issue-42 branch November 15, 2020 15:33
@thomaspoignant thomaspoignant linked an issue Nov 15, 2020 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add sub-attribute to empty multi-valued attribute
1 participant