Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@itslenny
Copy link
Contributor

What kind of change does this PR introduce?

Feature

What is the current behavior?

Rows can be accidentally deleted from the storage schema tables which can cause problems. Most commonly users remove rows from the storage.objects table resulting in orphan objects that cannot be removed.

What is the new behavior?

Use statement level trigger to reject any DELETE operation that does not include storage.can_delete=true in the current settings. This allows the storage API to still remove rows while preventing deletes via direct SQL queries.

This can still be bypassed by directly setting the can_delete config, but this should prevent accidental deletes and eliminate the most common cause of orphan objects

@coveralls
Copy link

Pull Request Test Coverage Report for Build 20471568146

Details

  • 31 of 34 (91.18%) changed or added relevant lines in 5 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 76.077%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/test/utils/storage.ts 16 19 84.21%
Totals Coverage Status
Change from base Build 20337587279: 0.01%
Covered Lines: 25502
Relevant Lines: 33239

💛 - Coveralls

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.

3 participants