From: John Mulligan Date: Wed, 12 Mar 2025 21:34:12 +0000 (-0400) Subject: mgr/smb: add a password filer enum for input passwords X-Git-Tag: v20.3.0~184^2~4 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=32c2441cabf928094877d97a2af4e99052784657;p=ceph.git mgr/smb: add a password filer enum for input passwords Add a 2nd password filter enum but this one is only for input passwords. Specifically, the 'hidden' filter makes no sense because we don't want junk passwords in the data store so we only take unfiltered or base64 obscured password values. Signed-off-by: John Mulligan --- diff --git a/src/pybind/mgr/smb/enums.py b/src/pybind/mgr/smb/enums.py index 5606c3faf3c86..c1c7ec1117df6 100644 --- a/src/pybind/mgr/smb/enums.py +++ b/src/pybind/mgr/smb/enums.py @@ -115,3 +115,17 @@ class PasswordFilter(_StrEnum): NONE = 'none' BASE64 = 'base64' HIDDEN = 'hidden' + + +class InputPasswordFilter(_StrEnum): + """Filter type for input password values.""" + + NONE = 'none' + BASE64 = 'base64' + + def to_password_filter(self) -> PasswordFilter: + """Convert input password filter to password filter type.""" + # This is because python doesn't allow extending enums (with values) + # but we want a InputPasswordFilter to be a strict subset of the + # password filter enum. + return PasswordFilter(self.value)