From 363f0afb269e6bd3a70d3b1a52d794e8168ccb77 Mon Sep 17 00:00:00 2001 From: Sophia Marie Terry Date: Wed, 2 Jul 2025 15:39:35 +0100 Subject: [PATCH 1/4] CLOUDP-328985: Fix for removePrefix --- .../ipa/rulesets/functions/utils/resourceEvaluation.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/spectral/ipa/rulesets/functions/utils/resourceEvaluation.js b/tools/spectral/ipa/rulesets/functions/utils/resourceEvaluation.js index 361fe0caff..e872646ee1 100644 --- a/tools/spectral/ipa/rulesets/functions/utils/resourceEvaluation.js +++ b/tools/spectral/ipa/rulesets/functions/utils/resourceEvaluation.js @@ -190,12 +190,12 @@ function resourceBelongsToSingleParent(resourcePath) { } // TODO move prefixes to be rule arguments -function removePrefix(path) { - if (path.startsWith(AUTH_PREFIX)) { - return path.slice(AUTH_PREFIX.length); - } +export function removePrefix(path) { if (path.startsWith(UNAUTH_PREFIX)) { return path.slice(UNAUTH_PREFIX.length); } + if (path.startsWith(AUTH_PREFIX)) { + return path.slice(AUTH_PREFIX.length); + } return path; } From c457562e3097c68ae08a6e89562ba0a38bf1ee68 Mon Sep 17 00:00:00 2001 From: Sophia Marie Terry Date: Thu, 3 Jul 2025 11:02:42 +0100 Subject: [PATCH 2/4] CLOUDP-328985: Added exceptions to /controlPlaneIPAddresses endpoint --- openapi/.raw/v2.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/openapi/.raw/v2.yaml b/openapi/.raw/v2.yaml index 46cf9cc62f..ca2b755a96 100644 --- a/openapi/.raw/v2.yaml +++ b/openapi/.raw/v2.yaml @@ -59018,6 +59018,10 @@ paths: application/vnd.atlas.2023-11-15+json: schema: $ref: '#/components/schemas/ControlPlaneIPAddresses' + x-xgen-IPA-exception: + xgen-IPA-110-collections-response-define-links-array: Content predates IPA validation + xgen-IPA-110-collections-response-define-results-array: Content predates IPA validation + xgen-IPA-110-collections-use-paginated-prefix: Content predates IPA validation x-xgen-version: "2023-11-15" description: OK "500": @@ -59028,8 +59032,12 @@ paths: - Root x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Root/operation/returnAllControlPlaneIpAddresses x-xgen-owner-team: Atlas Clusters Security II + x-xgen-IPA-exception: + xgen-IPA-110-collections-request-has-itemsPerPage-query-param: API predates IPA validation + xgen-IPA-110-collections-request-has-pageNum-query-param: API predates IPA validation x-xgen-IPA-exception: xgen-IPA-102-collection-identifier-camelCase: API predates IPA validation + xgen-IPA-104-resource-has-GET: API predates IPA validation /api/atlas/v2/unauth/openapi/versions: get: description: API that provides a list of available versionsfor a given environment. From 86a5ae9188766e5b1ca1e88a5eb85935b61f6512 Mon Sep 17 00:00:00 2001 From: Sophia Marie Terry Date: Thu, 3 Jul 2025 11:09:07 +0100 Subject: [PATCH 3/4] CLOUDP-328985: Remove exceptions --- openapi/.raw/v2.yaml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/openapi/.raw/v2.yaml b/openapi/.raw/v2.yaml index ca2b755a96..46cf9cc62f 100644 --- a/openapi/.raw/v2.yaml +++ b/openapi/.raw/v2.yaml @@ -59018,10 +59018,6 @@ paths: application/vnd.atlas.2023-11-15+json: schema: $ref: '#/components/schemas/ControlPlaneIPAddresses' - x-xgen-IPA-exception: - xgen-IPA-110-collections-response-define-links-array: Content predates IPA validation - xgen-IPA-110-collections-response-define-results-array: Content predates IPA validation - xgen-IPA-110-collections-use-paginated-prefix: Content predates IPA validation x-xgen-version: "2023-11-15" description: OK "500": @@ -59032,12 +59028,8 @@ paths: - Root x-xgen-docs-url: https://mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Root/operation/returnAllControlPlaneIpAddresses x-xgen-owner-team: Atlas Clusters Security II - x-xgen-IPA-exception: - xgen-IPA-110-collections-request-has-itemsPerPage-query-param: API predates IPA validation - xgen-IPA-110-collections-request-has-pageNum-query-param: API predates IPA validation x-xgen-IPA-exception: xgen-IPA-102-collection-identifier-camelCase: API predates IPA validation - xgen-IPA-104-resource-has-GET: API predates IPA validation /api/atlas/v2/unauth/openapi/versions: get: description: API that provides a list of available versionsfor a given environment. From 3c6f6b6e81d0f61b9d468f48974a5d876d7115ce Mon Sep 17 00:00:00 2001 From: Sophia Marie Terry Date: Thu, 3 Jul 2025 11:17:25 +0100 Subject: [PATCH 4/4] CLOUDP-328985: Temporarily silenced errors for /controlPlaneIPAddresses endpoint --- tools/spectral/ipa/ipa-spectral.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/spectral/ipa/ipa-spectral.yaml b/tools/spectral/ipa/ipa-spectral.yaml index dbbd3aca8f..d6d6d56c59 100644 --- a/tools/spectral/ipa/ipa-spectral.yaml +++ b/tools/spectral/ipa/ipa-spectral.yaml @@ -21,6 +21,15 @@ extends: - ./rulesets/IPA-126.yaml overrides: + - files: + - '**#/paths/~1api~1atlas~1v2~1unauth~1controlPlaneIPAddresses' + rules: + xgen-IPA-110-collections-response-define-links-array: 'off' + xgen-IPA-110-collections-response-define-results-array: 'off' + xgen-IPA-110-collections-use-paginated-prefix: 'off' + xgen-IPA-110-collections-request-has-itemsPerPage-query-param: 'off' + xgen-IPA-110-collections-request-has-pageNum-query-param: 'off' + xgen-IPA-104-resource-has-GET: 'off' - files: - '**#/components/schemas/DataLakeDatabaseDataSourceSettings' - '**#/components/schemas/DataLakeAtlasStoreReadPreference'