1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2025-03-04 18:48:39 +00:00
restic/internal/archiver
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
..
archiver.go repository: restrict SaveUnpacked and RemoveUnpacked 2025-01-13 22:39:57 +01:00
archiver_test.go fs: remove os.FileInfo from fs.ExtendedFileInfo 2024-11-30 17:07:36 +01:00
archiver_unix_test.go fs: remove os.FileInfo from fs.ExtendedFileInfo 2024-11-30 17:07:36 +01:00
blob_saver.go archiver: hide implementation details 2024-08-31 17:52:45 +02:00
blob_saver_test.go archiver: hide implementation details 2024-08-31 17:52:45 +02:00
buffer.go archiver: hide implementation details 2024-08-31 17:52:45 +02:00
doc.go archiver: hide implementation details 2024-08-31 17:52:45 +02:00
exclude.go backup: allow excluding online-only cloud files 2025-01-13 21:11:23 +01:00
exclude_test.go fs: inline ExtendedStat 2024-11-30 16:19:16 +01:00
file_saver.go fs / archiver: convert to handle based interface 2024-11-16 12:56:23 +01:00
file_saver_test.go fs / archiver: convert to handle based interface 2024-11-16 12:56:23 +01:00
scanner.go fs: remove os.FileInfo from fs.ExtendedFileInfo 2024-11-30 17:07:36 +01:00
scanner_test.go fs: remove os.FileInfo from fs.ExtendedFileInfo 2024-11-30 17:07:36 +01:00
testing.go minimize usage of internal/fs in tests 2024-08-31 18:20:41 +02:00
testing_test.go minimize usage of internal/fs in tests 2024-08-31 18:20:41 +02:00
tree.go archiver: hide implementation details 2024-08-31 17:52:45 +02:00
tree_saver.go archiver: hide implementation details 2024-08-31 17:52:45 +02:00
tree_saver_test.go archiver: hide implementation details 2024-08-31 17:52:45 +02:00
tree_test.go archiver: hide implementation details 2024-08-31 17:52:45 +02:00