mirror of
https://github.com/NixOS/nix
synced 2025-06-30 03:23:16 +02:00
Add Store::isTrustedClient()
This function returns true or false depending on whether the Nix client is trusted or not. Mostly relevant when speaking to a remote store with a daemon. We include this information in `nix ping store` and `nix doctor` Co-Authored-By: John Ericson <John.Ericson@Obsidian.Systems>
This commit is contained in:
parent
9185639631
commit
9207f94582
21 changed files with 169 additions and 3 deletions
|
@ -89,6 +89,7 @@ const uint32_t exportMagic = 0x4558494e;
|
|||
|
||||
|
||||
enum BuildMode { bmNormal, bmRepair, bmCheck };
|
||||
enum TrustedFlag : bool { NotTrusted = false, Trusted = true };
|
||||
|
||||
struct BuildResult;
|
||||
|
||||
|
@ -815,6 +816,17 @@ public:
|
|||
return 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* @return/ whether store trusts *us*.
|
||||
*
|
||||
* `std::nullopt` means we do not know.
|
||||
*
|
||||
* @note This is the opposite of the StoreConfig::isTrusted
|
||||
* store setting. That is about whether *we* trust the store.
|
||||
*/
|
||||
virtual std::optional<TrustedFlag> isTrustedClient() = 0;
|
||||
|
||||
|
||||
virtual Path toRealPath(const Path & storePath)
|
||||
{
|
||||
return storePath;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue