File: authorization_1.conf

package info (click to toggle)
golang-github-nats-io-gnatsd 1.3.0%2Bgit20181112.3c52dc8-1.1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,612 kB
  • sloc: sh: 33; makefile: 10
file content (38 lines) | stat: -rw-r--r-- 925 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
listen:   127.0.0.1:-1

authorization {
  # Our role based permissions.

  # Superuser can do anything.
  super_user = {
    publish = ">"
    subscribe = ">"
  }
  # Can do requests on foo or bar, and subscribe to anything
  # that is a response to an _INBOX.
  #
  # Notice that authorization filters can be singletons or arrays.
  req_pub_user = {
    publish = ["req.foo", "req.bar"]
    subscribe = "_INBOX.>"
  }

  # Setup a default user that can subscribe to anything, but has
  # no publish capabilities.
  default_user = {
    subscribe = {
      allow: ["PUBLIC.>", "foo.*"]
      deny: "foo.bar"
    }
  }

  # Default permissions if none presented. e.g. susan below.
  default_permissions: $default_user

  # Users listed with persmissions.
  users = [
    {user: alice, password: foo, permissions: $super_user}
    {user: bob,   password: bar, permissions: $req_pub_user}
    {user: susan, password: baz}
  ]
}