-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add WebAuthn route handlers for Axum Webauthn-rs application
This commit introduces the main functionalities needed for a Webauthn-rs application using the Axum framework. The implemented functionalities are: start/register the request, finish/register the request, start/authentication, and finish/authentication. This commit also adds new GitHub workflows for 'Rust' and 'SonarCloud Scan', alongside other essential files required for a Rust application.
- Loading branch information
1 parent
01823a5
commit 5637c3e
Showing
7 changed files
with
507 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Rust | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Build | ||
run: cargo build --verbose | ||
- name: Run tests | ||
run: cargo test --verbose | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ ubuntu-latest ] | ||
target: | ||
[ | ||
# aarch64-unknown-linux-gnu, | ||
x86_64-unknown-linux-gnu, | ||
] | ||
include: | ||
# - os: ubuntu-latest | ||
# target: aarch64-unknown-linux-gnu | ||
- os: ubuntu-latest | ||
target: x86_64-unknown-linux-gnu | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install dependencies on Linux | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install gcc-aarch64-linux-gnu | ||
- name: Install Rust and Build | ||
run: | | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | ||
source $HOME/.cargo/env | ||
rustup target add ${{ matrix.target }} | ||
cargo build --release --target ${{ matrix.target }} | ||
strip target/${{ matrix.target }}/release/backend-rust | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ matrix.target }}-build | ||
path: target/${{ matrix.target }}/release/backend-rust |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Sonar | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
jobs: | ||
sonarcloud: | ||
name: SonarCloud | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | ||
- name: SonarCloud Scan | ||
uses: SonarSource/sonarcloud-github-action@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# https://doc.rust-lang.org/cargo/reference/manifest.html | ||
[package] | ||
name = "authnz-rs" | ||
version = "0.1.0" | ||
edition = "2021" | ||
license = "BSD-2" | ||
|
||
[dependencies] | ||
tokio = { version = "1.38.0", features = ["rt", "rt-multi-thread", "macros"] } | ||
axum = { version="0.7.5", features = ["http2", "tokio"] } | ||
webauthn-rs = { version="0.5.0", features = ["danger-allow-state-serialisation"] } | ||
tower = { version="0.4.13", features = ["full"] } | ||
tower-sessions = "0.12.2" | ||
thiserror = "1.0.62" | ||
log = "0.4.22" | ||
serde = { version = "1.0.204", features = ["derive"] } |
Oops, something went wrong.