feat(package,daemon): revoke registry tokens; allow daemon deps updates
VoidBuildSystem CI / build-and-test-gcc16 (push) Failing after 6s
VoidBuildSystem CI / signing-openssl-gcc16 (push) Failing after 14s

This commit is contained in:
faumaray committed 2026-12-04 07:20:06 +03:00
1 parent eb35bb6b6e
commit c7d2662cf2
11 files changed
+309 -13

No files matched your search

+47
View File
@@ -1331,6 +1331,53 @@ target_include_directories(hello_pkg PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include
Void::Testing::expect(tokens_res->stdout_data.find(*tok) == std::string::npos);
}
// Revoke a second token through the CLI and observe it in the listing.
auto extra_token = (*svc)->create_token("ci_pub", "extra", {"read"});
Void::Testing::require(extra_token.has_value());
tokens_list.environment.set_vars["VBS_REGISTRY_TOKEN"] = *tok;
auto second_list = Platform::run_supervised(tokens_list);
Void::Testing::require(second_list.has_value() && second_list->succeeded());
std::string extra_id;
{
std::size_t pos = 0;
const std::string &out = second_list->stdout_data;
while (pos < out.size()) {
const auto nl = out.find('\n', pos);
const std::string line = out.substr(pos, nl == std::string::npos ? std::string::npos : nl - pos);
if (line.find(" extra ") != std::string::npos) {
extra_id = line.substr(0, line.find(' '));
}
if (nl == std::string::npos) {
break;
}
pos = nl + 1;
}
}
Void::Testing::require(!extra_id.empty());
Platform::ProcessRequest revoke_req = tokens_list;
revoke_req.arguments = {"tokens", "revoke", "--registry", reg_url, "--token-id", extra_id};
auto revoke_res = Platform::run_supervised(revoke_req);
Void::Testing::expect(revoke_res.has_value() && revoke_res->succeeded());
auto final_list = Platform::run_supervised(tokens_list);
Void::Testing::require(final_list.has_value() && final_list->succeeded());
bool saw_revoked = false;
{
std::size_t pos = 0;
const std::string &out = final_list->stdout_data;
while (pos < out.size()) {
const auto nl = out.find('\n', pos);
const std::string line = out.substr(pos, nl == std::string::npos ? std::string::npos : nl - pos);
if (line.starts_with(extra_id) && line.find("revoked") != std::string::npos) {
saw_revoked = true;
}
if (nl == std::string::npos) {
break;
}
pos = nl + 1;
}
}
Void::Testing::expect(saw_revoked);
Platform::ProcessRequest releases_list;
releases_list.executable = vbs_bin;
releases_list.arguments = {"releases", "list", "--registry", reg_url, "--name", "hello-pkg"};