Get Password Rules

Setropts Administration functions for obtaining the system’s password rules.

SetroptsAdmin.get_password_rules()

def get_password_rules(self) -> Union[dict, bytes]:

📄 Description

 

This functionality is currently considered Experimental due to it’s dependency on SetroptsAdmin.list_racf_options(). See SetroptsAdmin.list_racf_options() for more details.

 

Obtain the Password Rules for a system.

📥 Parameters

This method has no parameters.

📤 Returns

  • Union[dict, bytes]
    Returns a dictionary of the Password Rules for the system. If the SetroptsAdmin.generate_requests_only class attribute is set to True, concatenated Security Request XML bytes will be returned.

❌ Raises

  • SecurityRequestError
    Raises SecurityRequestError when the SAF Return Code of a Security Result is equal to 4.
  • DownstreamFatalError
    Raises DownstreamFatalError when the SAF Return Code of a Security Result is greater than 4.

💻 Example

Python REPL
>>> from pyracf import SetroptsAdmin
>>> setropts_admin = SetroptsAdmin()
>>> setropts_admin.get_password_rules()
{"rules":[{"minLength":4,"maxLength":8,"content":"********"}],"legend":{"A":"alpha","C":"consonant","L":"alphanumeric","N":"numeric","V":"vowel","W":"no vowel","*":"anything","c":"mixed consonant","m":"mixed numeric","v":"mixed vowel","$":"national","s":"special","x":"mixed all"}}
Password Rules Dictionary as JSON
{
  "rules": [
    {
      "minLength": 4,
      "maxLength": 8,
      "content": "********"
    }
  ],
  "legend": {
    "A": "alpha",
    "C": "consonant",
    "L": "alphanumeric",
    "N": "numeric",
    "V": "vowel",
    "W": "no vowel",
    "*": "anything",
    "c": "mixed consonant",
    "m": "mixed numeric",
    "v": "mixed vowel",
    "$": "national",
    "s": "special",
    "x": "mixed all"
  }
}