Add a validation function that will be used for a future share login
control attribute.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
if opts is None:
return None
return {k: v for k, v in opts.items() if k != CUSTOM_CAUTION_KEY}
+
+
+def check_access_name(name: str) -> None:
+ if ' ' in name or '\t' in name or '\n' in name:
+ raise ValueError(
+ 'login name may not contain spaces, tabs, or newlines'
+ )
+ if len(name) > 128:
+ raise ValueError('login name may not exceed 128 characters')