Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion ibmsecurity/isam/web/reverse_proxy/configuration/entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def set(isamAppliance, reverseproxy_id, stanza_id, entries, check_mode=False, fo
"""
Set a configuration entry or entries by stanza - Reverse Proxy

Note: entries has to be [['key', 'value1'], ['key', 'value2]], cannot provide [['key', ['value1', 'value2']]]
Note: entries has to be [['key', 'value1'], ['key', 'value2']], cannot provide [['key', ['value1', 'value2']]]
get() returns the second format - thus lots of logic to handle this discrepancy.

Smart enough to update only that which is needed.
Expand Down
23 changes: 20 additions & 3 deletions ibmsecurity/isam/web/reverse_proxy/junctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,10 @@ def set(isamAppliance, reverseproxy_id, junction_point, server_hostname, server_
client_ip_http=None, version_two_cookies=None, ltpa_keyfile=None, authz_rules=None, fsso_config_file=None,
username=None, password=None, server_uuid=None, local_ip=None, ltpa_keyfile_password=None,
delegation_support=None, scripting_support=None, insert_ltpa_cookies=None, check_mode=False, force=False,
http2_junction=None, http2_proxy=None, sni_name=None, description=None):
http2_junction=None, http2_proxy=None, sni_name=None, description=None, ignore_password_for_idempotency=False):
"""
Setting a standard or virtual junction - compares with existing junction and replaces if changes are detected
TODO: Compare all the parameters in the function - LTPA, BA are some that are not being compared
TODO: Compare all the parameters in the function - BA are some that are not being compared
"""
warnings = []
add_required = False
Expand Down Expand Up @@ -508,6 +508,23 @@ def set(isamAppliance, reverseproxy_id, junction_point, server_hostname, server_
sni_name = None
else:
jct_json['sni_name'] = sni_name
if insert_ltpa_cookies is not None:
if insert_ltpa_cookies != 'no':
jct_json['insert_ltpa_cookies'] = insert_ltpa_cookies

if ltpa_keyfile is not None:
jct_json['ltpa_keyfile'] = ltpa_keyfile

if version_two_cookies is not None:
jct_json['version_two_cookies'] = version_two_cookies

if ltpa_keyfile_password is not None:
if ignore_password_for_idempotency:
warnings.append("Request made to ignore ltpa_keyfile_password for idempotency check.")
if 'ltpa_keyfile_password' in exist_jct:
del exist_jct['ltpa_keyfile_password']
else:
jct_json['ltpa_keyfile_password'] = ltpa_keyfile_password
if description is not None:
if tools.version_compare(isamAppliance.facts["version"], "9.0.7.0") < 0:
warnings.append(
Expand Down Expand Up @@ -562,7 +579,7 @@ def set(isamAppliance, reverseproxy_id, junction_point, server_hostname, server_
insert_ltpa_cookies=insert_ltpa_cookies, check_mode=check_mode, force=True,
http2_junction=http2_junction, http2_proxy=http2_proxy, sni_name=sni_name, description=description, warnings=warnings)

return isamAppliance.create_return_object()
return isamAppliance.create_return_object(warnings=warnings)


def compare(isamAppliance1, isamAppliance2, reverseproxy_id, reverseproxy_id2=None):
Expand Down
5 changes: 4 additions & 1 deletion ibmsecurity/isam/web/reverse_proxy/junctions_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def search(isamAppliance, reverseproxy_id, junction_point, server_hostname, serv
def add(isamAppliance, reverseproxy_id, junction_point, server_hostname, junction_type, server_port, server_dn=None,
stateful_junction='no', case_sensitive_url='no', windows_style_url='no', virtual_hostname=None,
virtual_https_hostname=None, query_contents=None, https_port=None, http_port=None, proxy_hostname=None,
proxy_port=None, sms_environment=None, vhost_label=None, server_uuid=None, check_mode=False, force=False):
proxy_port=None, sms_environment=None, vhost_label=None, server_uuid=None, local_ip=None, check_mode=False, force=False):
"""
Adding a back-end server to an existing standard or virtual junctions

Expand All @@ -46,6 +46,7 @@ def add(isamAppliance, reverseproxy_id, junction_point, server_hostname, junctio
:param sms_environment:
:param vhost_label:
:param server_uuid:
:param local_ip:
:param check_mode:
:param force:
:return:
Expand Down Expand Up @@ -89,6 +90,8 @@ def add(isamAppliance, reverseproxy_id, junction_point, server_hostname, junctio
jct_srv_json["query_contents"] = query_contents
if server_uuid is not None and server_uuid != '':
jct_srv_json["server_uuid"] = server_uuid
if local_ip is not None and local_ip != '':
jct_srv_json['local_ip'] = local_ip

return isamAppliance.invoke_put(
"Adding a back-end server to an existing standard or virtual junctions",
Expand Down