From 2246bf1bf93b98f830405640cb5998ee9418dd7a Mon Sep 17 00:00:00 2001 From: ShobhaJayanna <36433611+Shobhajayanna@users.noreply.github.com> Date: Thu, 20 Jun 2024 18:14:06 +0200 Subject: [PATCH] chore: reboot/cherry pick in v3 (#3607) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: UI titles and message consistency (#3502) Signed-off-by: sj895092 * add bootRun debug default options (#3595) Signed-off-by: sj895092 * attempt at fixing flaky test (#3596) Signed-off-by: Pablo Hernán Carle Co-authored-by: Pablo Hernán Carle * update working dir in bootrun task (#3602) Signed-off-by: sj895092 * removed metrics service related test Signed-off-by: sj895092 * chore: protect conformance endpoints and add them to Swagger (#3604) * protect endpoints Signed-off-by: at670475 * add conformance to swagger Signed-off-by: at670475 * add test Signed-off-by: at670475 --------- Signed-off-by: at670475 * chore: protect conformance endpoints and add them to Swagger (#3604) * protect endpoints Signed-off-by: at670475 * add conformance to swagger Signed-off-by: at670475 * add test Signed-off-by: at670475 --------- Signed-off-by: at670475 * removing metric service reference Signed-off-by: sj895092 * removing gateway changes from v2 cherry pick Signed-off-by: sj895092 * reverting back changes in gateway service Signed-off-by: sj895092 * reverting back changes in gateway service Signed-off-by: sj895092 * reverting back conformance endpoint validation changes Signed-off-by: sj895092 * reverting back conformance endpoint validation changes Signed-off-by: sj895092 --------- Signed-off-by: sj895092 Signed-off-by: Pablo Hernán Carle Signed-off-by: at670475 Co-authored-by: Jakub Balhar Co-authored-by: Pablo Carle Co-authored-by: Pablo Hernán Carle Co-authored-by: Andrea Tabone <39694626+taban03@users.noreply.github.com> --- api-catalog-services/build.gradle | 9 ++++++ api-catalog-ui/build.gradle | 2 -- caching-service/build.gradle | 16 +++++++++++ cloud-gateway-service/build.gradle | 9 ++++++ discoverable-client/build.gradle | 16 +++++++++++ discovery-service/build.gradle | 9 ++++++ .../functional/gateway/ValidateAPITest.java | 28 +++++++++++++++++++ mock-services/build.gradle | 16 +++++++++++ .../build.gradle | 9 ++++++ .../__tests__/cli/map/Map.handler.test.ts | 4 +-- .../src/cli/map/Map.handler.ts | 1 - 11 files changed, 114 insertions(+), 5 deletions(-) diff --git a/api-catalog-services/build.gradle b/api-catalog-services/build.gradle index 1be0c1b1a4..0523aed942 100644 --- a/api-catalog-services/build.gradle +++ b/api-catalog-services/build.gradle @@ -120,6 +120,15 @@ bootRun { if (project.hasProperty('args')) { args project.args.split(',') } + + debugOptions { + port = 5014 + suspend = false + server = true + } + + workingDir = project.rootDir + systemProperties = System.properties } diff --git a/api-catalog-ui/build.gradle b/api-catalog-ui/build.gradle index d61f8eb5ff..e1f264aa68 100644 --- a/api-catalog-ui/build.gradle +++ b/api-catalog-ui/build.gradle @@ -104,8 +104,6 @@ task npmBuild(type: NpmTask) { } - - npmBuild.dependsOn npmInstall npmBuild.dependsOn npmLint build.dependsOn npmBuild diff --git a/caching-service/build.gradle b/caching-service/build.gradle index b577002f2e..89e16d749e 100644 --- a/caching-service/build.gradle +++ b/caching-service/build.gradle @@ -86,4 +86,20 @@ jar { archiveClassifier = "" } +bootRun { + if (project.hasProperty('args')) { + args project.args.split(',') + } + + debugOptions { + port = 5016 + suspend = false + server = true + } + + workingDir = project.rootDir + + systemProperties = System.properties +} + bootJar.archiveFileName = bootJar.archiveBaseName.get() + ".jar" diff --git a/cloud-gateway-service/build.gradle b/cloud-gateway-service/build.gradle index f05f56ee4f..56c5dc7e78 100644 --- a/cloud-gateway-service/build.gradle +++ b/cloud-gateway-service/build.gradle @@ -105,6 +105,15 @@ bootRun { if (project.hasProperty('args')) { args project.args.split(',') } + + debugOptions { + port = 5023 + suspend = false + server = true + } + + workingDir = project.rootDir + systemProperties = System.properties } diff --git a/discoverable-client/build.gradle b/discoverable-client/build.gradle index 44df25dea5..4bb56d3e42 100644 --- a/discoverable-client/build.gradle +++ b/discoverable-client/build.gradle @@ -44,6 +44,22 @@ springBoot { } } +bootRun { + if (project.hasProperty('args')) { + args project.args.split(',') + } + + debugOptions { + port = 5012 + suspend = false + server = true + } + + workingDir = project.rootDir + + systemProperties = System.properties +} + gitProperties { gitPropertiesDir = new File("${project.rootDir}/${name}/build/resources/main/META-INF") } diff --git a/discovery-service/build.gradle b/discovery-service/build.gradle index 3a7ef27f63..870bf00f8d 100644 --- a/discovery-service/build.gradle +++ b/discovery-service/build.gradle @@ -92,6 +92,15 @@ bootRun { if (project.hasProperty('args')) { args project.args.split(',') } + + debugOptions { + port = 5011 + suspend = false + server = true + } + + workingDir = project.rootDir + systemProperties = System.properties } diff --git a/integration-tests/src/test/java/org/zowe/apiml/functional/gateway/ValidateAPITest.java b/integration-tests/src/test/java/org/zowe/apiml/functional/gateway/ValidateAPITest.java index 6a14ee20a3..9c9085839c 100644 --- a/integration-tests/src/test/java/org/zowe/apiml/functional/gateway/ValidateAPITest.java +++ b/integration-tests/src/test/java/org/zowe/apiml/functional/gateway/ValidateAPITest.java @@ -78,6 +78,7 @@ void testGetEndpoint() { void testGetEndpointNonConformant() { given() .log().all() + .header("Cookie", "apimlAuthenticationToken=" + token) .when() .get(getEndpointURLGet() + "/nonConformantServiceBecauseNameIsTooLongAndContainsCapitalLettersqwertyuiop") .then() @@ -86,6 +87,33 @@ void testGetEndpointNonConformant() { } + @Test + @TestsNotMeantForZowe + void testGetEndpointWithNoAuthentication() { + given() + .log().all() + .when() + .get(getEndpointURLGet() + "/discoverableclient") + .then() + .assertThat() + .statusCode(HttpStatus.SC_UNAUTHORIZED); + + } + + @Test + @TestsNotMeantForZowe + void testLegacyEndpointWithNoAuthentication() { + given() + .log().all() + .param("serviceID", "discoverableclient") + .when() + .post(getLegacyEndpointURLPost()) + .then() + .assertThat() + .statusCode(HttpStatus.SC_UNAUTHORIZED); + + } + private String getEndpointURLGet() { GatewayServiceConfiguration gatewayServiceConfiguration = ConfigReader.environmentConfiguration().getGatewayServiceConfiguration(); String gatewayScheme = gatewayServiceConfiguration.getScheme(); diff --git a/mock-services/build.gradle b/mock-services/build.gradle index 999d45e6ea..616cceaeba 100644 --- a/mock-services/build.gradle +++ b/mock-services/build.gradle @@ -44,6 +44,22 @@ springBoot { } } +bootRun { + if (project.hasProperty('args')) { + args project.args.split(',') + } + + debugOptions { + port = 5013 + suspend = false + server = true + } + + workingDir = project.rootDir + + systemProperties = System.properties +} + gitProperties { gitPropertiesDir = new File("${project.rootDir}/${name}/build/resources/main/META-INF") } diff --git a/onboarding-enabler-spring-sample-app/build.gradle b/onboarding-enabler-spring-sample-app/build.gradle index a3c10a91db..69eab93467 100644 --- a/onboarding-enabler-spring-sample-app/build.gradle +++ b/onboarding-enabler-spring-sample-app/build.gradle @@ -50,5 +50,14 @@ bootRun { if (project.hasProperty('args')) { args project.args.split(',') } + + debugOptions { + port = 5015 + suspend = false + server = true + } + + workingDir = project.rootDir + systemProperties = System.properties } diff --git a/zowe-cli-id-federation-plugin/__tests__/cli/map/Map.handler.test.ts b/zowe-cli-id-federation-plugin/__tests__/cli/map/Map.handler.test.ts index 6945bdf5f1..2ac043aa6b 100644 --- a/zowe-cli-id-federation-plugin/__tests__/cli/map/Map.handler.test.ts +++ b/zowe-cli-id-federation-plugin/__tests__/cli/map/Map.handler.test.ts @@ -11,12 +11,12 @@ import {ResponseMock} from "../../__src__/ResponseMock"; import {Constants} from "../../../src/api/Constants"; import {expect, jest, describe, it} from '@jest/globals'; +// Require the handler and create a new instance +const handlerReq = require("../../../src/cli/map/Map.handler"); describe("map handler unit tests", () => { it("should accept options and return successful message", async () => { - // Require the handler and create a new instance - const handlerReq = require("../../../src/cli/map/Map.handler"); const handler = new handlerReq.default(); // Vars populated by the mocked function - error should remain undefined. diff --git a/zowe-cli-id-federation-plugin/src/cli/map/Map.handler.ts b/zowe-cli-id-federation-plugin/src/cli/map/Map.handler.ts index 1c40c74f8d..052ed48aa4 100644 --- a/zowe-cli-id-federation-plugin/src/cli/map/Map.handler.ts +++ b/zowe-cli-id-federation-plugin/src/cli/map/Map.handler.ts @@ -15,7 +15,6 @@ import {Constants} from "../../api/Constants"; export default class MapHandler implements ICommandHandler { - public async process(params: IHandlerParameters): Promise { const file: string = params.arguments.inputFile; const system: string = params.arguments.system ?? '';