The WebApp object does not allow updating.
|
class WebApp(NestedDict): |
|
""" |
|
Represents a Web Application parameter. |
|
""" |
Therefore it is not possible too update the server certificate using the API.
I think it is meant to be update() able, as there is code using it:
|
def configure_saml_on_web_app(self, webapp_name, saml_settings_entries): |
|
""" |
|
Configure SAML settings on a WebApp by its identifier. |
|
:param str webapp_name: the identifier of the WebApp |
|
:param list of SamlSettings saml_settings or None: the list of SAML Settings to configure. |
|
If None, it will disable the SAML settings for the WebApp. |
|
:return: None |
|
:raises ValueError: if the WebApp with the given identifier is not found. |
|
""" |
|
web_app = self.get_web_app_by_identifier(webapp_name) |
|
if web_app: |
|
saml_usage = "web_access" |
|
new_saml_settings_entries = [s for s in web_app.data.get("saml_settings", []) if |
|
s.get("usage") != saml_usage] |
|
|
|
if saml_settings_entries: |
|
for entry in saml_settings_entries: |
|
entry["saml_setting_usage"] = saml_usage |
|
new_saml_settings_entries.append(entry) |
|
web_app.data["enable_saml_for_web_access"] = (saml_settings_entries is not None |
|
and len(saml_settings_entries) > 0) |
|
web_app.data["saml_settings"] = new_saml_settings_entries |
|
web_app.update() |
|
def configure_saml_on_web_app(self, webapp_name, saml_settings_entries): |
|
""" |
|
Configure SAML settings on a WebApp by its identifier. |
|
:param str webapp_name: the identifier of the WebApp |
|
:param list of SamlSettings saml_settings or None: the list of SAML Settings to configure. |
|
If None, it will disable the SAML settings for the WebApp. |
|
:return: None |
|
:raises ValueError: if the WebApp with the given identifier is not found. |
|
""" |
|
web_app = self.get_web_app_by_identifier(webapp_name) |
|
if web_app: |
|
saml_usage = "web_access" |
|
new_saml_settings_entries = [s for s in web_app.data.get("saml_settings", []) if |
|
s.get("usage") != saml_usage] |
|
|
|
if saml_settings_entries: |
|
for entry in saml_settings_entries: |
|
entry["saml_setting_usage"] = saml_usage |
|
new_saml_settings_entries.append(entry) |
|
web_app.data["enable_saml_for_web_access"] = (saml_settings_entries is not None |
|
and len(saml_settings_entries) > 0) |
|
web_app.data["saml_settings"] = new_saml_settings_entries |
|
web_app.update() |
|
else: |
|
raise ValueError(f"WebApp with identifier {webapp_name} not found.") |
I need the WebApp object to be update()'able to allow updating certificates using the API, from ACME to SMC.
The WebApp object does not allow updating.
fp-NGFW-SMC-python/smc/elements/servers.py
Lines 207 to 210 in e04026d
Therefore it is not possible too update the server certificate using the API.
I think it is meant to be update() able, as there is code using it:
fp-NGFW-SMC-python/smc/elements/servers.py
Lines 803 to 825 in e04026d
fp-NGFW-SMC-python/smc/elements/servers.py
Lines 2358 to 2382 in e04026d
I need the WebApp object to be update()'able to allow updating certificates using the API, from ACME to SMC.