#include <filtering-source-accessor.hh>
Public Member Functions | |
virtual void | allowPrefix (CanonPath prefix)=0 |
FilteringSourceAccessor (const SourcePath &src, MakeNotAllowedError &&makeNotAllowedError) | |
![]() | |
FilteringSourceAccessor (const SourcePath &src, MakeNotAllowedError &&makeNotAllowedError) | |
std::optional< std::filesystem::path > | getPhysicalPath (const CanonPath &path) override |
std::string | readFile (const CanonPath &path) override |
bool | pathExists (const CanonPath &path) override |
std::optional< Stat > | maybeLstat (const CanonPath &path) override |
DirEntries | readDirectory (const CanonPath &path) override |
std::string | readLink (const CanonPath &path) override |
std::string | showPath (const CanonPath &path) override |
void | checkAccess (const CanonPath &path) |
virtual bool | isAllowed (const CanonPath &path)=0 |
![]() | |
virtual void | readFile (const CanonPath &path, Sink &sink, std::function< void(uint64_t)> sizeCallback=[](uint64_t size){}) |
Stat | lstat (const CanonPath &path) |
virtual void | dumpPath (const CanonPath &path, Sink &sink, PathFilter &filter=defaultPathFilter) |
Hash | hashPath (const CanonPath &path, PathFilter &filter=defaultPathFilter, HashAlgorithm ha=HashAlgorithm::SHA256) |
bool | operator== (const SourceAccessor &x) const |
auto | operator<=> (const SourceAccessor &x) const |
void | setPathDisplay (std::string displayPrefix, std::string displaySuffix="") |
CanonPath | resolveSymlinks (const CanonPath &path, SymlinkResolution mode=SymlinkResolution::Full) |
virtual std::optional< time_t > | getLastModified () |
Static Public Member Functions | |
static ref< AllowListSourceAccessor > | create (ref< SourceAccessor > next, std::set< CanonPath > &&allowedPrefixes, MakeNotAllowedError &&makeNotAllowedError) |
Additional Inherited Members | |
![]() | |
enum | Type { tRegular , tSymlink , tDirectory , tChar , tBlock , tSocket , tFifo , tUnknown } |
typedef std::optional< Type > | DirEntry |
typedef std::map< std::string, DirEntry > | DirEntries |
![]() | |
ref< SourceAccessor > | next |
CanonPath | prefix |
MakeNotAllowedError | makeNotAllowedError |
![]() | |
const size_t | number |
std::string | displayPrefix |
std::string | displaySuffix |
std::optional< std::string > | fingerprint |
A wrapping SourceAccessor
that checks paths against a set of allowed prefixes.
|
pure virtual |
Grant access to the specified prefix.
Implemented in nix::AllowListSourceAccessorImpl.