Skip to content

Commit 75f2561

Browse files
39zdevasfvitor
andauthored
docs: add HeaderConfig to SecurityConfig + new Gudeline Proposals (tauri-apps#2950)
Co-authored-by: Vitor Ayres <[email protected]>
1 parent 966563e commit 75f2561

17 files changed

+352
-18
lines changed

.github/CONTRIBUTING.md

+26
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,32 @@ Use this chart to help you figure out where the right place for your content is:
5757
- Make headings as succinct as possible to help the reader quickly find the content they need
5858
- Use [simple present tense](https://www.grammarly.com/blog/simple-present/) for verbs
5959

60+
### New Features / Version Display
61+
62+
When writing about a new feature, display the version it was introduced.
63+
Use the `SinceVersion` component for this, located at [`src/components/SinceVersion.astro`](../src//components/SinceVersion.astro).
64+
Place it directly under the header, which describes the new feature.
65+
When creating a new page add a Badge with the text `New` and variant `tip`.
66+
The lifetime of this badge should not exceed 6 Months.
67+
68+
#### Example
69+
Example file `my-new-page.mdx`
70+
```mdx
71+
---
72+
title: My New Page
73+
sidebar:
74+
badge:
75+
text: New
76+
variant: tip
77+
---
78+
import SinceVersion from '../path/to/SinceVersion.astro';
79+
80+
<SinceVersion version="2.1.0" library="optional core library name" href="optional link" />
81+
82+
Documentation about 'My New Page'...
83+
84+
```
85+
6086
### Guide
6187

6288
Located in [`/src/content/docs/plugin/`](https://github.com/tauri-apps/tauri-docs/tree/v2/src/content/docs/plugin)

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@ src/content/docs/learn/Security/writing-plugin-permissions.mdx
3131
src/content/docs/start/frontend/qwik.mdx
3232
src/content/docs/zh-cn/start/frontend/qwik.mdx
3333
src/content/docs/learn/splashscreen.mdx
34+
src/content/docs/security/http-headers.mdx

src/components/SinceVersion.astro

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
/**
3+
* @author 39zde <[email protected]>
4+
*/
5+
import { Icon } from '@astrojs/starlight/components';
6+
7+
interface Props {
8+
/**
9+
* version string
10+
* schema: x.y.z
11+
* @example
12+
* ```jsx
13+
* // Valid ✅
14+
* <SinceVersion version="2.1.0" />
15+
* // Invalid ❌
16+
* <SinceVersion version="v2.1.0" />
17+
* <SinceVersion>2.1.0</SinceVersion>
18+
* <SinceVersion version="2.1" />
19+
* ```
20+
*/
21+
version: string;
22+
/**
23+
* The core library the documented feature belongs to, if applicapbe.
24+
* Leave blank if not applicable and define the link manually.
25+
*/
26+
library?: 'tauri' | 'api' | 'rust-cli' | 'js-cli' | 'tauri-bundler' | 'wry' | 'tao';
27+
/**
28+
* overrides the link to release page
29+
*
30+
* if the `library` prop is defined, `href` defaults to:
31+
* - `${Astro.url.origin}/release/${Astro.props.library}/v${Astro.props.version}`
32+
*
33+
* if the `library` prop is `undefined`, `href` defaults to:
34+
* - defaults to `${Astro.url.origin}/release/tauri/v${Astro.props.version}`
35+
*/
36+
href?: string;
37+
}
38+
---
39+
40+
<a
41+
class="not-content"
42+
href={Astro.props.href
43+
? Astro.props.href
44+
: Astro.props.library
45+
? `${Astro.url.origin}/release/${Astro.props.library}/v${Astro.props.version}`
46+
: `${Astro.url.origin}/release/tauri/v${Astro.props.version}`}
47+
target="_blank"
48+
>
49+
<Icon name="seti:clock" />Since <code>{Astro.props.version}</code>
50+
</a>
51+
52+
<style>
53+
a {
54+
display: inline-flex;
55+
justify-content: center;
56+
align-items: center;
57+
gap: 6px;
58+
border-radius: 0.5rem;
59+
padding: 2px 12px 2px 12px;
60+
font-size: small;
61+
box-shadow: var(--sl-shadow-md);
62+
background-color: var(--sl-color-bg-inline-code);
63+
margin: 0 0 12px 0;
64+
color: var(--sl-color-gray-1) !important;
65+
text-decoration: none;
66+
}
67+
</style>

src/content/docs/develop/Debug/index.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ With all the moving pieces in Tauri, you may run into a problem that requires de
1212

1313
## Development Only Code
1414

15-
One of the most useful tools in your toolkit for debugging is the ability to add debugging statments in your code. However, you generally you don't want these to end up in production, which is where the ability to check whether you're running in development mode or not comes in handy.
15+
One of the most useful tools in your toolkit for debugging is the ability to add debugging statements in your code. However, you generally you don't want these to end up in production, which is where the ability to check whether you're running in development mode or not comes in handy.
1616

1717
### In Rust
1818

src/content/docs/develop/Plugins/develop-mobile.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ This implementation simplifies the process of sharing an API that can be used bo
3535

3636
### Develop an Android Plugin
3737

38-
A Tauri plugin for Android is defined as a Kotlin class that extends `app.tauri.plugin.Plugin` and is annoted with `app.tauri.annotation.TauriPlugin`. Each method annotated with `app.tauri.annotation.Command` can be called by Rust or JavaScript.
38+
A Tauri plugin for Android is defined as a Kotlin class that extends `app.tauri.plugin.Plugin` and is annotated with `app.tauri.annotation.TauriPlugin`. Each method annotated with `app.tauri.annotation.Command` can be called by Rust or JavaScript.
3939

4040
Tauri uses Kotlin by default for the Android plugin implementation, but you can switch to Java if you prefer. After generating a plugin, right click the Kotlin plugin class in Android Studio and select the "Convert Kotlin file to Java file" option from the menu. Android Studio will guide you through the project migration to Java.
4141

src/content/docs/distribute/Pipelines/github.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Please see the `tauri-action` [readme](https://github.com/tauri-apps/tauri-actio
2727

2828
When your app is not on the root of the repository, use the `projectPath` input.
2929

30-
You may freely modify the worfklow name, change its triggers, and add more steps such as `npm run lint` or `npm run test`. The important part is that you keep the below line at the end of the workflow since this runs the build script and releases your app.
30+
You may freely modify the workflow name, change its triggers, and add more steps such as `npm run lint` or `npm run test`. The important part is that you keep the below line at the end of the workflow since this runs the build script and releases your app.
3131

3232
### How to Trigger
3333

src/content/docs/distribute/Sign/macos.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Code signing is required on macOS to allow your application to be listed in the
99

1010
## Prerequisites
1111

12-
Code signing on macOS requries an [Apple Developer] account which is either paid (99$ per year) or on the free plan. You also need an Apple device where you perform the code signing. This is required by the signing process and due to Apple's Terms and Conditions.
12+
Code signing on macOS requires an [Apple Developer] account which is either paid (99$ per year) or on the free plan. You also need an Apple device where you perform the code signing. This is required by the signing process and due to Apple's Terms and Conditions.
1313

1414
:::note
1515
Note when using a free Apple Developer account, you will not be able to notarize your application and it will still show up as not verified when opening the app.

src/content/docs/learn/Security/capabilities-for-windows-and-platforms.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ This exercise is meant to be read after completing [`Using Plugin Permissions`](
5757
```
5858
</ShowSolution>
5959

60-
#### Create Windows Programatically
60+
#### Create Windows Programmatically
6161

6262
In the Rust code to create a Tauri app:
6363

src/content/docs/learn/Security/writing-plugin-permissions.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ and hand crafted.
9595

9696
These inbuilt permissions will be automatically generated by the Tauri build
9797
system and will be visible in the `permissions/autogenerated/commands` folder.
98-
By default an `enable-<commmand>` and `deny-<command>` permission will
98+
By default an `enable-<command>` and `deny-<command>` permission will
9999
be created.
100100

101101
</ShowSolution>
@@ -133,7 +133,7 @@ and hand crafted.
133133

134134
Expose the new command in the frontend module.
135135

136-
This step is essential for the example application to sucessfully
136+
This step is essential for the example application to successfully
137137
import the frontend module. This is for convenience and has
138138
no security impact, as the command handler is already generated
139139
and the command can be manually invoked from the frontend.

src/content/docs/plugin/biometric.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ fn bio_auth(app_handle: tauri::AppHandle) {
196196
confirmation_required: Some(true),
197197
};
198198

199-
// if the authentication was succesfull, the function returns Result::Ok()
199+
// if the authentication was successful, the function returns Result::Ok()
200200
// otherwise returns Result::Error()
201201
match app_handle.biometric().authenticate("This feature is locked".to_string(), options) {
202202
Ok(_) => {

src/content/docs/security/ecosystem.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Tauri Ecosystem Security
33
sidebar:
4-
order: 7
4+
order: 8
55
---
66

77
Our Tauri organization ecosystem is hosted on GitHub and facilitates several

src/content/docs/security/future.mdx

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
22
title: Future Work
33
sidebar:
4-
order: 9
4+
order: 10
55
---
66

7-
This section descibes topics we started or would like to tackle
7+
This section describes topics we started or would like to tackle
88
in the future to make Tauri apps even more secure.
99
If you feel interested in these topics or have pre-existing
1010
knowledge we are always happy to welcome new contributors
@@ -43,7 +43,7 @@ Currently Tauri has no inbuilt method to do so but there is ongoing work to
4343
ease this process.
4444

4545
All of these tools allow to properly test and inspect Tauri applications
46-
without sorce code access and should be considered when building a Tauri application.
46+
without source code access and should be considered when building a Tauri application.
4747

4848
We are planning to further support and implement related features in the future.
4949

@@ -57,7 +57,7 @@ consider ways to further sandbox and isolate the webview processes.
5757
Inbuilt and external sandboxing methods will be evaluated to reduce attack impact
5858
and to enforce the IPC bridge for system access.
5959
We believe that this part of our stack is the weak link but current generation WebViews
60-
are improving in their hardening and exploit resillience.
60+
are improving in their hardening and exploit resilience.
6161

6262
### Fuzzing
6363

0 commit comments

Comments
 (0)