public virtual void SetUp() { Runtime.SetProperty("java.security.krb5.realm", KerberosTestUtils.GetRealm()); Runtime.SetProperty("java.security.krb5.kdc", "localhost:88"); string rules = "RULE:[1:$1@$0](.*@YAHOO\\.COM)s/@.*//\n" + "RULE:[2:$1](johndoe)s/^.*$/guest/\n" + "RULE:[2:$1;$2](^.*;admin$)s/;admin$//\n" + "RULE:[2:$2](root)\n" + "DEFAULT"; KerberosName.SetRules(rules); KerberosName.PrintRules(); }
public virtual void TestToLowerCase() { string rules = "RULE:[1:$1]/L\n" + "RULE:[2:$1]/L\n" + "RULE:[2:$1;$2](^.*;admin$)s/;admin$///L\n" + "RULE:[2:$1;$2](^.*;guest$)s/;guest$//g/L\n" + "DEFAULT"; KerberosName.SetRules(rules); KerberosName.PrintRules(); CheckTranslation("*****@*****.**", "joe"); CheckTranslation("Joe/[email protected]", "joe"); CheckTranslation("Joe/[email protected]", "joe"); CheckTranslation("Joe/[email protected]", "joe"); }