mirror of
https://github.com/TECHNOFAB11/jwt-authorizer.git
synced 2025-12-12 08:00:07 +01:00
Merge pull request #58 from cduvray/ci-update
refactor ci.yml, bump MSRV to 1.75
This commit is contained in:
commit
5ef14759dc
7 changed files with 49 additions and 2488 deletions
82
.github/workflows/ci.yml
vendored
82
.github/workflows/ci.yml
vendored
|
|
@ -1,4 +1,6 @@
|
|||
name: ci
|
||||
env:
|
||||
MSRV: '1.75'
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
|
|
@ -6,59 +8,59 @@ on:
|
|||
pull_request:
|
||||
|
||||
jobs:
|
||||
style:
|
||||
name: Format
|
||||
check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Install Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
- uses: actions/checkout@v4
|
||||
- uses: taiki-e/install-action@protoc
|
||||
- uses: dtolnay/rust-toolchain@beta
|
||||
with:
|
||||
components: rustfmt
|
||||
- name: Check format
|
||||
run: cargo fmt --check
|
||||
|
||||
clippy:
|
||||
name: Clippy
|
||||
components: clippy, rustfmt
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- name: clippy
|
||||
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
|
||||
- name: rustfmt
|
||||
run: cargo fmt --all --check
|
||||
check-docs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
components: clippy
|
||||
- run: cargo clippy --all-targets --all-features -- -D warnings
|
||||
|
||||
tests:
|
||||
name: Tests
|
||||
runs-on: ${{ matrix.os }}
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- name: cargo doc
|
||||
env:
|
||||
RUSTDOCFLAGS: "-D rustdoc::all -A rustdoc::private-doc-tests"
|
||||
run: cargo doc --all-features --no-deps
|
||||
test-versions:
|
||||
needs: check
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
build: [pinned, stable, nightly]
|
||||
include:
|
||||
- build: pinned
|
||||
os: ubuntu-22.04
|
||||
rust: 1.68.0
|
||||
- build: stable
|
||||
os: ubuntu-22.04
|
||||
rust: stable
|
||||
- build: nightly
|
||||
os: ubuntu-22.04
|
||||
rust: nightly
|
||||
rust: [stable, beta, nightly]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Install Rust
|
||||
uses: dtolnay/rust-toolchain@master
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dtolnay/rust-toolchain@master
|
||||
with:
|
||||
toolchain: ${{ matrix.rust }}
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- name: Build System Info
|
||||
run: rustc --version
|
||||
|
||||
- name: Run tests default features
|
||||
run: cargo test
|
||||
|
||||
- name: Run tests all features
|
||||
run: cargo test --all-features
|
||||
|
||||
- name: Run tests no features
|
||||
run: cargo test --no-default-features
|
||||
- name: Run tests all features
|
||||
run: cargo test --all-features
|
||||
test-msrv:
|
||||
needs: check
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dtolnay/rust-toolchain@master
|
||||
with:
|
||||
toolchain: ${{ env.MSRV }}
|
||||
- name: "install Rust nightly"
|
||||
uses: dtolnay/rust-toolchain@nightly
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- name: Run tests all features
|
||||
run: cargo test --all-features
|
||||
|
|
|
|||
2443
Cargo.lock
generated
2443
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -27,7 +27,7 @@ See documentation of the [`jwt-authorizer`](./jwt-authorizer/docs/README.md) mod
|
|||
|
||||
## Development
|
||||
|
||||
Minimum supported Rust version is 1.65.
|
||||
Minimum supported Rust version is 1.75.
|
||||
|
||||
## Contributing
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
//! Demo server - for demo and testing purposes
|
||||
|
||||
use axum::{routing::get, Router};
|
||||
use jwt_authorizer::{
|
||||
error::InitError, AuthError, Authorizer, IntoLayer, JwtAuthorizer, JwtClaims, Refresh, RefreshStrategy,
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ hyper = { version = "1.3.1", features = ["full"] }
|
|||
lazy_static = "1.4.0"
|
||||
prost = "0.13"
|
||||
tower = { version = "0.4.13", features = ["util", "buffer"] }
|
||||
wiremock = "0.6.0"
|
||||
wiremock = "0.6.1"
|
||||
|
||||
[features]
|
||||
default = ["default-tls", "chrono"]
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// The number of seconds from 1970-01-01T00:00:00Z UTC until the specified UTC date/time ignoring leap seconds.
|
||||
/// (https://www.rfc-editor.org/rfc/rfc7519#section-2)
|
||||
/// (<https://www.rfc-editor.org/rfc/rfc7519#section-2>)
|
||||
#[derive(Deserialize, Serialize, Clone, PartialEq, Eq, Debug)]
|
||||
pub struct NumericDate(pub i64);
|
||||
|
||||
|
|
@ -53,7 +53,7 @@ pub struct StringList(Vec<String>);
|
|||
|
||||
/// Claims mentioned in the JWT specifications.
|
||||
///
|
||||
/// https://www.rfc-editor.org/rfc/rfc7519#section-4.1
|
||||
/// <https://www.rfc-editor.org/rfc/rfc7519#section-4.1>
|
||||
#[derive(Deserialize, Serialize, Clone, Debug)]
|
||||
pub struct RegisteredClaims {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ impl From<AuthError> for Response {
|
|||
}
|
||||
}
|
||||
|
||||
/// (https://datatracker.ietf.org/doc/html/rfc6750#section-3.1)
|
||||
/// (<https://datatracker.ietf.org/doc/html/rfc6750#section-3.1>)
|
||||
impl IntoResponse for AuthError {
|
||||
fn into_response(self) -> Response {
|
||||
match self {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue