Compare commits

..
2 Commits
Author SHA1 Message Date
ReaperOfVeriod 0881bb9b0f Format generated Tauri schemas
Client dependency and security checks / audit (push) Canceled after 0s
Client checks / checks (push) Canceled after 0s
2026-10-25 05:49:25 +01:00
ReaperOfVeriod f7d466eddb Restore native client sessions 2026-10-25 05:49:21 +01:00
5 changed files with 1936 additions and 96 deletions
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
{} {}
+13 -41
View File
@@ -21,9 +21,7 @@
{ {
"description": "A list of capabilities.", "description": "A list of capabilities.",
"type": "object", "type": "object",
"required": [ "required": ["capabilities"],
"capabilities"
],
"properties": { "properties": {
"capabilities": { "capabilities": {
"description": "The list of capabilities.", "description": "The list of capabilities.",
@@ -39,10 +37,7 @@
"Capability": { "Capability": {
"description": "A grouping and boundary mechanism developers can use to isolate access to the IPC layer.\n\nIt controls application windows' and webviews' fine grained access to the Tauri core, application, or plugin commands. If a webview or its window is not matching any capability then it has no access to the IPC layer at all.\n\nThis can be done to create groups of windows, based on their required system access, which can reduce impact of frontend vulnerabilities in less privileged windows. Windows can be added to a capability by exact name (e.g. `main-window`) or glob patterns like `*` or `admin-*`. A Window can have none, one, or multiple associated capabilities.\n\n## Example\n\n```json { \"identifier\": \"main-user-files-write\", \"description\": \"This capability allows the `main` window on macOS and Windows access to `filesystem` write related commands and `dialog` commands to enable programmatic access to files selected by the user.\", \"windows\": [ \"main\" ], \"permissions\": [ \"core:default\", \"dialog:open\", { \"identifier\": \"fs:allow-write-text-file\", \"allow\": [{ \"path\": \"$HOME/test.txt\" }] }, ], \"platforms\": [\"macOS\",\"windows\"] } ```", "description": "A grouping and boundary mechanism developers can use to isolate access to the IPC layer.\n\nIt controls application windows' and webviews' fine grained access to the Tauri core, application, or plugin commands. If a webview or its window is not matching any capability then it has no access to the IPC layer at all.\n\nThis can be done to create groups of windows, based on their required system access, which can reduce impact of frontend vulnerabilities in less privileged windows. Windows can be added to a capability by exact name (e.g. `main-window`) or glob patterns like `*` or `admin-*`. A Window can have none, one, or multiple associated capabilities.\n\n## Example\n\n```json { \"identifier\": \"main-user-files-write\", \"description\": \"This capability allows the `main` window on macOS and Windows access to `filesystem` write related commands and `dialog` commands to enable programmatic access to files selected by the user.\", \"windows\": [ \"main\" ], \"permissions\": [ \"core:default\", \"dialog:open\", { \"identifier\": \"fs:allow-write-text-file\", \"allow\": [{ \"path\": \"$HOME/test.txt\" }] }, ], \"platforms\": [\"macOS\",\"windows\"] } ```",
"type": "object", "type": "object",
"required": [ "required": ["identifier", "permissions"],
"identifier",
"permissions"
],
"properties": { "properties": {
"identifier": { "identifier": {
"description": "Identifier of the capability.\n\n## Example\n\n`main-user-files-write`", "description": "Identifier of the capability.\n\n## Example\n\n`main-user-files-write`",
@@ -93,10 +88,7 @@
}, },
"platforms": { "platforms": {
"description": "Limit which target platforms this capability applies to.\n\nBy default all platforms are targeted.\n\n## Example\n\n`[\"macOS\",\"windows\"]`", "description": "Limit which target platforms this capability applies to.\n\nBy default all platforms are targeted.\n\n## Example\n\n`[\"macOS\",\"windows\"]`",
"type": [ "type": ["array", "null"],
"array",
"null"
],
"items": { "items": {
"$ref": "#/definitions/Target" "$ref": "#/definitions/Target"
} }
@@ -106,9 +98,7 @@
"CapabilityRemote": { "CapabilityRemote": {
"description": "Configuration for remote URLs that are associated with the capability.", "description": "Configuration for remote URLs that are associated with the capability.",
"type": "object", "type": "object",
"required": [ "required": ["urls"],
"urls"
],
"properties": { "properties": {
"urls": { "urls": {
"description": "Remote domains this capability refers to using the [URLPattern standard](https://urlpattern.spec.whatwg.org/).\n\n## Examples\n\n- \"https://*.mydomain.dev\": allows subdomains of mydomain.dev - \"https://mydomain.dev/api/*\": allows any subpath of mydomain.dev/api", "description": "Remote domains this capability refers to using the [URLPattern standard](https://urlpattern.spec.whatwg.org/).\n\n## Examples\n\n- \"https://*.mydomain.dev\": allows subdomains of mydomain.dev - \"https://mydomain.dev/api/*\": allows any subpath of mydomain.dev/api",
@@ -146,20 +136,14 @@
}, },
"allow": { "allow": {
"description": "Data that defines what is allowed by the scope.", "description": "Data that defines what is allowed by the scope.",
"type": [ "type": ["array", "null"],
"array",
"null"
],
"items": { "items": {
"$ref": "#/definitions/Value" "$ref": "#/definitions/Value"
} }
}, },
"deny": { "deny": {
"description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.", "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.",
"type": [ "type": ["array", "null"],
"array",
"null"
],
"items": { "items": {
"$ref": "#/definitions/Value" "$ref": "#/definitions/Value"
} }
@@ -167,9 +151,7 @@
} }
} }
], ],
"required": [ "required": ["identifier"]
"identifier"
]
} }
] ]
}, },
@@ -2278,39 +2260,29 @@
{ {
"description": "MacOS.", "description": "MacOS.",
"type": "string", "type": "string",
"enum": [ "enum": ["macOS"]
"macOS"
]
}, },
{ {
"description": "Windows.", "description": "Windows.",
"type": "string", "type": "string",
"enum": [ "enum": ["windows"]
"windows"
]
}, },
{ {
"description": "Linux.", "description": "Linux.",
"type": "string", "type": "string",
"enum": [ "enum": ["linux"]
"linux"
]
}, },
{ {
"description": "Android.", "description": "Android.",
"type": "string", "type": "string",
"enum": [ "enum": ["android"]
"android"
]
}, },
{ {
"description": "iOS.", "description": "iOS.",
"type": "string", "type": "string",
"enum": [ "enum": ["iOS"]
"iOS"
]
} }
] ]
} }
} }
} }
+13 -41
View File
@@ -21,9 +21,7 @@
{ {
"description": "A list of capabilities.", "description": "A list of capabilities.",
"type": "object", "type": "object",
"required": [ "required": ["capabilities"],
"capabilities"
],
"properties": { "properties": {
"capabilities": { "capabilities": {
"description": "The list of capabilities.", "description": "The list of capabilities.",
@@ -39,10 +37,7 @@
"Capability": { "Capability": {
"description": "A grouping and boundary mechanism developers can use to isolate access to the IPC layer.\n\nIt controls application windows' and webviews' fine grained access to the Tauri core, application, or plugin commands. If a webview or its window is not matching any capability then it has no access to the IPC layer at all.\n\nThis can be done to create groups of windows, based on their required system access, which can reduce impact of frontend vulnerabilities in less privileged windows. Windows can be added to a capability by exact name (e.g. `main-window`) or glob patterns like `*` or `admin-*`. A Window can have none, one, or multiple associated capabilities.\n\n## Example\n\n```json { \"identifier\": \"main-user-files-write\", \"description\": \"This capability allows the `main` window on macOS and Windows access to `filesystem` write related commands and `dialog` commands to enable programmatic access to files selected by the user.\", \"windows\": [ \"main\" ], \"permissions\": [ \"core:default\", \"dialog:open\", { \"identifier\": \"fs:allow-write-text-file\", \"allow\": [{ \"path\": \"$HOME/test.txt\" }] }, ], \"platforms\": [\"macOS\",\"windows\"] } ```", "description": "A grouping and boundary mechanism developers can use to isolate access to the IPC layer.\n\nIt controls application windows' and webviews' fine grained access to the Tauri core, application, or plugin commands. If a webview or its window is not matching any capability then it has no access to the IPC layer at all.\n\nThis can be done to create groups of windows, based on their required system access, which can reduce impact of frontend vulnerabilities in less privileged windows. Windows can be added to a capability by exact name (e.g. `main-window`) or glob patterns like `*` or `admin-*`. A Window can have none, one, or multiple associated capabilities.\n\n## Example\n\n```json { \"identifier\": \"main-user-files-write\", \"description\": \"This capability allows the `main` window on macOS and Windows access to `filesystem` write related commands and `dialog` commands to enable programmatic access to files selected by the user.\", \"windows\": [ \"main\" ], \"permissions\": [ \"core:default\", \"dialog:open\", { \"identifier\": \"fs:allow-write-text-file\", \"allow\": [{ \"path\": \"$HOME/test.txt\" }] }, ], \"platforms\": [\"macOS\",\"windows\"] } ```",
"type": "object", "type": "object",
"required": [ "required": ["identifier", "permissions"],
"identifier",
"permissions"
],
"properties": { "properties": {
"identifier": { "identifier": {
"description": "Identifier of the capability.\n\n## Example\n\n`main-user-files-write`", "description": "Identifier of the capability.\n\n## Example\n\n`main-user-files-write`",
@@ -93,10 +88,7 @@
}, },
"platforms": { "platforms": {
"description": "Limit which target platforms this capability applies to.\n\nBy default all platforms are targeted.\n\n## Example\n\n`[\"macOS\",\"windows\"]`", "description": "Limit which target platforms this capability applies to.\n\nBy default all platforms are targeted.\n\n## Example\n\n`[\"macOS\",\"windows\"]`",
"type": [ "type": ["array", "null"],
"array",
"null"
],
"items": { "items": {
"$ref": "#/definitions/Target" "$ref": "#/definitions/Target"
} }
@@ -106,9 +98,7 @@
"CapabilityRemote": { "CapabilityRemote": {
"description": "Configuration for remote URLs that are associated with the capability.", "description": "Configuration for remote URLs that are associated with the capability.",
"type": "object", "type": "object",
"required": [ "required": ["urls"],
"urls"
],
"properties": { "properties": {
"urls": { "urls": {
"description": "Remote domains this capability refers to using the [URLPattern standard](https://urlpattern.spec.whatwg.org/).\n\n## Examples\n\n- \"https://*.mydomain.dev\": allows subdomains of mydomain.dev - \"https://mydomain.dev/api/*\": allows any subpath of mydomain.dev/api", "description": "Remote domains this capability refers to using the [URLPattern standard](https://urlpattern.spec.whatwg.org/).\n\n## Examples\n\n- \"https://*.mydomain.dev\": allows subdomains of mydomain.dev - \"https://mydomain.dev/api/*\": allows any subpath of mydomain.dev/api",
@@ -146,20 +136,14 @@
}, },
"allow": { "allow": {
"description": "Data that defines what is allowed by the scope.", "description": "Data that defines what is allowed by the scope.",
"type": [ "type": ["array", "null"],
"array",
"null"
],
"items": { "items": {
"$ref": "#/definitions/Value" "$ref": "#/definitions/Value"
} }
}, },
"deny": { "deny": {
"description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.", "description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.",
"type": [ "type": ["array", "null"],
"array",
"null"
],
"items": { "items": {
"$ref": "#/definitions/Value" "$ref": "#/definitions/Value"
} }
@@ -167,9 +151,7 @@
} }
} }
], ],
"required": [ "required": ["identifier"]
"identifier"
]
} }
] ]
}, },
@@ -2278,39 +2260,29 @@
{ {
"description": "MacOS.", "description": "MacOS.",
"type": "string", "type": "string",
"enum": [ "enum": ["macOS"]
"macOS"
]
}, },
{ {
"description": "Windows.", "description": "Windows.",
"type": "string", "type": "string",
"enum": [ "enum": ["windows"]
"windows"
]
}, },
{ {
"description": "Linux.", "description": "Linux.",
"type": "string", "type": "string",
"enum": [ "enum": ["linux"]
"linux"
]
}, },
{ {
"description": "Android.", "description": "Android.",
"type": "string", "type": "string",
"enum": [ "enum": ["android"]
"android"
]
}, },
{ {
"description": "iOS.", "description": "iOS.",
"type": "string", "type": "string",
"enum": [ "enum": ["iOS"]
"iOS"
]
} }
] ]
} }
} }
} }
+44 -12
View File
@@ -31,6 +31,48 @@
} }
} }
async function loadAuthenticatedData() {
await loadActivity();
await loadNotifications();
await loadDiagnostics();
await loadOAuthStatus();
await loadCollaboration();
await loadCollaborators();
await loadBotCommands();
await loadBotSecrets();
await loadOverlays();
await loadBackups();
await loadStreamInfo();
connectRealtime();
}
async function restoreNativeSession() {
if (!nativeClientAvailable() || !username || !serverAddress) return;
try {
const settings: ClientSettings = { server_address: serverAddress, username };
const storedSession = await invoke<string | null>('load_server_session', { settings });
if (!storedSession) return;
const response = await fetch(`${serverAddress}/api/v1/auth/session`, {
headers: { authorization: `Bearer ${storedSession}` },
});
if (!response.ok) {
await invoke('clear_server_session', { settings });
return;
}
const result: { must_replace_credentials: boolean } = await response.json();
sessionToken = storedSession;
authenticated = true;
mustReplaceCredentials = result.must_replace_credentials;
connectionState = 'CONNECTED';
await loadAuthenticatedData();
if (mustReplaceCredentials) newUsername = username;
} catch {
// A stale keyring session must not prevent the normal login form from opening.
sessionToken = '';
authenticated = false;
}
}
let serverAddress = 'http://127.0.0.1:8787'; let serverAddress = 'http://127.0.0.1:8787';
let connectionState = 'OFFLINE'; let connectionState = 'OFFLINE';
let serverVersion = '—'; let serverVersion = '—';
@@ -239,18 +281,7 @@
authError = 'Login succeeded, but the session could not be stored in the Linux keyring.'; authError = 'Login succeeded, but the session could not be stored in the Linux keyring.';
}); });
connectionState = 'CONNECTED'; connectionState = 'CONNECTED';
await loadActivity(); await loadAuthenticatedData();
await loadNotifications();
await loadDiagnostics();
await loadOAuthStatus();
await loadCollaboration();
await loadCollaborators();
await loadBotCommands();
await loadBotSecrets();
await loadOverlays();
await loadBackups();
await loadStreamInfo();
connectRealtime();
if (!mustReplaceCredentials) password = ''; if (!mustReplaceCredentials) password = '';
if (mustReplaceCredentials) newUsername = username; if (mustReplaceCredentials) newUsername = username;
} catch (error) { } catch (error) {
@@ -1065,6 +1096,7 @@
await loadNativeSettings(); await loadNativeSettings();
void checkServer(); void checkServer();
void loadPublicCommands(); void loadPublicCommands();
void restoreNativeSession();
}); });
</script> </script>