mindersec / minder

Software Supply Chain Security Platform
https://minder-docs.stacklok.dev/
Apache License 2.0
294 stars 42 forks source link

Add project id foreign key to data sources tables. #5026

Closed blkt closed 1 day ago

blkt commented 3 days ago

Summary

Tables data_sources_functions and rule_type_data_sources added by migration 108 lacked a reference to their containing project.

This change adds project_id foreign key in the style of rule_instances in order to avoid future mistakes like exposing resouces by id to users that don't have rights on the containing project.

Change Type

Testing

Manually ran migrate up and migrate down in a database containing a few records. The aim of the test was to verify that the calculated project id was correct.

Review Checklist:

coveralls commented 3 days ago

Coverage Status

coverage: 54.63% (+0.003%) from 54.627% when pulling cedff5154a143bc2a064e64d2e51643ed3307c33 on fix/data_sources_migration_project_id into c8469dde13c5e470005702f48b739f73ca5d31a0 on main.