FusionAuth / fusionauth-issues

FusionAuth issue submission project
https://fusionauth.io
91 stars 12 forks source link

Import API fails to provide validation message for non-existent group #2836

Open jobannon opened 3 months ago

jobannon commented 3 months ago

Description

If a group doesn't exist, import API returns a 500, but should return a message indicating that the group must be created when validateDbconstraints: true is set per message from API response

Observed versions

1.51.1

Affects versions

The version, or versions where this bug exists. If you do not know, please leave blank for now.

Steps to reproduce

Steps to reproduce the behavior:

  1. Create a new tenant and application in that tenant
  2. Copy this request (the bottom of import)
  3. Modify the request to include validateDbConstraints:true
  4. Modify the request to also reference the application in the tenant made in step one
  5. Limit the request to the new tenant from step one (blank slate)
  6. Watch the request fail, with no validation messages

Expected behavior

We should be returning something indicating that groupId doesn't exist (cb5c83f-53ff-4d16-88bd-c5e3802111a5)

"memberships": [
                {
                    "data": {
                        "externalId": "cc6714c6-286c-411c-a6bc-ee413cda1dbc"
                    },
                    "groupId": "2cb5c83f-53ff-4d16-88bd-c5e3802111a5"
                }
            ]

Screenshots

If applicable, add screenshots to help explain your problem. Delete this section if it is not applicable.

image

Platform

(Please complete the following information)

Community guidelines

All issues filed in this repository must abide by the FusionAuth community guidelines.

Additional context

Add any other context about the problem here.

robotdan commented 3 months ago

Thanks for reporting @jobannon looks like something we should fix to provide better developer feedback.