Skip to content
This repository was archived by the owner on Feb 18, 2025. It is now read-only.

Commit 046a98d

Browse files
committed
Add auth mod
1 parent bc610a3 commit 046a98d

4 files changed

Lines changed: 134 additions & 11 deletions

File tree

Cargo.lock

Lines changed: 119 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/cursor-core/Cargo.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ crate-type = ["cdylib"]
1010
node-bridge = { path = "../node-bridge", features = ["all"] }
1111
wasm-bindgen = "0.2"
1212
wasm-bindgen-futures = "0.4"
13-
uuid = { version = "1", features = ["v4", "wasm-bindgen"] }
14-
getrandom = { version = "0.2", features = ["js"] }
1513
serde = { version = "1", features = ["derive"] }
1614
serde_json = "1"
1715
anyhow = "1"
1816
futures = "0.3"
1917
chrono = "0.4"
20-
js-sys = "0.3"
18+
js-sys = "0.3"
19+
sha256 = "1"
20+
rand = "0.8"
21+
getrandom = { version = "0.2", features = ["js"] }

crates/cursor-core/src/auth/mod.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
use node_bridge::prelude::*;
2+
use rand::RngCore;
3+
use wasm_bindgen::prelude::*;
4+
5+
fn random_bytes() -> Vec<u8> {
6+
let mut rng = rand::thread_rng();
7+
let mut bytes = vec![0u8; 32];
8+
rng.try_fill_bytes(&mut bytes);
9+
bytes
10+
}

crates/cursor-core/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
mod auth;
12
mod chat;
23
mod generate;
34
mod models;

0 commit comments

Comments
 (0)