mirror of
https://github.com/TECHNOFAB11/jwt-authorizer.git
synced 2025-12-11 23:50: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
80
.github/workflows/ci.yml
vendored
80
.github/workflows/ci.yml
vendored
|
|
@ -1,4 +1,6 @@
|
||||||
name: ci
|
name: ci
|
||||||
|
env:
|
||||||
|
MSRV: '1.75'
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
|
|
@ -6,59 +8,59 @@ on:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
style:
|
check:
|
||||||
name: Format
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- name: Install Rust
|
- uses: taiki-e/install-action@protoc
|
||||||
uses: dtolnay/rust-toolchain@stable
|
- uses: dtolnay/rust-toolchain@beta
|
||||||
with:
|
with:
|
||||||
components: rustfmt
|
components: clippy, rustfmt
|
||||||
- name: Check format
|
- uses: Swatinem/rust-cache@v2
|
||||||
run: cargo fmt --check
|
- name: clippy
|
||||||
|
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
|
||||||
clippy:
|
- name: rustfmt
|
||||||
name: Clippy
|
run: cargo fmt --all --check
|
||||||
|
check-docs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- uses: dtolnay/rust-toolchain@stable
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
with:
|
- uses: Swatinem/rust-cache@v2
|
||||||
components: clippy
|
- name: cargo doc
|
||||||
- run: cargo clippy --all-targets --all-features -- -D warnings
|
env:
|
||||||
|
RUSTDOCFLAGS: "-D rustdoc::all -A rustdoc::private-doc-tests"
|
||||||
tests:
|
run: cargo doc --all-features --no-deps
|
||||||
name: Tests
|
test-versions:
|
||||||
runs-on: ${{ matrix.os }}
|
needs: check
|
||||||
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
build: [pinned, stable, nightly]
|
rust: [stable, beta, 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
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- name: Install Rust
|
- uses: dtolnay/rust-toolchain@master
|
||||||
uses: dtolnay/rust-toolchain@master
|
|
||||||
with:
|
with:
|
||||||
toolchain: ${{ matrix.rust }}
|
toolchain: ${{ matrix.rust }}
|
||||||
|
- uses: Swatinem/rust-cache@v2
|
||||||
- name: Build System Info
|
- name: Build System Info
|
||||||
run: rustc --version
|
run: rustc --version
|
||||||
|
|
||||||
- name: Run tests default features
|
- name: Run tests default features
|
||||||
run: cargo test
|
run: cargo test
|
||||||
|
|
||||||
- name: Run tests all features
|
|
||||||
run: cargo test --all-features
|
|
||||||
|
|
||||||
- name: Run tests no features
|
- name: Run tests no features
|
||||||
run: cargo test --no-default-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
|
## Development
|
||||||
|
|
||||||
Minimum supported Rust version is 1.65.
|
Minimum supported Rust version is 1.75.
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
//! Demo server - for demo and testing purposes
|
||||||
|
|
||||||
use axum::{routing::get, Router};
|
use axum::{routing::get, Router};
|
||||||
use jwt_authorizer::{
|
use jwt_authorizer::{
|
||||||
error::InitError, AuthError, Authorizer, IntoLayer, JwtAuthorizer, JwtClaims, Refresh, RefreshStrategy,
|
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"
|
lazy_static = "1.4.0"
|
||||||
prost = "0.13"
|
prost = "0.13"
|
||||||
tower = { version = "0.4.13", features = ["util", "buffer"] }
|
tower = { version = "0.4.13", features = ["util", "buffer"] }
|
||||||
wiremock = "0.6.0"
|
wiremock = "0.6.1"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["default-tls", "chrono"]
|
default = ["default-tls", "chrono"]
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
/// The number of seconds from 1970-01-01T00:00:00Z UTC until the specified UTC date/time ignoring leap seconds.
|
/// 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)]
|
#[derive(Deserialize, Serialize, Clone, PartialEq, Eq, Debug)]
|
||||||
pub struct NumericDate(pub i64);
|
pub struct NumericDate(pub i64);
|
||||||
|
|
||||||
|
|
@ -53,7 +53,7 @@ pub struct StringList(Vec<String>);
|
||||||
|
|
||||||
/// Claims mentioned in the JWT specifications.
|
/// 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)]
|
#[derive(Deserialize, Serialize, Clone, Debug)]
|
||||||
pub struct RegisteredClaims {
|
pub struct RegisteredClaims {
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[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 {
|
impl IntoResponse for AuthError {
|
||||||
fn into_response(self) -> Response {
|
fn into_response(self) -> Response {
|
||||||
match self {
|
match self {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue