feat(provenance): distribute trusted Ed25519 keys via files, vbs.keys, and environment
This commit is contained in:
1 parent
f5c0c9f09d
commit
ff59f6ff5c
13 files changed
+314
-7
No files matched your search
@@ -8,6 +8,7 @@
|
||||
#include <Void/Build/Package/Lockfile.hpp>
|
||||
#include <Void/Build/Package/Resolver.hpp>
|
||||
#include <Void/Build/Package/Toml.hpp>
|
||||
#include <Void/Build/Provenance/TrustedKeys.hpp>
|
||||
#include <Void/Build/Provider/Provider.hpp>
|
||||
#include <Void/Build/State/StateStore.hpp>
|
||||
#include <Void/Build/Toolchain/Driver.hpp>
|
||||
@@ -440,6 +441,18 @@ Void::Result::Result<std::size_t, std::string> materialize_project_dependencies(
|
||||
resolve_options.default_registry_url = Void::Configuration::get_env_or("VBS_REGISTRY_URL", "");
|
||||
resolve_options.registry_auth =
|
||||
Package::RegistryAuth{Void::Configuration::get_env_or("VBS_REGISTRY_TOKEN", "")};
|
||||
const std::string trusted_environment =
|
||||
Void::Configuration::get_env_or("VBS_TRUSTED_PUBLIC_KEYS", "");
|
||||
std::optional<std::string_view> trusted_environment_value;
|
||||
if (!trusted_environment.empty()) {
|
||||
trusted_environment_value = trusted_environment;
|
||||
}
|
||||
auto trusted_keys =
|
||||
Provenance::load_trusted_keys({}, options.project_root, trusted_environment_value);
|
||||
if (!trusted_keys) {
|
||||
return std::unexpected{std::format("build: {}", trusted_keys.error().format())};
|
||||
}
|
||||
resolve_options.trusted_public_keys = std::move(*trusted_keys);
|
||||
auto resolved =
|
||||
Package::resolve_and_materialize_dependencies(evaluated.context, *merged, resolve_options);
|
||||
if (!resolved) {
|
||||
|
||||
Reference in new issue
Block a user