-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Removed rust version in tutorials * Split tutorials from ci build + included actix_web * Code cleanup & dependency upgrade
- Loading branch information
Showing
9 changed files
with
68 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
on: [push, pull_request] | ||
on: [ push, pull_request ] | ||
|
||
name: CI | ||
|
||
|
@@ -29,7 +29,7 @@ jobs: | |
strategy: | ||
fail-fast: false | ||
matrix: | ||
rust_version: [stable, 1.70.0] | ||
rust_version: [ stable, 1.70.0 ] | ||
os: | ||
- ubuntu-latest | ||
- windows-latest | ||
|
@@ -58,13 +58,13 @@ jobs: | |
token: ${{ github.token }} | ||
# Transitive dependency of wasm-bindgen; works around https://github.com/rustwasm/wasm-bindgen/issues/3918 | ||
- run: cargo update -p bumpalo --precise 3.14.0 | ||
- run: cargo build --workspace --exclude webauthn-authenticator-rs | ||
- run: cargo build --workspace --exclude webauthn-authenticator-rs --exclude actix_web --exclude web_authn --exclude tide-server | ||
|
||
# Don't run clippy on Windows, we only need to run it on Linux | ||
- if: runner.os != 'windows' | ||
run: cargo clippy --no-deps --workspace --exclude webauthn-authenticator-rs --all-targets | ||
run: cargo clippy --no-deps --workspace --exclude webauthn-authenticator-rs --exclude actix_web --exclude web_authn --exclude tide-server --all-targets | ||
|
||
- run: cargo test --workspace --exclude webauthn-authenticator-rs | ||
- run: cargo test --workspace --exclude webauthn-authenticator-rs --exclude actix_web --exclude web_authn --exclude tide-server | ||
|
||
# Some clap errors manifest as panics at runtime. Running tools with | ||
# --help should be enough to find an issue. | ||
|
@@ -85,7 +85,7 @@ jobs: | |
strategy: | ||
fail-fast: false | ||
matrix: | ||
rust_version: [stable, 1.70.0] | ||
rust_version: [ stable, 1.70.0 ] | ||
features: | ||
- bluetooth | ||
- cable | ||
|
@@ -186,7 +186,7 @@ jobs: | |
strategy: | ||
fail-fast: false | ||
matrix: | ||
rust_version: [stable, nightly] | ||
rust_version: [ stable, nightly ] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
@@ -233,3 +233,32 @@ jobs: | |
if-no-files-found: error | ||
retention-days: 14 | ||
- run: ./.github/check_built_docs.sh | ||
|
||
tutorial: | ||
name: Tutorial builds | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
rust_version: [ stable ] | ||
os: | ||
- ubuntu-latest | ||
- windows-latest | ||
|
||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ matrix.rust_version }} | ||
components: clippy | ||
- uses: mozilla-actions/[email protected] | ||
with: | ||
version: v0.4.2 | ||
- if: runner.os == 'windows' | ||
uses: johnwason/vcpkg-action@v4 | ||
with: | ||
pkgs: openssl | ||
triplet: x64-windows-static-md | ||
token: ${{ github.token }} | ||
|
||
- run: cargo build -p actix_web -p web_authn -p tide-server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,25 +2,27 @@ | |
name = "actix_web" | ||
version = "0.1.0" | ||
edition = "2021" | ||
rust-version = "1.70.0" | ||
authors = ["Niklas Pfister <[email protected]>"] | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
# Webframework | ||
actix-web = { version = "~4.5.1" } | ||
actix-web = { version = ">=4.5.1" } | ||
# Session framework for actix-web | ||
actix-session = { version = "~0.7", features = ["cookie-session"] } | ||
actix-session = { version = "~0.9", features = ["cookie-session"] } | ||
# Async trait, anyhow, chrono, once_cell and rand are required for the implementation of a | ||
# server-side memory-backed session store. | ||
# Normally, you want to use a database / redis backend as session store, but for the simplicity of this | ||
# tutorial, we implement our own. | ||
async-trait = { version = "~0.1" } | ||
anyhow = { version = "~1.0" } | ||
anyhow = { version = "~1" } | ||
chrono = { version = "~0.4" } | ||
once_cell = { version = "~1.18" } | ||
rand.workspace = true | ||
once_cell = { version = ">=1.18" } | ||
rand = { workspace = true } | ||
|
||
# Nicer error management | ||
thiserror = { version = "~1" } | ||
|
||
# Serve static file. Used to serve wasm | ||
actix-files = { version = "~0.6" } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
use std::path::PathBuf; | ||
use std::path::Path; | ||
|
||
use actix_files::NamedFile; | ||
use actix_web::HttpRequest; | ||
|
||
pub const WASM_DIR: &str = "../../wasm/pkg"; | ||
|
||
pub(crate) async fn serve_wasm(req: HttpRequest) -> actix_web::Result<NamedFile> { | ||
let fp: PathBuf = req.match_info().query("filename").parse().unwrap(); | ||
let path = PathBuf::new().join(WASM_DIR).join(fp); | ||
let fp = req.match_info().query("filename"); | ||
let path = Path::new(WASM_DIR).join(fp); | ||
Ok(NamedFile::open(path)?) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
name = "web_authn" | ||
version = "0.1.0" | ||
edition = "2021" | ||
rust-version = "1.70.0" | ||
authors = ["William Brown <[email protected]>, Ben Wishovich <[email protected]>"] | ||
license = "MPL-2.0" | ||
|
||
|
@@ -13,13 +12,13 @@ tracing.workspace = true | |
tracing-subscriber.workspace = true | ||
serde.workspace = true | ||
webauthn-rs = { workspace = true, features = ["danger-allow-state-serialisation"] } | ||
axum = {version = "0.6.1", features = ["http2"]} | ||
axum = { version = "0.6.1", features = ["http2"] } | ||
tokio = { workspace = true, features = ["full"] } | ||
uuid = { workspace = true, features=["v4"] } | ||
uuid = { workspace = true, features = ["v4"] } | ||
url.workspace = true | ||
thiserror.workspace = true | ||
tower = "0.4.13" | ||
tower-http = {version="0.4.4", features=["fs"]} | ||
tower-http = { version = "0.4.4", features = ["fs"] } | ||
tower-sessions = "0.6" | ||
|
||
[features] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
name = "tide-server" | ||
version = "0.1.0" | ||
edition = "2021" | ||
rust-version = "1.70.0" | ||
authors = ["William Brown <[email protected]>"] | ||
license = "MPL-2.0" | ||
|
||
|