Skip to content

Commit

Permalink
apply changes from v3 (#3863)
Browse files Browse the repository at this point in the history
Signed-off-by: Pablo Hernán Carle <pablo.carle@broadcom.com>
Co-authored-by: Pablo Hernán Carle <pablo.carle@broadcom.com>
  • Loading branch information
pablocarle and Pablo Hernán Carle authored Oct 22, 2024
1 parent bb73f80 commit 8917d1f
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 6 deletions.
4 changes: 2 additions & 2 deletions api-catalog-package/src/main/resources/bin/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,15 @@ if [ "${ATTLS_ENABLED}" = "true" ]; then
ZWE_configs_spring_profiles_active="${ZWE_configs_spring_profiles_active}attls"
fi

if [ "${ZWE_configs_server_ssl_enabled:-true}" = "true" -o "$ATTLS_ENABLED" = "true" ]; then
if [ "${ZWE_configs_server_ssl_enabled:-true}" = "true" -o "$ATTLS_CLIENT_ENABLED" = "true" ]; then
externalProtocol="https"
else
externalProtocol="http"
fi

# Verify discovery service URL in case AT-TLS is enabled, assumes outgoing rules are in place
ZWE_DISCOVERY_SERVICES_LIST=${ZWE_DISCOVERY_SERVICES_LIST:-"https://${ZWE_haInstance_hostname:-localhost}:${ZWE_components_discovery_port:-7553}/eureka/"}
if [ "$ATTLS_ENABLED" = "true" -o "$ATTLS_CLIENT_ENABLED" = "true" ]; then # Keep current 2.18 behaviour, change in v3
if [ "$ATTLS_ENABLED" = "true" -o "$ATTLS_CLIENT_ENABLED" = "true" ]; then # Keep current 2.18 behaviour, changed in v3
ZWE_DISCOVERY_SERVICES_LIST=$(echo "${ZWE_DISCOVERY_SERVICES_LIST=}" | sed -e 's|https://|http://|g')
fi
if [ "${ATTLS_CLIENT_ENABLED}" = "true" ]; then
Expand Down
44 changes: 44 additions & 0 deletions discovery-package/src/main/resources/bin/configure.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/sh

################################################################################
# This program and the accompanying materials are made available under the terms of the
# Eclipse Public License v2.0 which accompanies this distribution, and is available at
# https://www.eclipse.org/legal/epl-v20.html
#
# SPDX-License-Identifier: EPL-2.0
#
# Copyright IBM Corporation 2021
################################################################################

if [ -z "$ZWE_zowe_workspaceDirectory" ]; then
echo "Workspace directory is not defined"
exit 1
fi

echo "$(env)" > $ZWE_zowe_workspaceDirectory/api-mediation/api-defs/env

INSTANCE_ID=$ZWE_haInstance_id

if [ -z "$INSTANCE_ID" ]; then
SOURCE_FILE=$ZWE_zowe_workspaceDirectory/api-mediation/api-defs/discovery.zosmf_static_definition_yaml_template.yml
else
SOURCE_FILE=$ZWE_zowe_workspaceDirectory/api-mediation/api-defs/discovery.zosmf_static_definition_yaml_template.$INSTANCE_ID.yml
fi

DEST_FILE="$ZWE_zowe_workspaceDirectory/api-mediation/api-defs/zosmf.temp"

ZOSMF_SCHEME=https

if [ "$ZWE_zowe_network_client_tls_attls" = "true" ]; then
ZOSMF_SCHEME=http
fi

if [ -e "$SOURCE_FILE" ]; then
chtag -tc ISO8859-1 $SOURCE_FILE
sed -e "s|%ZOSMF_SCHEME%|${ZOSMF_SCHEME}|g" $SOURCE_FILE > $DEST_FILE
iconv -f IBM-1047 -t ISO8859-1 $DEST_FILE > $SOURCE_FILE
chtag -tc ISO8859-1 $SOURCE_FILE
rm -f $DEST_FILE
else
echo "File $SOURCE_FILE not found"
fi
1 change: 1 addition & 0 deletions discovery-package/src/main/resources/manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ build:
commands:
start: bin/start.sh
validate: bin/validate.sh
configure: bin/configure.sh
# if we need to automatically tag file encoding on z/OS during installation
autoEncoding:
# tag all files
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ services:
title: z/OSMF
description: IBM z/OS Management Facility REST API service
instanceBaseUrls:
- ${ZWE_zOSMF_scheme:-https}://${ZOSMF_HOST}:${ZOSMF_PORT}/zosmf/
- %ZOSMF_SCHEME%://${ZOSMF_HOST}:${ZOSMF_PORT}/zosmf/
homePageRelativeUrl: # Home page is at the same URL
routedServices:
- gatewayUrl: api/v1
Expand All @@ -29,7 +29,7 @@ services:
description: 'IBM z/OS Management Facility REST API service. Once configured you can access z/OSMF via the API gateway: https://${ZOWE_EXPLORER_HOST}:${GATEWAY_PORT}/ibmzosmf/api/v1/info'
catalogUiTileId: zosmf
instanceBaseUrls:
- ${ZWE_zOSMF_scheme:-https}://${ZOSMF_HOST}:${ZOSMF_PORT}/
- %ZOSMF_SCHEME%://${ZOSMF_HOST}:${ZOSMF_PORT}/
homePageRelativeUrl: # Home page is at the same URL
routedServices:
- gatewayUrl: api/v1
Expand All @@ -40,7 +40,7 @@ services:
- apiId: ibm.zosmf
gatewayUrl: api/v1
documentationUrl: https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.4.0/com.ibm.zos.v2r4.izua700/IZUHPINFO_RESTServices.htm
swaggerUrl: ${ZWE_zOSMF_scheme:-https}://${ZOSMF_HOST}:${ZOSMF_PORT}/zosmf/api/docs
swaggerUrl: %ZOSMF_SCHEME%://${ZOSMF_HOST}:${ZOSMF_PORT}/zosmf/api/docs
customMetadata:
apiml:
enableUrlEncodedCharacters: true
Expand Down
1 change: 0 additions & 1 deletion gateway-package/src/main/resources/bin/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ if [ "${ATTLS_CLIENT_ENABLED}" = "true" -o "${ATTLS_ENABLED}" = "true" ]; then
fi

if [ "${ATTLS_CLIENT_ENABLED}" = "true" ]; then
export ZWE_zOSMF_scheme="http"
internalProtocol=http
fi

Expand Down

0 comments on commit 8917d1f

Please sign in to comment.