Skip to content

Commit

Permalink
Update coverage of support bundle endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
smklein committed Dec 20, 2024
1 parent 6a2fa59 commit a0e5326
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 28 deletions.
29 changes: 1 addition & 28 deletions nexus/tests/integration_tests/endpoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,6 @@ pub const SUPPORT_BUNDLES_URL: &'static str =
"/experimental/v1/system/support-bundles";
pub static SUPPORT_BUNDLE_URL: Lazy<String> =
Lazy::new(|| format!("{SUPPORT_BUNDLES_URL}/{{id}}"));
pub static SUPPORT_BUNDLE_INDEX_URL: Lazy<String> =
Lazy::new(|| format!("{SUPPORT_BUNDLES_URL}/{{id}}/index"));
pub static SUPPORT_BUNDLE_DOWNLOAD_URL: Lazy<String> =
Lazy::new(|| format!("{SUPPORT_BUNDLES_URL}/{{id}}/download"));

// Global policy
pub const SYSTEM_POLICY_URL: &'static str = "/v1/system/policy";
Expand Down Expand Up @@ -1095,8 +1091,6 @@ pub enum AllowedMethod {
/// HTTP "PUT" method, with sample input (which should be valid input for
/// this endpoint)
Put(serde_json::Value),
/// HTTP "HEAD" method
Head,
}

impl AllowedMethod {
Expand All @@ -1111,7 +1105,6 @@ impl AllowedMethod {
| AllowedMethod::GetWebsocket => &Method::GET,
AllowedMethod::Post(_) => &Method::POST,
AllowedMethod::Put(_) => &Method::PUT,
AllowedMethod::Head => &Method::HEAD,
}
}

Expand All @@ -1126,8 +1119,7 @@ impl AllowedMethod {
| AllowedMethod::GetNonexistent
| AllowedMethod::GetUnimplemented
| AllowedMethod::GetVolatile
| AllowedMethod::GetWebsocket
| AllowedMethod::Head => None,
| AllowedMethod::GetWebsocket => None,
AllowedMethod::Post(body) => Some(&body),
AllowedMethod::Put(body) => Some(&body),
}
Expand Down Expand Up @@ -2193,25 +2185,6 @@ pub static VERIFY_ENDPOINTS: Lazy<Vec<VerifyEndpoint>> = Lazy::new(|| {
],
},

// VerifyEndpoint {
// url: &SUPPORT_BUNDLE_INDEX_URL,
// visibility: Visibility::Protected,
// unprivileged_access: UnprivilegedAccess::None,
// allowed_methods: vec![
// AllowedMethod::Get,
// ],
// },
//
// VerifyEndpoint {
// url: &SUPPORT_BUNDLE_DOWNLOAD_URL,
// visibility: Visibility::Protected,
// unprivileged_access: UnprivilegedAccess::None,
// allowed_methods: vec![
// AllowedMethod::Get,
// AllowedMethod::Head,
// ],
// },

VerifyEndpoint {
url: &SUPPORT_BUNDLE_URL,
visibility: Visibility::Protected,
Expand Down
5 changes: 5 additions & 0 deletions nexus/tests/output/uncovered-authz-endpoints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@ API endpoints with no coverage in authz tests:
probe_delete (delete "/experimental/v1/probes/{probe}")
probe_list (get "/experimental/v1/probes")
probe_view (get "/experimental/v1/probes/{probe}")
support_bundle_download (get "/experimental/v1/system/support-bundles/{support_bundle}/download")
support_bundle_download_file (get "/experimental/v1/system/support-bundles/{support_bundle}/download/{file}")
support_bundle_index (get "/experimental/v1/system/support-bundles/{support_bundle}/index")
ping (get "/v1/ping")
networking_switch_port_status (get "/v1/system/hardware/switch-port/{port}/status")
support_bundle_head (head "/experimental/v1/system/support-bundles/{support_bundle}/download")
support_bundle_head_file (head "/experimental/v1/system/support-bundles/{support_bundle}/download/{file}")
device_auth_request (post "/device/auth")
device_auth_confirm (post "/device/confirm")
device_access_token (post "/device/token")
Expand Down

0 comments on commit a0e5326

Please sign in to comment.