From 1e1b8514550bda617a306858edbe7210c6f77b14 Mon Sep 17 00:00:00 2001 From: Stephen Rosenthal Date: Mon, 24 Aug 2026 16:39:34 -0700 Subject: [PATCH] pup: enable OAuth for DDSQL editor commands Remove 3 dsql-editor tool endpoints from OAUTH_EXCLUDED_ENDPOINTS so raw_get/raw_post send the OAuth bearer token for ddsql::spec, ddsql::schema_tables, and ddsql::schema_columns commands. Depends on server-side PR: dd-source#66615 --- src/raw_client.rs | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/src/raw_client.rs b/src/raw_client.rs index ed14c965..ed3347f2 100644 --- a/src/raw_client.rs +++ b/src/raw_client.rs @@ -120,19 +120,6 @@ fn find_endpoint_requirement(method: &str, path: &str) -> Option<&'static Endpoi /// Endpoints that don't support OAuth. /// Trailing "/" means prefix match for ID-parameterized paths. static OAUTH_EXCLUDED_ENDPOINTS: &[EndpointRequirement] = &[ - // DDSQL editor tools (3) - EndpointRequirement { - path: "/api/unstable/ddsql-editor/tools/ddsql-docs", - method: "GET", - }, - EndpointRequirement { - path: "/api/unstable/ddsql-editor/tools/table-names", - method: "GET", - }, - EndpointRequirement { - path: "/api/unstable/ddsql-editor/tools/table-data", - method: "POST", - }, // Fleet Automation (15) EndpointRequirement { path: "/api/v2/fleet/agents", @@ -836,7 +823,7 @@ mod tests { #[test] fn test_oauth_excluded_count() { - assert_eq!(OAUTH_EXCLUDED_ENDPOINTS.len(), 46); + assert_eq!(OAUTH_EXCLUDED_ENDPOINTS.len(), 43); } #[test] @@ -881,22 +868,6 @@ mod tests { )); } - #[test] - fn test_requires_api_key_fallback_ddsql_editor_tools() { - assert!(requires_api_key_fallback( - "GET", - "/api/unstable/ddsql-editor/tools/ddsql-docs" - )); - assert!(requires_api_key_fallback( - "GET", - "/api/unstable/ddsql-editor/tools/table-names" - )); - assert!(requires_api_key_fallback( - "POST", - "/api/unstable/ddsql-editor/tools/table-data" - )); - } - #[test] fn test_no_fallback_for_error_tracking() { assert!(!requires_api_key_fallback(