Created
May 30, 2017 18:33
-
-
Save hadrianhu/3a58b9ce79f7e68e85c56c2a2e718cb1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* OUTER LOOP - THIS IS THE LOOP OF CLIENT | |
*/ | |
for (Auth0Client client : clientList) { | |
log("checking client:" + client.name); | |
/** | |
* INNER LOOP - FOR EACH CLIENT YOU ARE LOOPING THROUGHT THE LIST OF RULES | |
* AND CHECKING THE CLIENT NAME IN THE SCRIPTS FIELD | |
*/ | |
for (Auth0Rules rule : rulesList) { | |
//CREATE THE STRING TO CHECK FOR WHICH INCLUDES THE CLIENT NAME | |
String checkString = "context.clientName === '" + client.name + "'"; | |
//CHECK IF THE RULES FIELD CONTATINS THE CHECK STRING WITH THE APPLICATION NAME | |
if (rule.script.contains(checkString)) { | |
log("rule contains checkString:" + checkString); | |
client.rule = rule; | |
log("rule set to:" + client); | |
} else { | |
// log("rule does not contain not setting.."); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment