Skip to content

HIPAA policy compliance #233

Description

@alexszilagyi

I am trying to contribute to this repo but first I am facing some issues. Maybe I did not get the documentation right.

I'm trying to add SpecialCharacterRule.swift

class SpecialCharacterRule: RegexRule {

    static let regex = "[!\"#$%&'()*+,-./:;<=>?@\\[\\\\\\]^_`{|}~]+"

    convenience init(message : String = "Password must contain %1$s or more special characters"){
        self.init(regex: SpecialCharacterRule.regex, message : message)
    }
}

NumericalSequencesRule.swift

class NumericalSequencesRule: RegexRule {

    static let regex = ##"^(?:0(?=1|$))?(?:1(?=2|$))?(?:2(?=3|$))?(?:3(?=4|$))?(?:4(?=5|$))?(?:5(?=6|$))?(?:6(?=7|$))?(?:7(?=8|$))?(?:8(?=9|$))?(?:9$)?$"##

    convenience init(message : String = "Password contains the illegal numerical sequence '%1$s"){
        self.init(regex: NumericalSequencesRule.regex, message : message)
    }
}

and QwertyRule.swift

class QwertyRule: RegexRule {

    static let regex = ##".*\\b\qwerty\\b.*"##
    
    convenience init(message : String = "Password contains the illegal QWERTY sequence '%1$s"){
        self.init(regex: QwertyRule.regex, message : message)
    }
}

Am I missing something? Why the conditions are not working? Meaning: SpecialCharacterRule, NumericalSequencesRule & QwertyRule does not pass and always returns invalid state !??!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions