Created
September 15, 2014 18:39
-
-
Save dima767/c1caad3293b46ba56179 to your computer and use it in GitHub Desktop.
An initial prototype of SnakeYaml implementation of Yaml services registry for CAS
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
| @Grab(group='org.yaml', module='snakeyaml', version='1.14') | |
| import org.yaml.snakeyaml.* | |
| def yamlDoc = """ | |
| --- | |
| services: | |
| - | |
| id: 1 | |
| serviceId: https://www.google.com/** | |
| name: "GOOGLE" | |
| description: Test service with ant-style pattern matching | |
| theme: my_example_theme | |
| allowedToProxy: true | |
| enabled: true | |
| ssoEnabled: true | |
| anonymousAccess: false | |
| evaluationOrder: 1 | |
| allowedAttributes: [uid, mail] | |
| - | |
| id: 2 | |
| serviceId: https://yahoo.com | |
| name: YAHOO | |
| description: Test service with exact match on its serviceId and optional extra attributes | |
| evaluationOrder: 2 | |
| extraAttributes: | |
| someCustomAttribute: Custom attribute value | |
| - | |
| id: 3 | |
| serviceId: ^(https?|imaps?)://.* | |
| name: HTTPS or IMAPS | |
| description: Test service with regex-style pattern matching of any service either via HTTPS or IMAPS | |
| evaluationOrder: 3 | |
| """ | |
| def yaml = new Yaml() | |
| def map = yaml.load(yamlDoc) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment