From 3055d5118938544a73b7d01c9e4976a1177a161f Mon Sep 17 00:00:00 2001 From: "Andrew J. Stone" Date: Thu, 16 Nov 2023 01:08:17 +0000 Subject: [PATCH] wip --- nexus/db-queries/src/db/datastore/inventory.rs | 2 +- nexus/tests/integration_tests/endpoints.rs | 9 +++++++++ nexus/tests/output/uncovered-authz-endpoints.txt | 1 - 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/nexus/db-queries/src/db/datastore/inventory.rs b/nexus/db-queries/src/db/datastore/inventory.rs index 7e8ac0b7dea..e42a0fb9728 100644 --- a/nexus/db-queries/src/db/datastore/inventory.rs +++ b/nexus/db-queries/src/db/datastore/inventory.rs @@ -848,7 +848,7 @@ impl DataStore { /// Attempt to read the given collection while limiting queries to `limit` /// records and returning up to `limit` records. - async fn inventory_collection_read_best_effort( + pub async fn inventory_collection_read_best_effort( &self, opctx: &OpContext, id: Uuid, diff --git a/nexus/tests/integration_tests/endpoints.rs b/nexus/tests/integration_tests/endpoints.rs index 8fba22fb2f0..69a51641364 100644 --- a/nexus/tests/integration_tests/endpoints.rs +++ b/nexus/tests/integration_tests/endpoints.rs @@ -43,6 +43,8 @@ use std::str::FromStr; lazy_static! { pub static ref HARDWARE_RACK_URL: String = format!("/v1/system/hardware/racks/{}", RACK_UUID); + pub static ref HARDWARE_UNINITIALIZED_SLEDS: String = + format!("{}/uninitialized-sleds", *HARDWARE_RACK_URL); pub static ref HARDWARE_SLED_URL: String = format!("/v1/system/hardware/sleds/{}", SLED_AGENT_UUID); pub static ref HARDWARE_SWITCH_URL: String = @@ -1564,6 +1566,13 @@ lazy_static! { allowed_methods: vec![AllowedMethod::Get], }, + VerifyEndpoint { + url: &HARDWARE_UNINITIALIZED_SLEDS, + visibility: Visibility::Protected, + unprivileged_access: UnprivilegedAccess::None, + allowed_methods: vec![AllowedMethod::Get], + }, + VerifyEndpoint { url: "/v1/system/hardware/sleds", visibility: Visibility::Public, diff --git a/nexus/tests/output/uncovered-authz-endpoints.txt b/nexus/tests/output/uncovered-authz-endpoints.txt index 6a6b2a74444..d76d9c54954 100644 --- a/nexus/tests/output/uncovered-authz-endpoints.txt +++ b/nexus/tests/output/uncovered-authz-endpoints.txt @@ -1,6 +1,5 @@ API endpoints with no coverage in authz tests: ping (get "/v1/ping") -uninitialized_sled_list (get "/v1/system/hardware/racks/{rack_id}/uninitialized-sleds") device_auth_request (post "/device/auth") device_auth_confirm (post "/device/confirm") device_access_token (post "/device/token")