Skip to content

Commit

Permalink
Get zaas back
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Zeithaml <[email protected]>
  • Loading branch information
Martin-Zeithaml committed Aug 22, 2024
1 parent 9fa74fa commit ffac6ca
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
3 changes: 3 additions & 0 deletions bin/commands/internal/start/prepare/index.sh
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ global_validate() {
if [[ ${ZWE_ENABLED_COMPONENTS} == *"discovery"* ]]; then
validate_this "validate_zosmf_host_and_port \"${ZOSMF_HOST}\" \"${ZOSMF_PORT}\" 2>&1" "zwe-internal-start-prepare,global_validate:${LINENO}"
fi
elif [ "${ZWE_components_zaas_apiml_security_auth_provider}" = "zosmf" ]; then
validate_this "validate_zosmf_as_auth_provider \"${ZOSMF_HOST}\" \"${ZOSMF_PORT}\" \"${ZWE_components_zaas_apiml_security_auth_provider}\" 2>&1" "zwe-internal-start-prepare,global_validate:${LINENO}"
fi
fi

check_runtime_validation_result "zwe-internal-start-prepare,global_validate:${LINENO}"
Expand Down
6 changes: 5 additions & 1 deletion bin/commands/internal/start/prepare/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,12 @@ function globalValidate(enabledComponents:string[]): void {
common.printFormattedError('ZWELS', "zwe-internal-start-prepare,globalValidate", "Zosmf validation failed");
}
}
else if (std.getenv('ZWE_components_zaas_apiml_security_auth_provider') == "zosmf") {
privateErrors++;
common.printFormattedError('ZWELS', "zwe-internal-start-prepare,globalValidate", "Zosmf validation failed");
}
}

std.setenv('ZWE_PRIVATE_ERRORS_FOUND',''+privateErrors);
varlib.checkRuntimeValidationResult("zwe-internal-start-prepare,globalValidate");

Expand Down
17 changes: 15 additions & 2 deletions bin/libs/zosmf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ validate_zosmf_host_and_port() {
zosmf_host="${1}"
zosmf_port="${2}"

if [ -z "${zosmf_host}" ]; then
if [ -z "${zosmf_host}" ]; then
print_error "z/OSMF host is not set."
return 1
fi

if [ -z "${zosmf_port}" ]; then
if [ -z "${zosmf_port}" ]; then
print_error "z/OSMF port is not set."
return 1
fi
Expand All @@ -49,3 +49,16 @@ validate_zosmf_host_and_port() {
print_message "Successfully checked z/OS MF is available on 'https://${zosmf_host}:${zosmf_port}/zosmf/info'"
fi
}

validate_zosmf_as_auth_provider() {
zosmf_host="${1}"
zosmf_port="${2}"
auth_provider="${3}"

if [ -n "${zosmf_host}" -a -n "${zosmf_port}" ]; then
if [ "${auth_provider}" = "zosmf" ]; then
print_error "z/OSMF is not configured. Using z/OSMF as authentication provider is not supported."
return 1
fi
fi
}

0 comments on commit ffac6ca

Please sign in to comment.