Skip to content

Commit 0b4340f

Browse files
author
Thibaud Baas
committed
FM: Setup Advanced Security SetupAction
1 parent df98c0a commit 0b4340f

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

dataikuapi/fm/instancesettingstemplates.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ def run_ansible_task(stage, yaml_string):
6464
"""
6565
Return a RUN_ANSIBLE_TASK SetupAction
6666
67-
:params object stage: a :class:`dataikuapi.fm.instancesettingstemplates.FMSetupActionStage`
68-
:params str yaml_string: a yaml encoded string defining the ansibles tasks to run
67+
:param object stage: a :class:`dataikuapi.fm.instancesettingstemplates.FMSetupActionStage`
68+
:param str yaml_string: a yaml encoded string defining the ansibles tasks to run
6969
"""
7070
return FMSetupAction(FMSetupActionType.RUN_ANSIBLE_TASKS, {"stage": stage.value, "ansibleTasks": yaml_string })
7171

@@ -74,10 +74,20 @@ def install_system_packages(packages):
7474
"""
7575
Return an INSTALL_SYSTEM_PACKAGES SetupAction
7676
77-
:params list packages: List of packages to install
77+
:param list packages: List of packages to install
7878
"""
7979
return FMSetupAction(FMSetupActionType.INSTALL_SYSTEM_PACKAGES, {"packages": packages })
8080

81+
@staticmethod
82+
def setup_advanced_security(basic_headers = True, hsts = False):
83+
"""
84+
Return an SETUP_ADVANCED_SECURITY SetupAction
85+
86+
:param boolean basic_headers: Optional, Prevent browsers to render Web content served by DSS to be embedded into a frame, iframe, embed or object tag. Defaults to True
87+
:param boolean hsts: Optional, Enforce HTTP Strict Transport Security. Defaults to False
88+
"""
89+
return FMSetupAction(FMSetupActionType.SETUP_ADVANCED_SECURITY, {"basic_headers": basic_headers, "hsts": hsts})
90+
8191
class FMSetupActionType(Enum):
8292
RUN_ANSIBLE_TASKS="RUN_ANSIBLE_TASKS"
8393
INSTALL_SYSTEM_PACKAGES="INSTALL_SYSTEM_PACKAGES"

0 commit comments

Comments
 (0)