Source code for q2_sdk.hq.db.password_policy

from enum import Enum
from lxml.objectify import IntElement, StringElement, BoolElement
from q2_sdk.core.dynamic_imports import (
    api_ExecuteStoredProcedure as ExecuteStoredProcedure,
)
from .db_object import DbObject
from .representation_row_base import RepresentationRowBase


[docs] class UiSource(Enum): OnlineBanking = "OnlineBanking" VoiceBanking = "VoiceBanking" BackOffice = "BackOffice" Merchant = "Merchant" Fax = "Fax" Notifications = "Notifications" API = "API" TextBanking = "TextBanking" OpenBanking = "OpenBanking"
[docs] class UiSourceId(Enum): OnlineBanking = 1 VoiceBanking = 2 BackOffice = 3 Merchant = 4 Fax = 5 Notifications = 6 API = 8 TextBanking = 9 OpenBanking = 10
[docs] class PasswordPolicyRow(RepresentationRowBase): # object name: type hinting = "column name in the db response" UISourceID: IntElement = "UISourceID" PasswordPolicyID: IntElement = "PasswordPolicyID" PasswordHistoryNumber: IntElement = "PasswordHistoryNumber" MaxPasswordAge: IntElement = "MaxPasswordAge" MinPasswordAge: IntElement = "MinPasswordAge" MaxPasswordLength: IntElement = "MaxPasswordLength" MinPasswordLength: IntElement = "MinPasswordLength" NumbersRequired: IntElement = "NumbersRequired" UpperCaseRequired: IntElement = "UpperCaseRequired" LowerCaseRequired: IntElement = "LowerCaseRequired" SpecialCharRequired: IntElement = "SpecialCharRequired" InvalidAttempts: IntElement = "InvalidAttempts" InvalidAction: IntElement = "InvalidAction" LimitRepeating: IntElement = "LimitRepeating" LimitAdjacent: IntElement = "LimitAdjacent" ExcludeCharList: StringElement = "ExcludeCharList" AutoResetHours: IntElement = "AutoResetHours" NewPwdExpirationHours: IntElement = "NewPwdExpirationHours" CQRCount: IntElement = "CQRCount" CQRInvalidAttempts: IntElement = "CQRInvalidAttempts" CaseSensitiveAnswer: IntElement = "CaseSensitiveAnswer" QuestionMinLength: IntElement = "QuestionMinLength" AnswerMinLength: IntElement = "AnswerMinLength" TACRequiredLostPwd: IntElement = "TACRequiredLostPwd" TACTTLMinutes: IntElement = "TACTTLMinutes" TACDeliveryViaVoice: IntElement = "TACDeliveryViaVoice" TACDeliveryViaEmail: IntElement = "TACDeliveryViaEmail" TACLength: IntElement = "TACLength" Description: StringElement = "Description" LoginMinLength: IntElement = "LoginMinLength" LoginMaxLength: IntElement = "LoginMaxLength" DormantDays: IntElement = "DormantDays" MlaMinLength: IntElement = "MlaMinLength" MlaMaxLength: IntElement = "MlaMaxLength" MlaRequireAlpha: BoolElement = "MlaRequireAlpha" MlaRequireNumeric: BoolElement = "MlaRequireNumeric" TACDeliveryViaSMS: BoolElement = "TACDeliveryViaSMS" OobInvalidAttempts: IntElement = "OobInvalidAttempts" OobInvalidAction: IntElement = "OobInvalidAction" ExcludeLoginCharList: StringElement = "ExcludeLoginCharList" LoginNumericRequired: BoolElement = "LoginNumericRequired" LoginAlphaRequired: BoolElement = "LoginAlphaRequired" LoginSpecialCharRequired: BoolElement = "LoginSpecialCharRequired"
[docs] class PasswordPolicy(DbObject): # GET_BY_NAME_KEY = "column in the db response" NAME = "PasswordPolicy" REPRESENTATION_ROW_CLASS = PasswordPolicyRow
[docs] async def get( self, ui_source: UiSource, group_id: int = None ) -> list[PasswordPolicyRow]: """ Gets a password policy for a given ui source. :param: ui_source: OnlineBanking, VoiceBanking, TextBanking, etc. :param: group_id: An optional parameter used for getting policy data for different zones if applicable """ assert isinstance(ui_source, UiSource), ( "Please supply a valid user ui source object" ) sql_parameters = [ ExecuteStoredProcedure.SqlParam( ExecuteStoredProcedure.DataType.VarChar, "UiSource", ui_source.value ) ] if group_id: sql_parameters.append( ExecuteStoredProcedure.SqlParam( ExecuteStoredProcedure.DataType.Int, "GroupId", group_id ) ) return await self.call_hq( "sdk_GetPasswordPolicyWithZones", ExecuteStoredProcedure.SqlParameters(sql_parameters), )