feat(package,daemon): list registry tokens; list daemon targets
This commit is contained in:
1 parent
1aaece3231
commit
eb35bb6b6e
11 files changed
+326
-18
No files matched your search
+14
-1
@@ -521,7 +521,7 @@ VOID_TEST(RegistryTests, registry_rbac_immutability_csrf_xss_web_and_backup_rest
|
||||
Void::Testing::expect(stats->headers.contains("etag"));
|
||||
}
|
||||
auto stats_non_admin = send_loopback_http(port, "GET", "/api/v1/stats",
|
||||
{{"Authorization", "Bearer " + *alice_tok}});
|
||||
{{"Authorization", "Bearer " + *alice_tok}});
|
||||
Void::Testing::expect(stats_non_admin.has_value() && stats_non_admin->status == 403);
|
||||
|
||||
auto bad_limit_text = send_loopback_http(port, "GET", "/api/v1/packages?limit=abc");
|
||||
@@ -1318,6 +1318,19 @@ target_include_directories(hello_pkg PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include
|
||||
auto trusted_binary_res = Platform::run_supervised(trusted_fetch);
|
||||
Void::Testing::expect(trusted_binary_res.has_value() && !trusted_binary_res->succeeded());
|
||||
|
||||
Platform::ProcessRequest tokens_list;
|
||||
tokens_list.executable = vbs_bin;
|
||||
tokens_list.arguments = {"tokens", "list", "--registry", reg_url};
|
||||
tokens_list.environment.set_vars["VBS_REGISTRY_TOKEN"] = *tok;
|
||||
auto tokens_res = Platform::run_supervised(tokens_list);
|
||||
Void::Testing::expect(tokens_res.has_value() && tokens_res->succeeded());
|
||||
if (tokens_res) {
|
||||
Void::Testing::expect(tokens_res->stdout_data.find("ci_pub") != std::string::npos);
|
||||
Void::Testing::expect(tokens_res->stdout_data.find("active") != std::string::npos);
|
||||
// The plaintext secret must never be listed.
|
||||
Void::Testing::expect(tokens_res->stdout_data.find(*tok) == std::string::npos);
|
||||
}
|
||||
|
||||
Platform::ProcessRequest releases_list;
|
||||
releases_list.executable = vbs_bin;
|
||||
releases_list.arguments = {"releases", "list", "--registry", reg_url, "--name", "hello-pkg"};
|
||||
|
||||
Reference in new issue
Block a user