{"title":"Centro authorization token schema","description":"Schema for authorization tokens sent by clients to a Centro server","$schema":"http://json-schema.org/draft-07/schema#","$id":"https://davedoesdev.com/schemas/centro.json","type":"object","properties":{"exp":{"description":"Token expiry time (in seconds since 1970-01-01)","type":"integer"},"iss":{"description":"Token issuer","type":"string","maxLength":128},"access_control":{"description":"Which topics clients presenting this token can subscribe and publish to. See <a href=\"https://github.com/davedoesdev/mqlobber-access-control\">mqlobber-access-control</a>.","type":"object","required":["publish","subscribe"],"additionalProperties":false,"properties":{"publish":{"description":"Allowed and disallowed topics for publish requests","type":"object","required":["allow","disallow"],"additionalProperties":false,"properties":{"allow":{"description":"Clients can publish messages to these topics","type":"array","maxItems":1000,"items":{"description":"Topic","type":"string","pattern":"^(?=[^\\u002e]*(\\u002e[^\\u002e]*){0,99}$)(?=([^\\u0023]|((?<!(^|\\u002e))\\u0023)|\\u0023(?!($|\\u002e)))*(((?<=(^|\\u002e))\\u0023(?=($|\\u002e)))([^\\u0023]|((?<!(^|\\u002e))\\u0023)|\\u0023(?!($|\\u002e)))*){0,3}$)(?=.{0,4096}$)"}},"disallow":{"description":"Clients cannot publish messages to these topics","type":"array","maxItems":1000,"items":{"description":"Topic","type":"string","pattern":"^(?=[^\\u002e]*(\\u002e[^\\u002e]*){0,99}$)(?=([^\\u0023]|((?<!(^|\\u002e))\\u0023)|\\u0023(?!($|\\u002e)))*(((?<=(^|\\u002e))\\u0023(?=($|\\u002e)))([^\\u0023]|((?<!(^|\\u002e))\\u0023)|\\u0023(?!($|\\u002e)))*){0,3}$)(?=.{0,4096}$)"}},"disallow_single":{"description":"If true then clients cannot publish messages to a single subscriber","type":"boolean"},"disallow_multi":{"description":"If true then clients cannot publish messages to multiple subscribers","type":"boolean"}}},"subscribe":{"description":"Allowed and disallowed topics for subscribe requests","type":"object","required":["allow","disallow"],"additionalProperties":false,"properties":{"allow":{"description":"Clients can subscribe to messages published to these topics","type":"array","maxItems":1000,"items":{"description":"Topic","type":"string","pattern":"^(?=[^\\u002e]*(\\u002e[^\\u002e]*){0,99}$)(?=([^\\u0023]|((?<!(^|\\u002e))\\u0023)|\\u0023(?!($|\\u002e)))*(((?<=(^|\\u002e))\\u0023(?=($|\\u002e)))([^\\u0023]|((?<!(^|\\u002e))\\u0023)|\\u0023(?!($|\\u002e)))*){0,3}$)(?=.{0,4096}$)"}},"disallow":{"description":"Clients cannot subscribe to messages published to these topics","type":"array","maxItems":1000,"items":{"description":"Topic","type":"string","pattern":"^(?=[^\\u002e]*(\\u002e[^\\u002e]*){0,99}$)(?=([^\\u0023]|((?<!(^|\\u002e))\\u0023)|\\u0023(?!($|\\u002e)))*(((?<=(^|\\u002e))\\u0023(?=($|\\u002e)))([^\\u0023]|((?<!(^|\\u002e))\\u0023)|\\u0023(?!($|\\u002e)))*){0,3}$)(?=.{0,4096}$)"}}}},"block":{"description":"Clients cannot receive messages published to these topics. This is useful is subscribe.allow is a superset of subscribe.disallow but you don't want messages matching (a subset of) subscribe.disallow sent to clients","type":"array","maxItems":1000,"items":{"description":"Topic","type":"string","pattern":"^(?=[^\\u002e]*(\\u002e[^\\u002e]*){0,99}$)(?=([^\\u0023]|((?<!(^|\\u002e))\\u0023)|\\u0023(?!($|\\u002e)))*(((?<=(^|\\u002e))\\u0023(?=($|\\u002e)))([^\\u0023]|((?<!(^|\\u002e))\\u0023)|\\u0023(?!($|\\u002e)))*){0,3}$)(?=.{0,4096}$)"}}}},"subscribe":{"description":"Clients presenting this token are pre-subscribed to these topics","type":"object","maxProperties":1000,"additionalProperties":false,"patternProperties":{"^(?=[^\\u002e]*(\\u002e[^\\u002e]*){0,99}$)(?=([^\\u0023]|((?<!(^|\\u002e))\\u0023)|\\u0023(?!($|\\u002e)))*(((?<=(^|\\u002e))\\u0023(?=($|\\u002e)))([^\\u0023]|((?<!(^|\\u002e))\\u0023)|\\u0023(?!($|\\u002e)))*){0,3}$)(?=.{0,4096}$)":{"description":"If true then presenting clients will be sent any existing, unexpired messages that match the topic, as well as new ones","type":"boolean"}}},"ack":{"description":"Publish an acknowledgement message when a client presenting this token acknowledges receipt of a message. See <a href=\"https://github.com/davedoesdev/mqlobber#mqlobberservereventsackinfo\">mqlobber</a>.","type":"object","required":["prefix"],"additionalProperties":false,"properties":{"prefix":{"description":"The acknowledgement message's topic will be the original message's topic appended to this prefix. The body will be empty","type":"string","pattern":"^(?=[^\\u002e]*(\\u002e[^\\u002e]*){0,99}$)(?=([^\\u0023]|((?<!(^|\\u002e))\\u0023)|\\u0023(?!($|\\u002e)))*(((?<=(^|\\u002e))\\u0023(?=($|\\u002e)))([^\\u0023]|((?<!(^|\\u002e))\\u0023)|\\u0023(?!($|\\u002e)))*){0,3}$)(?=.{0,4096}$)"}}},"presence":{"description":"Publish a presence message when a client presenting this token connects or disconnects","type":"object","required":["connect","disconnect"],"additionalProperties":false,"properties":{"connect":{"description":"Describes the message to publish when a client connects","type":"object","required":["topic"],"additionalProperties":false,"properties":{"topic":{"description":"Message topic","type":"string","pattern":"^(?=[^\\u002e]*(\\u002e[^\\u002e]*){0,99}$)(?=([^\\u0023]|((?<!(^|\\u002e))\\u0023)|\\u0023(?!($|\\u002e)))*(((?<=(^|\\u002e))\\u0023(?=($|\\u002e)))([^\\u0023]|((?<!(^|\\u002e))\\u0023)|\\u0023(?!($|\\u002e)))*){0,3}$)(?=.{0,4096}$)"},"single":{"description":"Whether the message will be given to at most one interested client","type":"boolean"},"ttl":{"description":"Time-to-live (in seconds) for the message","type":"integer","minimum":0},"data":{"description":"Message body","type":"string","maxLength":1048576}}},"disconnect":{"description":"Describes the message to publish when a client disconnects","type":"object","required":["topic"],"additionalProperties":false,"properties":{"topic":{"description":"Message topic","type":"string","pattern":"^(?=[^\\u002e]*(\\u002e[^\\u002e]*){0,99}$)(?=([^\\u0023]|((?<!(^|\\u002e))\\u0023)|\\u0023(?!($|\\u002e)))*(((?<=(^|\\u002e))\\u0023(?=($|\\u002e)))([^\\u0023]|((?<!(^|\\u002e))\\u0023)|\\u0023(?!($|\\u002e)))*){0,3}$)(?=.{0,4096}$)"},"single":{"description":"Whether the message will be given to at most one interested client","type":"boolean"},"ttl":{"description":"Time-to-live (in seconds) for the message","type":"integer","minimum":0},"data":{"description":"Message body","type":"string","maxLength":1048576}}}}}}}
