Skip to content

Commit

Permalink
Add wasm feature and document usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulf Lilleengen committed Mar 2, 2023
1 parent 793fdae commit d93bfb4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ readme = "README.md"

[features]
default = ["full-native-tls", "cached-client", "tuf"]
wasm = ["getrandom/js"]

full-native-tls = ["fulcio-native-tls", "rekor-native-tls", "cosign-native-tls", "mock-client-native-tls"]
full-rustls-tls = ["fulcio-rustls-tls", "rekor-rustls-tls", "cosign-rustls-tls", "mock-client-rustls-tls"]
Expand All @@ -28,7 +29,7 @@ oauth = []

rekor-native-tls = [ "reqwest/native-tls", "rekor"]
rekor-rustls-tls = [ "reqwest/rustls-tls", "rekor" ]
rekor = ["dep:reqwest"]
rekor = ["reqwest"]

tuf = [ "tough", "regex" ]

Expand Down Expand Up @@ -64,7 +65,6 @@ lazy_static = "1.4.0"
oci-distribution = { version = "0.9", default-features = false, optional = true }
olpc-cjson = "0.1"
openidconnect = { version = "2.3", default-features = false, features = [ "reqwest" ], optional = true}
getrandom = { version = "0.2.8", features = ["js"] }
p256 = "0.12"
p384 = "0.12"
webbrowser = "0.8.4"
Expand All @@ -73,6 +73,7 @@ picky = { version = "7.0.0-rc.3", default-features = false, features = [ "x509",
pkcs1 = "0.4.0"
pkcs8 = { version = "0.9.0", features = ["pem", "alloc", "pkcs5", "encryption"] }
rand = { version = "0.8.5", features = [ "getrandom", "std" ] }
getrandom = "0.2.8"
regex = { version = "1.5.5", optional = true }
reqwest = { version = "0.11", default-features = false, features = ["json", "multipart"], optional = true}
rsa = "0.8.0"
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ For example, `openidconnect` can be run with the following command:
cargo run --example openidconnect
```

## WebAssembly/WASM support

To embedded this crate in WASM modules, build it using the `wasm` cargo feature:

```bash
cargo build --no-default-features --features wasm --target wasm32-unknown-unknown
```

NOTE: The wasm32-wasi target architecture is not yet supported.

## Contributing

Contributions are welcome! Please see the [contributing guidelines](CONTRIBUTING.md).
Expand Down

0 comments on commit d93bfb4

Please sign in to comment.