Skip to content

Commit 86b6a1a

Browse files
security: clarify tinyauth.allowed regex (#17)
1 parent 7ee3ae6 commit 86b6a1a

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

docs/guides/access-controls.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,17 @@ The `tinyauth.users` label can be either a comma separated list of users or a re
7979
Tinyauth also supports skipping authentication for specific paths. This can be useful if you need an API path to be accessed without needing to login to Tinyauth. You can allow a path using the `allowed` label:
8080

8181
```yaml
82-
tinyauth.allowed: \/api
82+
tinyauth.allowed: ^\/api
8383
```
8484

8585
After you restart the app, Tinyauth will allow access to the `/api` endpoint regardless if the user is logged in or not.
8686

8787
:::info
8888
The `tinyauth.allowed` label uses a regex string to match the URL path.
89+
90+
For example, `^\/api` matches any path starting with `/api`, and `^\/ping$` matches the exact path `/ping`.
91+
92+
Be careful with regexes such as `\/api`, because that matches any path with `/api` anywhere in the path, including `/example/api/abc`
8993
:::
9094

9195
## Allowing and restricting access based on IP address or CIDRs

0 commit comments

Comments
 (0)