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"]
}
| Identifier | Commands |
|---|---|
socketio:default | everything below |
socketio:allow-read | list, subscribe, unsubscribe, state, link_info (observe only: no connect, emit, ack or disconnect) |
socketio:allow-connect / allow-disconnect | connect / disconnect |
socketio:allow-emit / allow-emit-with-ack / allow-ack | emit / emit_with_ack / ack |
socketio:allow-set-auth / allow-set-headers / allow-set-query / allow-reconnect | set_auth / set_headers / set_query / reconnect |
socketio:allow-subscribe, allow-unsubscribe, allow-list, allow-state, allow-link-info | one 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(withattach). - 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,ackanddisconnecton those are refused whatever the capability says.