Skip to content

Base path db constaint - #7952

Draft
mdellweg wants to merge 2 commits into
pulp:mainfrom
mdellweg:base_path_db_constaint
Draft

Base path db constaint#7952
mdellweg wants to merge 2 commits into
pulp:mainfrom
mdellweg:base_path_db_constaint

Conversation

@mdellweg

Copy link
Copy Markdown
Member

📜 Checklist

  • Commits are cleanly separated with meaningful messages (simple features and bug fixes should be squashed to one commit)
  • A changelog entry or entries has been added for any significant changes
  • Follows the Pulp policy on AI Usage
  • (For new features) - User documentation and test coverage has been added

See: Pull Request Walkthrough

@mdellweg

Copy link
Copy Markdown
Member Author

I looked at building an exclusion constraint. But as '^@' is not a symmetric operator, PG won't let me.

@mdellweg

Copy link
Copy Markdown
Member Author

And defining a new operator class is a sysadmin only trait in postgres.

slashed_path text := '/' || path || '/';
BEGIN
-- Verify base path is normalized!
-- i.e. is relative, does not end with '/' and does not contain '//' or '.', '..' segments.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Do we also need to restrict the character set?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant