Skip to content

Commit

Permalink
Validate zOSMF clean up
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 15, 2024
1 parent b6911ac commit 6080deb
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 32 deletions.
2 changes: 0 additions & 2 deletions bin/commands/internal/start/prepare/index.sh
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,6 @@ global_validate() {
if [[ ${ZWE_ENABLED_COMPONENTS} == *"discovery"* || ${ZWE_ENABLED_COMPONENTS} == *"files-api"* || ${ZWE_ENABLED_COMPONENTS} == *"jobs-api"* ]]; 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_gateway_apiml_security_auth_provider}" = "zosmf" ]; then
validate_this "validate_zosmf_as_auth_provider \"${ZOSMF_HOST}\" \"${ZOSMF_PORT}\" \"${ZWE_components_gateway_apiml_security_auth_provider}\" 2>&1" "zwe-internal-start-prepare,global_validate:${LINENO}"
fi

check_runtime_validation_result "zwe-internal-start-prepare,global_validate:${LINENO}"
Expand Down
6 changes: 0 additions & 6 deletions bin/commands/internal/start/prepare/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,6 @@ function globalValidate(enabledComponents:string[]): void {
privateErrors++;
common.printFormattedError('ZWELS', "zwe-internal-start-prepare,global_validate", "Zosmf validation failed");
}
} else if (std.getenv('ZWE_components_gateway_apiml_security_auth_provider') == "zosmf") {
let zosmfOk = zosmf.validateZosmfAsAuthProvider(zosmfHost, zosmfPort, 'zosmf');
if (!zosmfOk) {
privateErrors++;
common.printFormattedError('ZWELS', "zwe-internal-start-prepare,global_validate", "Zosmf validation failed");
}
}
}

Expand Down
13 changes: 0 additions & 13 deletions bin/libs/zosmf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,3 @@ 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
}
11 changes: 0 additions & 11 deletions bin/libs/zosmf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,3 @@ export function validateZosmfHostAndPort(zosmfHost: string, zosmfPort: number):
}
return zosmfCheckPassed;
}

//TODO isnt this completely backwards?
export function validateZosmfAsAuthProvider(zosmfHost: string, zosmfPort: number, authProvider: string): boolean {
if (zosmfHost && zosmfPort) {
if (authProvider == 'zosmf') {
common.printError("z/OSMF is not configured. Using z/OSMF as authentication provider is not supported.");
return true;
}
}
return false;
}

0 comments on commit 6080deb

Please sign in to comment.