Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HIPAA policy compliance #233

Open
alexszilagyi opened this issue Mar 12, 2021 · 0 comments
Open

HIPAA policy compliance #233

alexszilagyi opened this issue Mar 12, 2021 · 0 comments

Comments

@alexszilagyi
Copy link

alexszilagyi commented Mar 12, 2021

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 !??!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant