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

Prevent a generic resource to be created with a type from the Nexus vocabulary #5043

Closed
imsdu opened this issue Jun 26, 2024 · 0 comments · Fixed by #5046
Closed

Prevent a generic resource to be created with a type from the Nexus vocabulary #5043

imsdu opened this issue Jun 26, 2024 · 0 comments · Fixed by #5046
Assignees

Comments

@imsdu
Copy link
Contributor

imsdu commented Jun 26, 2024

Motivation
The resource endpoint is very permissive as it can accept almost any valid json-ld payload to create a resource.
This can cause some problems as someone can create what should be a schema or a view with this endpoint: the resource then has the correct json-ld type but is still considered a generic resource and extra validation is not applied.

Ex:

  • Import resolution for schemas
  • Creation of the index and validation of the mapping/settings for Elasticsearch views

Acceptance criteria

  1. When attempting to create a generic resource when one of the types belongs to the Nexus vocabulary (so a type starting with https://bluebrain.github.io/nexus/vocabulary/), an error is returned

Implementation notes
This error must be translated as an Akka rejection in ResourcesRoutes

@imsdu imsdu changed the title Prevent resources with a type from the Nexus vocabulary to be created with the resource endpoint Prevent a generic resource to be created with a type from the Nexus vocabulary Jun 26, 2024
@imsdu imsdu self-assigned this Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant