1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2025-03-04 10:39:43 +00:00
restic/internal/migrations
Michael Eischer 99e105eeb6 repository: restrict SaveUnpacked and RemoveUnpacked
Those methods now only allow modifying snapshots. Internal data types
used by the repository are now read-only. The repository-internal code
can bypass the restrictions by wrapping the repository in an
`internalRepository` type.

The restriction itself is implemented by using a new datatype
WriteableFileType in the SaveUnpacked and RemoveUnpacked methods. This
statically ensures that code cannot bypass the access restrictions.

The test changes are somewhat noisy as some of them modify repository
internals and therefore require some way to bypass the access
restrictions. This works by capturing an `internalRepository` or
`Backend` when creating the Repository using a test helper function.
2025-01-13 22:39:57 +01:00
..
doc.go Moves files 2017-07-23 14:19:13 +02:00
interface.go migrate: Report why an migration cannot be applied 2022-09-03 11:49:31 +02:00
list.go Moves files 2017-07-23 14:19:13 +02:00
upgrade_repo_v2.go migrations: move logic of upgrade_repo_v2 to repository package 2024-05-18 21:38:31 +02:00
upgrade_repo_v2_test.go repository: restrict SaveUnpacked and RemoveUnpacked 2025-01-13 22:39:57 +01:00