Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI clippy checks for gateway #7406

Merged
merged 2 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,13 @@ jobs:
cargo fmt --check
exit $(docker wait gateway-format)

- name: Clippy check
run: |
docker run --name=gateway-clippy --net=host -v $PWD/output:/output \
${{ fromJSON(needs.build.outputs.stable_tags).gateway-test }} \
cargo clippy --all-features --all-targets -- -D warnings
exit $(docker wait gateway-clippy)

check_front:
runs-on: ubuntu-latest
needs:
Expand Down
1 change: 1 addition & 0 deletions gateway/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ RUN cargo install --locked --path .
FROM chef AS testing_env
RUN rustup component add llvm-tools && \
rustup component add rustfmt && \
rustup component add clippy && \
cargo install --locked grcov
COPY --from=planner /app/recipe.json recipe.json

Expand Down
28 changes: 13 additions & 15 deletions gateway/actix_auth/src/auth_middleware.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
use std::{
future::{ready, Ready},
rc::Rc,
};
use actix_session::SessionExt;
use actix_web::dev::forward_ready;
use actix_web::dev::Service;
use actix_web::dev::ServiceRequest;
use actix_web::dev::ServiceResponse;
use actix_web::dev::Transform;
use actix_web::Error;
use actix_web::HttpMessage;
use std::future::ready;
use std::future::Ready;
use std::rc::Rc;

use actix_session::{Session, SessionExt};
use actix_web::{
dev::{forward_ready, Service, ServiceRequest, ServiceResponse, Transform},
Error, HttpMessage, HttpRequest,
};

use crate::{AuthContext, RequestAuth};

pub trait AuthGate: Clone {
fn filter(&self, req: &HttpRequest, session: Option<Session>) -> Option<actix_web::Error>;
}
use crate::AuthContext;
use crate::RequestAuth;

/// The MandatoryIdentityMiddleware does not directly process requests.
/// When actix starts, new_transform is called once per worker to create
Expand Down
Loading