Created
June 29, 2017 21:11
-
-
Save RackerWilliams/73fcc5fdbab0153e42b3af00ebcbee9d to your computer and use it in GitHub Desktop.
JSON attribute mapping rule with a complex XPath
This file contains 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
{ | |
"mapping": { | |
"rules": [ | |
{ | |
"remote": [ | |
{ | |
"path": "(:\n If the number of seconds is even, then the role should be\n nova:admin and lbaas:admin\n\n Otherwise the roles should be nova:observe and lbaas:observer.\n:)\nif ((xs:integer(seconds-from-time(current-time())) mod 2) = 0)\n then ('nova:admin','lbaas:admin')\n else ('nova:observer','lbaas:observer')\n", | |
"multiValue": true | |
} | |
], | |
"local": { | |
"user": { | |
"domain": "78334", | |
"name": "{D}", | |
"email": "{D}", | |
"roles": "{0}", | |
"expire": "{D}" | |
} | |
} | |
} | |
], | |
"version": "RAX-1" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment