Required Permissions Appears to Only Accept String, Not Array (Manifest V5)

In Manifest V5, the requiredPermissions property is used to allow network connections.

As it stands, it would appear that ‘domains’ property only functions with “all” as its value, and any form of array fails to be parsed. I cannot find any documentation on proper string formatting to get an array to be parsed properly.

End Goal: use websocket to connect to a port on localhost or 127.0.0.1

Invalid Setups (produce a ‘Permission Denied, Manifest Entry Not Found’ error):

  "requiredPermissions": {
    "network": {
      "domains": ["all"]
    },

  "requiredPermissions": {
    "network": {
      "domains": ["127.0.0.1"]
    },

  "requiredPermissions": {
    "network": {
      "domains": ["127.0.0.1:8001"]
    },

  "requiredPermissions": {
    "network": {
      "domains": ["//127.0.0.1:8001/"]
    },

  "requiredPermissions": {
    "network": {
      "domains": ["ws://127.0.0.1:8001/"]
    },


  "requiredPermissions": {
    "network": {
      "domains": ["localhost"]
    },

and so on...

Valid Setup

  "requiredPermissions": {
    "network": {
      "domains": "all"
    },

Your invalid setup is really invalid. It doesn’t match the docs at all. If you format it, you get nested requiredPermissions (IMO this should not even validate and throw an error upon plugin load):

  "requiredPermissions": {
    "network": {
      "domains": [
        "all"
      ]
    },
    "requiredPermissions": {
      "network": {
        "domains": [
          "127.0.0.1"
        ]
      },
      "requiredPermissions": {
        "network": {
          "domains": [
            "127.0.0.1:8001"
          ]
        },
        "requiredPermissions": {
          "network": {
            "domains": [
              "//127.0.0.1:8001/"
            ]
          },
          "requiredPermissions": {
            "network": {
              "domains": [
                "ws://127.0.0.1:8001/"
              ]
            },
            "requiredPermissions": {
              "network": {
                "domains": [
                  "localhost"
                ]
              }
            }
          }
        }
      }
    }
  }

Did you try this?

  "requiredPermissions": {
    "network": {
      "domains": ["localhost", "127.0.0.1"]
    }
  }

As far as I know, there was an error confirmed by someone in Adobe that 127.0.0.1 and localhost are not working due to a bug and meanwhile I can use all as a workaround. I hope it is going to be fixed soon. Unless it got fixed and your options is somehow invalid.

I think my putting all the bad examples in a single code block is not communicating properly. Each of the “requiredPermissions” properties In my post was tried on their own, such that only 1 ‘requiredPermissions’ property ever existed in the manifest at a time. I unloaded and then loaded my plugin six different times, using one of those “requiredPermissions” each time, and the first 5 produced the Permission Denied error.

Sorry for the confusion!

@Zob
Can you check if this documentation is of help.
v5 Manifest

‘localhost’ is not the same with “127.0.0.1” as regex is used to validate the input URL.
domains property should have a protocol such as ‘ws://127.0.0.1’ or ‘wss://127.0.0.1’ or ‘wss://localhost:8081’.
“127.0.0.1:8001”, “//127.0.0.1:8001/”, "localhost " are not valid.
“domains”: [“ws://127.0.0.1:8001/”] is valid and it should work. Please check if your WebSocket connects to ‘ws:’ than ‘wss:’ as they are not the same.

I had some issues setting up a version 5 manifest.

In the documentation here they list, “permissions” and “requiredPermissions”.

Here’s what worked for me so far:

{
  "manifestVersion": 5,
  "id": "Test-abcde",
  "name": "My UXP Plugin",
  "version": "1.0.0",
  "main": "index.html",
  "host": {
    "app": "XD",
    "minVersion": "55.0.0"
  },
  "entrypoints": [
      {
          "type": "command",
          "id": "openDialog",
          "label": {
            "default": "Show A Dialog"
          },
          "shortcut": { 
            "mac": "Cmd+Shift+a", 
            "win": "Ctrl+Shift+a" 
          }
      },
      {
          "type": "panel",
          "id": "mainPanel",
          "label": {
              "default": "Help Name"
          }
      }
  ],
  "icons": [
    { 
      "width": 23, "height": 23, 
      "path": "images/icon@1x.png", 
      "scale": [ 1, 2 ], 
      "theme": [ "dark", "darkest" ], 
      "species": [ "generic" ] 
    },
    {
      "width": 23, "height": 23, 
      "path": "images/icon@2x.png", 
      "scale": [ 1, 2 ], 
      "theme": [ "lightest", "light" ], 
      "species": [ "generic" ]
    }
  ],
  "requiredPermissions": {
    "clipboard": "readAndWrite",
    "webview": {
        "allow": "yes",
        "domains": [ "https://*.adobe.com", "https://*.google.com"]
    }
  }
}

It looks like that permission requires an array.

{
    "requiredPermissions": {
        "network": {
            "domains": [
                "https://source.unsplash.com",         
            ]
        }
    }
}