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

Tighten validation for id fields #7868

Conversation

shashigharti
Copy link
Contributor

Fixes #7604

Proposed fixes:

  • In progress
  • Adds validation to id fields of the core entities

Features:

  • [ X] includes tests covering changes
  • includes updated documentation
  • includes user-visible changes
  • includes API changes
  • includes bugfix for possible backport

Please [X] all the boxes above that apply

Comment on lines 241 to 243
entities_map = {
'resource_view': model.ResourceView,
'group': model.Group
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shashigharti I think in this case it's safer to have individual validators for each entity type even if that means many different functions. Relying on the keys to determine the entity type won't always be safe. And it will make overriding specific validators easier for plugins.
So let's go for resource_view_id_does_not_exist, group_id_does_not_exist, etc

@shashigharti shashigharti changed the title Validation for id fields Tighten validation for id fields Oct 31, 2023
@shashigharti shashigharti force-pushed the 7604/tighten-validation-for-id-fields branch from 6bd95eb to 946a07d Compare October 31, 2023 09:13
@amercader amercader added this to the CKAN 2.11 milestone Nov 21, 2023
@amercader amercader self-assigned this Nov 21, 2023
@amercader
Copy link
Member

Closed in favour of #8069

@amercader amercader closed this Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tighten validation for id fields
2 participants