Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions installation/authentication-setup/custom.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,15 @@ and the public key is advertised on a public JWKS URL.
Requirements for the key in the JWKS URL:
1. The URL must be a public URL in the [JWKS](https://auth0.com/docs/secure/tokens/json-web-tokens/json-web-key-sets) format.
1. We have an example endpoint available [here](https://hlstmcktecziostiaplz.supabase.co/functions/v1/powersync-jwks); ensure that your response looks similar.
2. Supported signature schemes: RSA and EdDSA. ECDSA is not supported yet.
3. Key type (`kty`): `RSA` or `OKP` (EdDSA).
4. Algorithm (`alg`): `RS256`, `RS384` or `RS512` for RSA, or `EdDSA` for EdDSA.
5. Curve (`crv`): `Ed25519` or `Ed448`, only relevant for EdDSA.
2. Supported signature schemes: RSA, EdDSA and ECDSA.
3. Key type (`kty`): `RSA`, `OKP` (EdDSA) or `EC` (ECDSA).
4. Algorithm (`alg`):
1. `RS256`, `RS384` or `RS512` for RSA
2. `EdDSA` for EdDSA
3. `ES256`, `ES384` or `ES512` for ECDSA
5. Curve (`crv`) - only relevant for EdDSA and ECDSA:
1. `Ed25519` or `Ed448` for EdDSA
2. `P-256`, `P-384` or `P-512` for ECDSA
6. A `kid` must be specified, and must match the `kid` in the JWT.

Requirements for the signed JWT:
Expand Down
6 changes: 1 addition & 5 deletions usage/sync-rules/advanced-topics/client-parameters.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
---
title: "Client Parameters (Beta)"
title: "Client Parameters"
description: "Pass parameters from the client directly for use in Sync Rules."
---

<Info>
This feature is currently in a beta release. It is suitable for production use if you have tested your use cases extensively.
</Info>

<Warning>
Use client parameters with caution. Please make sure to read the [Security consideration](#security-consideration) section below.
</Warning>
Expand Down
1 change: 1 addition & 0 deletions usage/sync-rules/operators-and-functions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Some fundamental restrictions on these operators and functions are:
| [json\_valid(data)](https://www.sqlite.org/json1.html#jvalid) | Returns 1 if the data can be parsed as JSON, 0 otherwise. |
| json\_keys(data) | Returns the set of keys of a JSON object as a JSON array. Example: `select * from items where bucket.user_id in json_keys(permissions_json)` |
| [ifnull(x,y)](https://www.sqlite.org/lang_corefunc.html#ifnull) | Returns x if non-null, otherwise returns y. |
| [iif(x,y,z)](https://www.sqlite.org/lang_corefunc.html#iif) | Returns y if x is true, otherwise returns z. |
| [uuid_blob(id)](https://sqlite.org/src/file/ext/misc/uuid.c) | Convert a UUID string to bytes. |
| [unixepoch(datetime, \[modifier\])](https://www.sqlite.org/lang_datefunc.html) | Returns a datetime as Unix timestamp. If modifier is "subsec", the result is a floating point number, with milliseconds including in the fraction. The datetime argument is required - this function cannot be used to get the current time. |
| [datetime(datetime, \[modifier\])](https://www.sqlite.org/lang_datefunc.html) | Returns a datetime as a datetime string, in the format YYYY-MM-DD HH:MM:SS. If the specifier is "subsec", milliseconds are also included. If the modifier is "unixepoch", the argument is interpreted as a unix timestamp. Both modifiers can be included: datetime(timestamp, 'unixepoch', 'subsec'). The datetime argument is required - this function cannot be used to get the current time. |
Expand Down
4 changes: 4 additions & 0 deletions usage/sync-rules/parameter-queries.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ bucket_definitions:

Keep in mind that the total number of buckets per user should remain limited (\< 1,000), so don't make buckets too granular.

#### Pass parameters from clients

It is possible to pass parameters from clients directly. See [client parameters](/usage/sync-rules/advanced-topics/client-parameters) to learn more.

#### Global buckets

Global buckets are buckets with no bucket parameters. This means there is a single bucket for the bucket definition.
Expand Down
Loading