Skip to content

Commit 205edf1

Browse files
committed
Fix uuid randomness on wasm32 and update runner signature
- Add uuid with js feature for wasm32 in smbcloud-auth-sdk-wasm - Change Runner::from to accept &Path instead of &PathBuf - Bump npm sdk-auth package to 0.3.35
1 parent 9da9a64 commit 205edf1

4 files changed

Lines changed: 10 additions & 3 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/smbcloud-auth-sdk-wasm/Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,9 @@ smbcloud-networking = { workspace = true }
3030
smbcloud-auth-sdk = { workspace = true }
3131
wasm-bindgen = { workspace = true }
3232
wasm-bindgen-futures = "0.4.50"
33+
34+
# uuid's v4 feature needs a randomness source on wasm32-unknown-unknown.
35+
# The `js` feature wires it to the Web Crypto API (crypto.getRandomValues).
36+
# This only activates when building for wasm32 targets.
37+
[target.'cfg(target_arch = "wasm32")'.dependencies]
38+
uuid = { version = "1", features = ["js"] }

crates/smbcloud-model/src/runner.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use {
44
serde_repr::{Deserialize_repr, Serialize_repr},
55
std::{
66
fmt::{self, Display, Formatter},
7-
path::PathBuf,
7+
path::Path,
88
},
99
};
1010

@@ -54,7 +54,7 @@ pub enum SwiftFramework {
5454
}
5555

5656
impl Runner {
57-
pub fn from(repo_path: &PathBuf) -> Result<Runner, ErrorResponse> {
57+
pub fn from(repo_path: &Path) -> Result<Runner, ErrorResponse> {
5858
// Any package.json-driven app belongs on the NodeJs runner.
5959
// Framework-specific checks are not reliable because modern Next.js apps
6060
// do not need a next.config.* file at all.

sdk/npm/smbcloud-auth/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@smbcloud/sdk-auth",
33
"description": "Browser Auth SDK for smbCloud, built from Rust and WebAssembly.",
4-
"version": "0.3.34",
4+
"version": "0.3.35",
55
"type": "module",
66
"main": "dist/smbcloud_auth_wasm.js",
77
"module": "dist/smbcloud_auth_wasm.js",

0 commit comments

Comments
 (0)