Tauri plugin

Permissions

The default and allow-read sets and one permission per command.

Grant permissions in a capability file of your app:

src-tauri/capabilities/default.json
{
  "identifier": "default",
  "windows": ["main"],
  "permissions": ["core:default", "socketio:default"]
}
IdentifierCommands
socketio:defaulteverything below
socketio:allow-readlist, subscribe, unsubscribe, state, link_info (observe only: no connect, emit, ack or disconnect)
socketio:allow-connect / allow-disconnectconnect / disconnect
socketio:allow-emit / allow-emit-with-ack / allow-ackemit / emit_with_ack / ack
socketio:allow-set-auth / allow-set-headers / allow-set-query / allow-reconnectset_auth / set_headers / set_query / reconnect
socketio:allow-subscribe, allow-unsubscribe, allow-list, allow-state, allow-link-infoone each

Every allow-* has a deny-*. The full generated table is in permissions/autogenerated/reference.md.

A command the capability does not allow rejects in JS with SocketIoError of kind Ipc (... not allowed).

Choosing a set

  • Windows that only display data from a socket: socketio:allow-read (with attach).
  • Windows that open their own sockets: socketio:default, plus a URL allow-list.
  • Permissions decide which commands a window may call. They do not override read-only clients: emit, ack and disconnect on those are refused whatever the capability says.