Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

z/OSMF static definition file processing #4113

Open
wants to merge 2 commits into
base: v3.x/staging
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions bin/libs/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,20 @@ export function findAllLaunchComponents2(): string[] {
});
}

function isClientAttls() {
const clientGlobalAttls = std.getenv("ZWE_zowe_network_client_tls_attls");
const serverGlobalAttls = std.getenv("ZWE_zowe_network_server_tls_attls");
let clientLocalAttls = std.getenv("ZWE_components_zaas_zowe_network_client_tls_attls");
let serverLocalAttls = std.getenv("ZWE_components_zaas_zowe_network_server_tls_attls");
let clientAttls = clientGlobalAttls || clientLocalAttls;
if ((clientGlobalAttls !== false) && (clientLocalAttls !== false) && (!clientAttls)) {
// If client attls not explicitly false OR truthy, have client follow server attls variable. it simplifies common case in which users want both.
return serverGlobalAttls || serverLocalAttls;
} else {
return clientAttls;
}
}

export function processComponentApimlStaticDefinitions(componentDir: string): boolean {
const STATIC_DEF_DIR=std.getenv('ZWE_STATIC_DEFINITIONS_DIR');
if (!STATIC_DEF_DIR) {
Expand Down Expand Up @@ -418,6 +432,22 @@ export function processComponentApimlStaticDefinitions(componentDir: string): bo

const contents = xplatform.loadFileUTF8(path,xplatform.AUTO_DETECT);
if (contents) {
const zosmfScheme = std.getenv("ZOSMF_SCHEME");
const attls = isClientAttls()
const schemeEnv = std.getenv("ZWE_zOSMF_scheme");

let scheme = "https";

if (zosmfScheme) {
scheme = zosmfScheme;
} else if (schemeEnv) {
scheme = schemeEnv;
} else if (attls) {
scheme = "http";
}

std.setenv('ZOSMF_SCHEME', scheme);

const resolvedContents = varlib.resolveShellTemplate(contents);

const zweCliParameterHaInstance=std.getenv("ZWE_CLI_PARAMETER_HA_INSTANCE");
Expand Down
Loading