Search code examples
aclconsul

Consul ACL Rule specification (HTTP API)


I'm trying to modify an ACL token I've just created by sending the following JSON via the HTTP API:

{
  "ID": "UUID HERE",
  "Name": "loadbalancer",
  "Type": "client",
  "Rules": "service {policy=read}"
}

However, this syntax for my Rules is being rejected. I've also tried sending information in JSON format similar to how it's documented in the ACL Internals page:

{
  "ID: "UUID HERE",
  "Name": "loadbalancer",
  "Type": "client",
  "Rules": 
  {
    "service":
    {
      "": { "policy": "read" }
    }
  }
}

These are all rejected as having incorrect formatting. What's the correct syntax here?


Solution

  • {
          "ID: "UUID HERE", ==> missing double quote in "ID"
          "Name": "loadbalancer",
          "Type": "client",
          "Rules": 
          {
            "service":
            {
              "": { "policy": "read" }
            }
          }
        }