Skip to content

Instantly share code, notes, and snippets.

@RogWilco
Created September 4, 2019 10:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RogWilco/6b143e915e19cc404c15f2adfba6f855 to your computer and use it in GitHub Desktop.
Save RogWilco/6b143e915e19cc404c15f2adfba6f855 to your computer and use it in GitHub Desktop.
{"$id":"https://github.com/proxyco/api-manage-models/blob/master/etc/Policy.document.schema.json","$schema":"http://json-schema.org/draft-07/schema#","title":"Proxy Authz Policy Document","description":"Defines the structure of the JSON document used to describe an access control policy.","required":["Version","Statement"],"type":"object","definitions":{"identifier":{"type":"string","description":"A Proxy entity identifier, namespaced by colons (i.e. device:4afe819b-31db-47f9-b84d-bee7d746ea23).","pattern":"^([A-Za-z]*:)+[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"},"RFC-5545":{"type":"string","description":"The Proxy-supported subset of RFC-5545 calendar scheduling syntax.","pattern":"^(DTSTART(;TZID=.*)?:[0-9]{4}(1[0-2]|0[1-9])(3[0-1]|[0-2][1-9])T([01][0-9]|2[0-3])[0-5][0-9][0-5][0-9]Z?)(\\n(RRULE:(FREQ=(SECONDLY|MINUTELY|HOURLY|DAILY|WEEKLY|MONTHLY|YEARLY)|UNTIL=[0-9]{4}(1[0-2]|0[1-9])(3[0-1]|[0-2][1-9])T([01][0-9]|2[0-3])[0-5][0-9][0-5][0-9]Z?|COUNT=[0-9]|INTERVAL=[0-9]|BYWEEKNO=[+-]?([0-4]?[0-9]|5[0-3])|WKST=(SU|MO|TU|WE|TH|FR|SA)|BYSECOND=[0-5][0-9](,[0-5][0-9])*|BYMINUTE=[0-5][0-9](,[0-5][0-9])*|BYHOUR=([01][0-9]|2[0-3])(,([01][0-9]|2[0-3]))*|BYDAY=[+-]?([0-4]?[0-9]|5[0-3])(SU|MO|TU|WE|TH|FR|SA)|BYMONTHDAY=[+-]?([12]?[0-9]|3[01])(,[+-]?([12]?[0-9]|3[01]))|BYYEARDAY=[+-]?([12]?[0-9]|3[0-6])[0-9](,[+-]?([12]?[0-9]|3[0-6])[0-9])|BYMONTH=(1?[0-2]|[0-9])(,(1?[0-2]|[0-9]))|BYSETPOS=[+-]?([12]?[0-9]|3[0-6])[0-9](,[+-]?([12]?[0-9]|3[0-6])[0-9]))(;(FREQ=(SECONDLY|MINUTELY|HOURLY|DAILY|WEEKLY|MONTHLY|YEARLY)|UNTIL=[0-9]{4}(1[0-2]|0[1-9])(3[0-1]|[0-2][1-9])T([01][0-9]|2[0-3])[0-5][0-9][0-5][0-9]Z?|COUNT=[0-9]|INTERVAL=[0-9]|BYWEEKNO=[+-]?([0-4]?[0-9]|5[0-3])|WKST=(SU|MO|TU|WE|TH|FR|SA)|BYSECOND=[0-5][0-9](,[0-5][0-9])*|BYMINUTE=[0-5][0-9](,[0-5][0-9])*|BYHOUR=([01][0-9]|2[0-3])(,([01][0-9]|2[0-3]))*|BYDAY=[+-]?([0-4]?[0-9]|5[0-3])(SU|MO|TU|WE|TH|FR|SA)|BYMONTHDAY=[+-]?([12]?[0-9]|3[01])(,[+-]?([12]?[0-9]|3[01]))|BYYEARDAY=[+-]?([12]?[0-9]|3[0-6])[0-9](,[+-]?([12]?[0-9]|3[0-6])[0-9])|BYMONTH=(1?[0-2]|[0-9])(,(1?[0-2]|[0-9]))|BYSETPOS=[+-]?([12]?[0-9]|3[0-6])[0-9](,[+-]?([12]?[0-9]|3[0-6])[0-9])))*|RDATE(;TZID=.*)?:[0-9]{4}(1[0-2]|0[1-9])(3[0-1]|[0-2][1-9])T([01][0-9]|2[0-3])[0-5][0-9][0-5][0-9]Z?|EXDATE(;TZID=.*)?:[0-9]{4}(1[0-2]|0[1-9])(3[0-1]|[0-2][1-9])T([01][0-9]|2[0-3])[0-5][0-9][0-5][0-9]Z?))*(\\nDTEND(;TZID=.*)?:[0-9]{4}(1[0-2]|0[1-9])(3[0-1]|[0-2][1-9])T([01][0-9]|2[0-3])[0-5][0-9][0-5][0-9]Z?)?$","examples":["DTSTART:20120201T023000Z","DTSTART:20120201T023000Z\nRRULE:FREQ=MONTHLY;COUNT=5","DTSTART:20120201T023000Z\nRDATE:20120701T023000Z,20120702T023000Z","EXRULE:FREQ=MONTHLY;COUNT=2","EXDATE:20120601T023000Z"]}},"properties":{"$schema":{"type":"string"},"Version":{"type":"string","description":"The document version, formatted as a date (YYYY-MM-DD).","format":"date"},"Statement":{"type":"object","required":["Effect","Action","Grant","Resource"],"properties":{"Effect":{"type":"string","description":"The effect of the policy when it is matched.","enum":["Allow","Deny"]},"Action":{"type":"array","description":"The desired action(s) to be taken.","items":{"type":"string"}},"Grant":{"type":"array","description":"The subject(s) for which the policy applies.","items":{"$ref":"#/definitions/identifier"}},"Resource":{"type":"array","description":"The resource(s) on which to take the specified action.","items":{"$ref":"#/definitions/identifier"}},"Ruleset":{"type":"object","description":"Defines additional conditions under which the policy applies.","properties":{"mode":{"type":"string","description":"Defines the conditions under which the policy is in effect."},"schedule":{"type":"array","description":"Defines a schedule under which the policy is in effect.","items":{"$ref":"#/definitions/RFC-5545"}}}}}}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment