Skip to content

Commit

Permalink
fix clippy - regen permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianLars committed Jul 2, 2024
1 parent e462494 commit eb9c270
Show file tree
Hide file tree
Showing 58 changed files with 7,288 additions and 731 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/lint-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ jobs:
tauri-plugin-clipboard-manager:
- .github/workflows/lint-rust.yml
- plugins/clipboard-manager/**
tauri-plugin-deep-link:
- .github/workflows/lint-rust.yml
- plugins/deep-link/**
tauri-plugin-dialog:
- .github/workflows/lint-rust.yml
- plugins/dialog/**
Expand Down
35 changes: 25 additions & 10 deletions examples/api/src-tauri/gen/schemas/desktop-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,24 @@
],
"definitions": {
"Capability": {
"description": "a grouping and boundary mechanism developers can use to separate windows or plugins functionality from each other at runtime.\n\nIf a window is not matching any capability then it has no access to the IPC layer at all.\n\nThis can be done to create trust groups and reduce impact of vulnerabilities in certain plugins or windows. Windows can be added to a capability by exact name or glob patterns like *, admin-* or main-window.",
"description": "A grouping and boundary mechanism developers can use to isolate access to the IPC layer.\n\nIt controls application windows fine grained access to the Tauri core, application, or plugin commands. If a 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 programatic access to files selected by the user.\", \"windows\": [ \"main\" ], \"permissions\": [ \"path:default\", \"dialog:open\", { \"identifier\": \"fs:allow-write-text-file\", \"allow\": [{ \"path\": \"$HOME/test.txt\" }] }, \"platforms\": [\"macOS\",\"windows\"] } ```",
"type": "object",
"required": [
"identifier",
"permissions"
],
"properties": {
"identifier": {
"description": "Identifier of the capability.",
"description": "Identifier of the capability.\n\n## Example\n\n`main-user-files-write`",
"type": "string"
},
"description": {
"description": "Description of the capability.",
"description": "Description of what the capability is intended to allow on associated windows.\n\nIt should contain a description of what the grouped permissions should allow.\n\n## Example\n\nThis capability allows the `main` window access to `filesystem` write related commands and `dialog` commands to enable programatic access to files selected by the user.",
"default": "",
"type": "string"
},
"remote": {
"description": "Configure remote URLs that can use the capability permissions.",
"description": "Configure remote URLs that can use the capability permissions.\n\nThis setting is optional and defaults to not being set, as our default use case is that the content is served from our local application.\n\n:::caution Make sure you understand the security implications of providing remote sources with local system access. :::\n\n## Example\n\n```json { \"urls\": [\"https://*.mydomain.dev\"] } ```",
"anyOf": [
{
"$ref": "#/definitions/CapabilityRemote"
Expand All @@ -70,28 +70,29 @@
"type": "boolean"
},
"windows": {
"description": "List of windows that uses this capability. Can be a glob pattern.\n\nOn multiwebview windows, prefer [`Self::webviews`] for a fine grained access control.",
"description": "List of windows that are affected by this capability. Can be a glob pattern.\n\nOn multiwebview windows, prefer [`Self::webviews`] for a fine grained access control.\n\n## Example\n\n`[\"main\"]`",
"type": "array",
"items": {
"type": "string"
}
},
"webviews": {
"description": "List of webviews that uses this capability. Can be a glob pattern.\n\nThis is only required when using on multiwebview contexts, by default all child webviews of a window that matches [`Self::windows`] are linked.",
"description": "List of webviews that are affected by this capability. Can be a glob pattern.\n\nThis is only required when using on multiwebview contexts, by default all child webviews of a window that matches [`Self::windows`] are linked.\n\n## Example\n\n`[\"sub-webview-one\", \"sub-webview-two\"]`",
"type": "array",
"items": {
"type": "string"
}
},
"permissions": {
"description": "List of permissions attached to this capability. Must include the plugin name as prefix in the form of `${plugin-name}:${permission-name}`.",
"description": "List of permissions attached to this capability.\n\nMust include the plugin name as prefix in the form of `${plugin-name}:${permission-name}`. For commands directly implemented in the application itself only `${permission-name}` is required.\n\n## Example\n\n```json [ \"path:default\", \"event:default\", \"window:default\", \"app:default\", \"image:default\", \"resources:default\", \"menu:default\", \"tray:default\", \"shell:allow-open\", \"dialog:open\", { \"identifier\": \"fs:allow-write-text-file\", \"allow\": [{ \"path\": \"$HOME/test.txt\" }] } ```",
"type": "array",
"items": {
"$ref": "#/definitions/PermissionEntry"
}
},
"uniqueItems": true
},
"platforms": {
"description": "Target platforms this capability applies. By default all platforms are affected by this capability.",
"description": "Limit which target platforms this capability applies to.\n\nBy default all platforms are targeted.\n\n## Example\n\n`[\"macOS\",\"windows\"]`",
"type": [
"array",
"null"
Expand All @@ -110,7 +111,7 @@
],
"properties": {
"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",
"type": "array",
"items": {
"type": "string"
Expand Down Expand Up @@ -2504,6 +2505,13 @@
"app:allow-app-show"
]
},
{
"description": "app:allow-default-window-icon -> Enables the default_window_icon command without any pre-configured scope.",
"type": "string",
"enum": [
"app:allow-default-window-icon"
]
},
{
"description": "app:allow-name -> Enables the name command without any pre-configured scope.",
"type": "string",
Expand Down Expand Up @@ -2539,6 +2547,13 @@
"app:deny-app-show"
]
},
{
"description": "app:deny-default-window-icon -> Denies the default_window_icon command without any pre-configured scope.",
"type": "string",
"enum": [
"app:deny-default-window-icon"
]
},
{
"description": "app:deny-name -> Denies the name command without any pre-configured scope.",
"type": "string",
Expand Down
152 changes: 140 additions & 12 deletions plugins/authenticator/permissions/autogenerated/reference.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,140 @@
| Permission | Description |
|------|-----|
|`allow-init-auth`|Enables the init_auth command without any pre-configured scope.|
|`deny-init-auth`|Denies the init_auth command without any pre-configured scope.|
|`allow-register`|Enables the register command without any pre-configured scope.|
|`deny-register`|Denies the register command without any pre-configured scope.|
|`allow-sign`|Enables the sign command without any pre-configured scope.|
|`deny-sign`|Denies the sign command without any pre-configured scope.|
|`allow-verify-registration`|Enables the verify_registration command without any pre-configured scope.|
|`deny-verify-registration`|Denies the verify_registration command without any pre-configured scope.|
|`allow-verify-signature`|Enables the verify_signature command without any pre-configured scope.|
|`deny-verify-signature`|Denies the verify_signature command without any pre-configured scope.|

### Permission Table

<table>
<tr>
<th>Identifier</th>
<th>Description</th>
</tr>


<tr>
<td>

`authenticator:allow-init-auth`

</td>
<td>

Enables the init_auth command without any pre-configured scope.

</td>
</tr>

<tr>
<td>

`authenticator:deny-init-auth`

</td>
<td>

Denies the init_auth command without any pre-configured scope.

</td>
</tr>

<tr>
<td>

`authenticator:allow-register`

</td>
<td>

Enables the register command without any pre-configured scope.

</td>
</tr>

<tr>
<td>

`authenticator:deny-register`

</td>
<td>

Denies the register command without any pre-configured scope.

</td>
</tr>

<tr>
<td>

`authenticator:allow-sign`

</td>
<td>

Enables the sign command without any pre-configured scope.

</td>
</tr>

<tr>
<td>

`authenticator:deny-sign`

</td>
<td>

Denies the sign command without any pre-configured scope.

</td>
</tr>

<tr>
<td>

`authenticator:allow-verify-registration`

</td>
<td>

Enables the verify_registration command without any pre-configured scope.

</td>
</tr>

<tr>
<td>

`authenticator:deny-verify-registration`

</td>
<td>

Denies the verify_registration command without any pre-configured scope.

</td>
</tr>

<tr>
<td>

`authenticator:allow-verify-signature`

</td>
<td>

Enables the verify_signature command without any pre-configured scope.

</td>
</tr>

<tr>
<td>

`authenticator:deny-verify-signature`

</td>
<td>

Denies the verify_signature command without any pre-configured scope.

</td>
</tr>
</table>
8 changes: 4 additions & 4 deletions plugins/authenticator/permissions/schemas/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"minimum": 1.0
},
"description": {
"description": "Human-readable description of what the permission does.",
"description": "Human-readable description of what the permission does. Tauri convention is to use <h4> headings in markdown content for Tauri documentation generation purposes.",
"type": [
"string",
"null"
Expand Down Expand Up @@ -111,7 +111,7 @@
"type": "string"
},
"description": {
"description": "Human-readable description of what the permission does.",
"description": "Human-readable description of what the permission does. Tauri internal convention is to use <h4> headings in markdown content for Tauri documentation generation purposes.",
"type": [
"string",
"null"
Expand Down Expand Up @@ -172,7 +172,7 @@
}
},
"Scopes": {
"description": "A restriction of the command/endpoint functionality.\n\nIt can be of any serde serializable type and is used for allowing or preventing certain actions inside a Tauri command.\n\nThe scope is passed to the command and handled/enforced by the command itself.",
"description": "An argument for fine grained behavior control of Tauri commands.\n\nIt can be of any serde serializable type and is used to allow or prevent certain actions inside a Tauri command. The configured scope is passed to the command and will be enforced by the command implementation.\n\n## Example\n\n```json { \"allow\": [{ \"path\": \"$HOME/**\" }], \"deny\": [{ \"path\": \"$HOME/secret.txt\" }] } ```",
"type": "object",
"properties": {
"allow": {
Expand All @@ -186,7 +186,7 @@
}
},
"deny": {
"description": "Data that defines what is denied by the scope.",
"description": "Data that defines what is denied by the scope. This should be prioritized by validation logic.",
"type": [
"array",
"null"
Expand Down
1 change: 1 addition & 0 deletions plugins/authenticator/src/u2f_crate/messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ pub struct RegisteredKey {
#[serde(rename_all = "camelCase")]
pub struct RegisterResponse {
pub registration_data: String,
#[allow(unused)]
pub version: String,
pub client_data: String,
}
Expand Down
Loading

0 comments on commit eb9c270

Please sign in to comment.