Skip to content

Bad authorization when importing a json file

I have the following file which defines two local servers, with one account each, and a rule with only one agent authorized

{
    "locals": [
      {
        "name": "gw-r66",
        "protocol": "r66",
        "address": "127.0.0.1:6668",
        "configuration": {
          "serverLogin": "gw-r66",
          "serverPassword": "password"
        },
        "accounts": [
          {
            "login": "central",
            "password": "password"
          }
        ]
      }, {
        "name": "gw-sftp",
        "protocol": "sftp",
        "address": "127.0.0.1:6622",
        "configuration": { },
        "accounts": [
          {
            "login": "partner",
            "password": "password"
          }
        ]
      }
    ],
    "rules": [
      {
        "name": "config-gw_2",
        "isSend": false,
        "path": "/config-gw_2",
        "pre": null,
        "post": [
          {
            "type": "EXEC",
            "args": {
              "args": "#TRUEFULLPATH#",
              "delay": "0",
              "path": "updateconf"
            }
          },
          {
            "type": "DELETE",
            "args": {}
          }
        ],
        "error": null,
        "auth": [
          "local::gw-r66::central"
        ],
        "inPath": "",
        "outPath": "",
        "workPath": ""
      }
    ]
  }

When I import it, both accounts are listed in the authorized agent:

$ wg rule list
Rules:
● Rule config-gw_2 (receive)
    Comment:        
    Path:           /config-gw_2
    In directory:   
    Out directory:  
    Work directory: 
    Pre tasks:
    Post tasks:
    ├─Command EXEC with args: {"args":"#TRUEFULLPATH#","delay":"0","path":"updateconf"}
    └─Command DELETE with args: {}
    Error tasks:
    Authorized agents:
    ├─Servers:          
    ├─Partners:         
    ├─Server accounts:  gw-r66.central, gw-sftp.partner
    └─Partner accounts: 
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information