Skip to content

Commit

Permalink
add note on uuid
Browse files Browse the repository at this point in the history
  • Loading branch information
pilcrowonpaper committed Oct 7, 2024
1 parent 2ae9c85 commit 7a9b509
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pages/sessions/basic-api/drizzle-orm.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ export function generateSessionToken(): string {
}
```

> You can use UUID v4 here but the RFC does not mandate that IDs are generated using a secure random source. Do not use libraries that are not clear on the source they use. Do not use other UUID versions as they do not offer the same entropy size as v4. Consider using [`Crypto.randomUUID()`](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/randomUUID).
The session ID will be SHA-256 hash of the token. We'll set the expiration to 30 days.

```ts
Expand Down
2 changes: 2 additions & 0 deletions pages/sessions/basic-api/mysql.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ export function generateSessionToken(): string {
}
```

> You can use UUID v4 here but the RFC does not mandate that IDs are generated using a secure random source. Do not use libraries that are not clear on the source they use. Do not use other UUID versions as they do not offer the same entropy size as v4. Consider using [`Crypto.randomUUID()`](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/randomUUID).
The session ID will be SHA-256 hash of the token. We'll set the expiration to 30 days.

```ts
Expand Down
2 changes: 2 additions & 0 deletions pages/sessions/basic-api/postgresql.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ export function generateSessionToken(): string {
}
```

> You can use UUID v4 here but the RFC does not mandate that IDs are generated using a secure random source. Do not use libraries that are not clear on the source they use. Do not use other UUID versions as they do not offer the same entropy size as v4. Consider using [`Crypto.randomUUID()`](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/randomUUID).
The session ID will be SHA-256 hash of the token. We'll set the expiration to 30 days.

```ts
Expand Down
2 changes: 2 additions & 0 deletions pages/sessions/basic-api/prisma.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ export function generateSessionToken(): string {
}
```

> You can use UUID v4 here but the RFC does not mandate that IDs are generated using a secure random source. Do not use libraries that are not clear on the source they use. Do not use other UUID versions as they do not offer the same entropy size as v4. Consider using [`Crypto.randomUUID()`](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/randomUUID).
The session ID will be SHA-256 hash of the token. We'll set the expiration to 30 days.

```ts
Expand Down
2 changes: 1 addition & 1 deletion pages/sessions/basic-api/redis.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export function generateSessionToken(): string {
}
```

> Throughout the site, we will use packages from [Oslo](https://oslojs.dev) for various operations. Oslo packages are fully-typed, lightweight, and has minimal dependencies. You can of course replace them with your own code, runtime-specific modules, or your preferred library.
> You can use UUID v4 here but the RFC does not mandate that IDs are generated using a secure random source. Do not use libraries that are not clear on the source they use. Do not use other UUID versions as they do not offer the same entropy size as v4. Consider using [`Crypto.randomUUID()`](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/randomUUID).
The session ID will be SHA-256 hash of the token. We'll set the expiration to 30 days.

Expand Down
2 changes: 2 additions & 0 deletions pages/sessions/basic-api/sqlite.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ export function generateSessionToken(): string {
}
```

> You can use UUID v4 here but the RFC does not mandate that IDs are generated using a secure random source. Do not use libraries that are not clear on the source they use. Do not use other UUID versions as they do not offer the same entropy size as v4. Consider using [`Crypto.randomUUID()`](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/randomUUID).
The session ID will be SHA-256 hash of the token. We'll set the expiration to 30 days.

```ts
Expand Down

0 comments on commit 7a9b509

Please sign in to comment.