security_policy#

scikitplot.mlflow.security_policy(policy)[source]#

Temporarily activate a SecurityPolicy for a context block.

Parameters:
policySecurityPolicy or None

Policy to activate. Pass None to disable enforcement within the block.

Yields:
None
Parameters:

policy (SecurityPolicy | None)

Return type:

Iterator[None]

See also

set_security_policy

Set the active policy globally.

Notes

Exception-safe: previous policy is always restored on exit.

Examples

>>> from scikitplot.mlflow._security import DEFAULT_SECURITY_POLICY, security_policy
>>> with security_policy(DEFAULT_SECURITY_POLICY):
...     pass  # session() calls here are guarded