Skip to content

Commit 099df2b

Browse files
committed
chore: fix perms
1 parent 3bc43a1 commit 099df2b

File tree

4 files changed

+132
-15
lines changed

4 files changed

+132
-15
lines changed

fixtures/e2e-apps/tauri/src-tauri/src/main.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -309,10 +309,6 @@ fn main() {
309309
write_clipboard,
310310
generate_test_logs,
311311
switch_to_main,
312-
// Service window management commands (add these):
313-
get_window_states, // <- Your service needs this
314-
get_window_handles, // <- Generic handles
315-
get_window_title, // <- Title lookup
316312
])
317313
.run(tauri::generate_context!())
318314
.expect("error while running tauri application");

packages/tauri-plugin/build.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,15 @@
2828

2929
const COMMANDS: &[&str] = &[
3030
"execute",
31-
"log_frontend",
31+
"log_frontend",
3232
"debug_plugin",
3333
"set_mock",
3434
"get_mock",
3535
"clear_mocks",
3636
"reset_mocks",
3737
"restore_mocks",
3838
"get_active_window_label",
39+
"get_window_states",
3940
"list_windows",
4041
"switch_to_main",
4142
];

packages/tauri-plugin/permissions/autogenerated/reference.md

Lines changed: 116 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,18 @@ Allows all WebDriverIO plugin commands for testing
44

55
#### This default permission set includes the following:
66

7-
- `allow-execute`
8-
- `allow-log-frontend`
9-
- `allow-debug-plugin`
10-
- `allow-set-mock`
11-
- `allow-get-mock`
12-
- `allow-clear-mocks`
13-
- `allow-reset-mocks`
14-
- `allow-restore-mocks`
7+
- `wdio:allow-execute`
8+
- `wdio:allow-log-frontend`
9+
- `wdio:allow-debug-plugin`
10+
- `wdio:allow-set-mock`
11+
- `wdio:allow-get-mock`
12+
- `wdio:allow-clear-mocks`
13+
- `wdio:allow-reset-mocks`
14+
- `wdio:allow-restore-mocks`
15+
- `wdio:allow-get-active-window-label`
16+
- `wdio:allow-get-window-states`
17+
- `wdio:allow-list-windows`
18+
- `wdio:allow-switch-to-main`
1519

1620
## Permission Table
1721

@@ -103,6 +107,32 @@ Denies the execute command without any pre-configured scope.
103107
<tr>
104108
<td>
105109

110+
`wdio:allow-get-active-window-label`
111+
112+
</td>
113+
<td>
114+
115+
Enables the get_active_window_label command without any pre-configured scope.
116+
117+
</td>
118+
</tr>
119+
120+
<tr>
121+
<td>
122+
123+
`wdio:deny-get-active-window-label`
124+
125+
</td>
126+
<td>
127+
128+
Denies the get_active_window_label command without any pre-configured scope.
129+
130+
</td>
131+
</tr>
132+
133+
<tr>
134+
<td>
135+
106136
`wdio:allow-get-mock`
107137

108138
</td>
@@ -129,6 +159,58 @@ Denies the get_mock command without any pre-configured scope.
129159
<tr>
130160
<td>
131161

162+
`wdio:allow-get-window-states`
163+
164+
</td>
165+
<td>
166+
167+
Enables the get_window_states command without any pre-configured scope.
168+
169+
</td>
170+
</tr>
171+
172+
<tr>
173+
<td>
174+
175+
`wdio:deny-get-window-states`
176+
177+
</td>
178+
<td>
179+
180+
Denies the get_window_states command without any pre-configured scope.
181+
182+
</td>
183+
</tr>
184+
185+
<tr>
186+
<td>
187+
188+
`wdio:allow-list-windows`
189+
190+
</td>
191+
<td>
192+
193+
Enables the list_windows command without any pre-configured scope.
194+
195+
</td>
196+
</tr>
197+
198+
<tr>
199+
<td>
200+
201+
`wdio:deny-list-windows`
202+
203+
</td>
204+
<td>
205+
206+
Denies the list_windows command without any pre-configured scope.
207+
208+
</td>
209+
</tr>
210+
211+
<tr>
212+
<td>
213+
132214
`wdio:allow-log-frontend`
133215

134216
</td>
@@ -227,6 +309,32 @@ Enables the set_mock command without any pre-configured scope.
227309

228310
Denies the set_mock command without any pre-configured scope.
229311

312+
</td>
313+
</tr>
314+
315+
<tr>
316+
<td>
317+
318+
`wdio:allow-switch-to-main`
319+
320+
</td>
321+
<td>
322+
323+
Enables the switch_to_main command without any pre-configured scope.
324+
325+
</td>
326+
</tr>
327+
328+
<tr>
329+
<td>
330+
331+
`wdio:deny-switch-to-main`
332+
333+
</td>
334+
<td>
335+
336+
Denies the switch_to_main command without any pre-configured scope.
337+
230338
</td>
231339
</tr>
232340
</table>

packages/tauri-plugin/permissions/schemas/schema.json

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,18 @@
315315
"const": "deny-get-mock",
316316
"markdownDescription": "Denies the get_mock command without any pre-configured scope."
317317
},
318+
{
319+
"description": "Enables the get_window_states command without any pre-configured scope.",
320+
"type": "string",
321+
"const": "allow-get-window-states",
322+
"markdownDescription": "Enables the get_window_states command without any pre-configured scope."
323+
},
324+
{
325+
"description": "Denies the get_window_states command without any pre-configured scope.",
326+
"type": "string",
327+
"const": "deny-get-window-states",
328+
"markdownDescription": "Denies the get_window_states command without any pre-configured scope."
329+
},
318330
{
319331
"description": "Enables the list_windows command without any pre-configured scope.",
320332
"type": "string",
@@ -388,10 +400,10 @@
388400
"markdownDescription": "Denies the switch_to_main command without any pre-configured scope."
389401
},
390402
{
391-
"description": "Allows all WebDriverIO plugin commands for testing\n#### This default permission set includes:\n\n- `wdio:allow-execute`\n- `wdio:allow-log-frontend`\n- `wdio:allow-debug-plugin`\n- `wdio:allow-set-mock`\n- `wdio:allow-get-mock`\n- `wdio:allow-clear-mocks`\n- `wdio:allow-reset-mocks`\n- `wdio:allow-restore-mocks`\n- `wdio:allow-get-active-window-label`\n- `wdio:allow-list-windows`\n- `wdio:allow-switch-to-main`",
403+
"description": "Allows all WebDriverIO plugin commands for testing\n#### This default permission set includes:\n\n- `wdio:allow-execute`\n- `wdio:allow-log-frontend`\n- `wdio:allow-debug-plugin`\n- `wdio:allow-set-mock`\n- `wdio:allow-get-mock`\n- `wdio:allow-clear-mocks`\n- `wdio:allow-reset-mocks`\n- `wdio:allow-restore-mocks`\n- `wdio:allow-get-active-window-label`\n- `wdio:allow-get-window-states`\n- `wdio:allow-list-windows`\n- `wdio:allow-switch-to-main`",
392404
"type": "string",
393405
"const": "default",
394-
"markdownDescription": "Allows all WebDriverIO plugin commands for testing\n#### This default permission set includes:\n\n- `wdio:allow-execute`\n- `wdio:allow-log-frontend`\n- `wdio:allow-debug-plugin`\n- `wdio:allow-set-mock`\n- `wdio:allow-get-mock`\n- `wdio:allow-clear-mocks`\n- `wdio:allow-reset-mocks`\n- `wdio:allow-restore-mocks`\n- `wdio:allow-get-active-window-label`\n- `wdio:allow-list-windows`\n- `wdio:allow-switch-to-main`"
406+
"markdownDescription": "Allows all WebDriverIO plugin commands for testing\n#### This default permission set includes:\n\n- `wdio:allow-execute`\n- `wdio:allow-log-frontend`\n- `wdio:allow-debug-plugin`\n- `wdio:allow-set-mock`\n- `wdio:allow-get-mock`\n- `wdio:allow-clear-mocks`\n- `wdio:allow-reset-mocks`\n- `wdio:allow-restore-mocks`\n- `wdio:allow-get-active-window-label`\n- `wdio:allow-get-window-states`\n- `wdio:allow-list-windows`\n- `wdio:allow-switch-to-main`"
395407
}
396408
]
397409
}

0 commit comments

Comments
 (0)