mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-28 16:46:16 +02:00
34 lines
772 B
C++
34 lines
772 B
C++
|
#pragma once
|
||
|
|
||
|
#include "input-accessor.hh"
|
||
|
|
||
|
namespace nix {
|
||
|
|
||
|
class StorePath;
|
||
|
class Store;
|
||
|
|
||
|
struct FSInputAccessor : InputAccessor
|
||
|
{
|
||
|
virtual void checkAllowed(const CanonPath & absPath) = 0;
|
||
|
|
||
|
virtual void allowPath(CanonPath path) = 0;
|
||
|
|
||
|
virtual bool hasAccessControl() = 0;
|
||
|
};
|
||
|
|
||
|
typedef std::function<RestrictedPathError(const CanonPath & path)> MakeNotAllowedError;
|
||
|
|
||
|
ref<FSInputAccessor> makeFSInputAccessor(
|
||
|
const CanonPath & root,
|
||
|
std::optional<std::set<CanonPath>> && allowedPaths = {},
|
||
|
MakeNotAllowedError && makeNotAllowedError = {});
|
||
|
|
||
|
ref<FSInputAccessor> makeStorePathAccessor(
|
||
|
ref<Store> store,
|
||
|
const StorePath & storePath,
|
||
|
MakeNotAllowedError && makeNotAllowedError = {});
|
||
|
|
||
|
SourcePath getUnfilteredRootPath(CanonPath path);
|
||
|
|
||
|
}
|