chore: update dependencies (#15)
* build(deps): bump actions/cache from 4 to 5 Bump the actions-deps group. * build(deps): bump cargo-deps group (anyhow, chrono, clap, uuid, tempfile) - anyhow 1.0.101 → 1.0.102 - chrono 0.4.43 → 0.4.44 - clap 4.5.57 → 4.5.60 - uuid 1.20.0 → 1.21.0 - tempfile 3.24.0 → 3.25.0 * build(deps): bump sqlx from 0.7.4 to 0.8.6 * build(deps): bump rand from 0.8.5 to 0.9.2 Migrate API changes: - Replace OsRng.fill_bytes() with rand::rng().fill_bytes() - Replace rand::thread_rng() with rand::rng() * build(deps): bump thiserror from 1.0.69 to 2.0.18
This commit is contained in:
parent
937ee4c5f2
commit
edffb1679d
6 changed files with 306 additions and 207 deletions
2
.github/workflows/deploy.yml
vendored
2
.github/workflows/deploy.yml
vendored
|
|
@ -25,7 +25,7 @@ jobs:
|
||||||
restore-prefixes-first-match: nix-${{ runner.os }}-
|
restore-prefixes-first-match: nix-${{ runner.os }}-
|
||||||
|
|
||||||
- name: Cache Cargo artifacts
|
- name: Cache Cargo artifacts
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v5
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.cargo/registry/index/
|
~/.cargo/registry/index/
|
||||||
|
|
|
||||||
4
.github/workflows/push.yml
vendored
4
.github/workflows/push.yml
vendored
|
|
@ -25,7 +25,7 @@ jobs:
|
||||||
restore-prefixes-first-match: nix-${{ runner.os }}-
|
restore-prefixes-first-match: nix-${{ runner.os }}-
|
||||||
|
|
||||||
- name: Cache Cargo artifacts
|
- name: Cache Cargo artifacts
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v5
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.cargo/registry/index/
|
~/.cargo/registry/index/
|
||||||
|
|
@ -63,7 +63,7 @@ jobs:
|
||||||
restore-prefixes-first-match: nix-${{ runner.os }}-
|
restore-prefixes-first-match: nix-${{ runner.os }}-
|
||||||
|
|
||||||
- name: Cache Cargo artifacts
|
- name: Cache Cargo artifacts
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v5
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.cargo/registry/index/
|
~/.cargo/registry/index/
|
||||||
|
|
|
||||||
493
Cargo.lock
generated
493
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -18,9 +18,9 @@ open = "5"
|
||||||
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls", "gzip"] }
|
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls", "gzip"] }
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
rand = "0.8"
|
rand = "0.9"
|
||||||
sha2 = "0.10"
|
sha2 = "0.10"
|
||||||
sqlx = { version = "0.7", default-features = false, features = [
|
sqlx = { version = "0.8", default-features = false, features = [
|
||||||
"runtime-tokio",
|
"runtime-tokio",
|
||||||
"tls-rustls",
|
"tls-rustls",
|
||||||
"macros",
|
"macros",
|
||||||
|
|
@ -28,7 +28,7 @@ sqlx = { version = "0.7", default-features = false, features = [
|
||||||
"sqlite",
|
"sqlite",
|
||||||
"migrate",
|
"migrate",
|
||||||
] }
|
] }
|
||||||
thiserror = "1.0"
|
thiserror = "2.0"
|
||||||
tokio = { version = "1.38", features = ["rt-multi-thread", "macros", "signal"] }
|
tokio = { version = "1.38", features = ["rt-multi-thread", "macros", "signal"] }
|
||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
tracing-subscriber = { version = "0.3", features = ["env-filter", "json", "fmt"] }
|
tracing-subscriber = { version = "0.3", features = ["env-filter", "json", "fmt"] }
|
||||||
|
|
|
||||||
|
|
@ -178,6 +178,6 @@ fn build_stat_cards(cs: CachedStats) -> Vec<StatCard> {
|
||||||
label: "Top Roaster",
|
label: "Top Roaster",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
cards.shuffle(&mut rand::thread_rng());
|
cards.shuffle(&mut rand::rng());
|
||||||
cards
|
cards
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use base64::{Engine as _, engine::general_purpose};
|
use base64::{Engine as _, engine::general_purpose};
|
||||||
use rand::{RngCore, rngs::OsRng};
|
use rand::RngCore;
|
||||||
use sha2::{Digest, Sha256};
|
use sha2::{Digest, Sha256};
|
||||||
|
|
||||||
/// Generates a cryptographically secure random token
|
/// Generates a cryptographically secure random token
|
||||||
/// Returns a base64-encoded token string
|
/// Returns a base64-encoded token string
|
||||||
pub fn generate_token() -> Result<String> {
|
pub fn generate_token() -> Result<String> {
|
||||||
let mut token_bytes = [0u8; 32];
|
let mut token_bytes = [0u8; 32];
|
||||||
OsRng.fill_bytes(&mut token_bytes);
|
rand::rng().fill_bytes(&mut token_bytes);
|
||||||
Ok(general_purpose::STANDARD.encode(token_bytes))
|
Ok(general_purpose::STANDARD.encode(token_bytes))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -22,7 +22,7 @@ pub fn hash_token(token: &str) -> String {
|
||||||
/// Generates a session token for cookie-based authentication
|
/// Generates a session token for cookie-based authentication
|
||||||
pub fn generate_session_token() -> String {
|
pub fn generate_session_token() -> String {
|
||||||
let mut token_bytes = [0u8; 32];
|
let mut token_bytes = [0u8; 32];
|
||||||
OsRng.fill_bytes(&mut token_bytes);
|
rand::rng().fill_bytes(&mut token_bytes);
|
||||||
general_purpose::URL_SAFE_NO_PAD.encode(token_bytes)
|
general_purpose::URL_SAFE_NO_PAD.encode(token_bytes)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue