Skip to content

Commit

Permalink
fix: allow deployer bypass
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaro00 committed Apr 2, 2024
1 parent 2ee089f commit 6c66c7b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples
Submodule examples updated 47 files
+2 −2 actix-web/clerk/backend/Cargo.toml
+2 −2 actix-web/cookie-authentication/Cargo.toml
+2 −2 actix-web/hello-world/Cargo.toml
+3 −3 actix-web/postgres/Cargo.toml
+2 −2 actix-web/static-files/Cargo.toml
+2 −2 actix-web/websocket-actorless/Cargo.toml
+2 −2 axum/hello-world/Cargo.toml
+3 −3 axum/htmx-crud/Cargo.toml
+2 −2 axum/jwt-authentication/Cargo.toml
+2 −2 axum/metadata/Cargo.toml
+3 −3 axum/oauth2/Cargo.toml
+3 −3 axum/postgres/Cargo.toml
+3 −3 axum/qdrant/Cargo.toml
+2 −2 axum/static-files/Cargo.toml
+4 −4 axum/turso/Cargo.toml
+1 −1 axum/turso/src/main.rs
+2 −2 axum/websocket/Cargo.toml
+2 −2 bevy/hello-world/server/Cargo.toml
+3 −3 custom-resource/pdo/Cargo.toml
+1 −1 custom-service/none/Cargo.toml
+2 −2 custom-service/request-scheduler/Cargo.toml
+3 −3 fullstack-templates/saas/backend/Cargo.toml
+2 −2 loco/hello-world/Cargo.toml
+2 −2 other/standalone-binary/Cargo.toml
+2 −2 poem/hello-world/Cargo.toml
+3 −3 poem/mongodb/Cargo.toml
+2 −2 poise/hello-world/Cargo.toml
+2 −2 rocket/dyn-templates/Cargo.toml
+2 −2 rocket/hello-world/Cargo.toml
+2 −2 rocket/jwt-authentication/Cargo.toml
+3 −3 rocket/opendal-memory/Cargo.toml
+3 −3 rocket/persist/Cargo.toml
+3 −3 rocket/postgres/Cargo.toml
+2 −2 rocket/secrets/Cargo.toml
+2 −2 rocket/static-files/Cargo.toml
+3 −3 rocket/url-shortener/Cargo.toml
+2 −2 rocket/workspace/hello-world/Cargo.toml
+2 −2 salvo/hello-world/Cargo.toml
+2 −2 salvo/image-rescaler/Cargo.toml
+2 −2 serenity/hello-world/Cargo.toml
+3 −3 serenity/postgres/Cargo.toml
+2 −2 serenity/weather-forecast/Cargo.toml
+2 −2 thruster/hello-world/Cargo.toml
+2 −2 tide/hello-world/Cargo.toml
+2 −2 tower/hello-world/Cargo.toml
+2 −2 tracing/custom-tracing-subscriber/Cargo.toml
+2 −2 warp/hello-world/Cargo.toml
6 changes: 4 additions & 2 deletions gateway/src/auth.rs
Expand Up @@ -4,7 +4,8 @@ use axum::extract::{FromRef, FromRequestParts, Path};
use axum::http::request::Parts;
use serde::{Deserialize, Serialize};
use shuttle_backends::project_name::ProjectName;
use shuttle_common::claims::{Claim, Scope};
use shuttle_backends::ClaimExt;
use shuttle_common::claims::Claim;
use shuttle_common::models::error::InvalidProjectName;
use shuttle_common::models::user::UserId;
use tracing::{error, trace, Span};
Expand Down Expand Up @@ -82,7 +83,8 @@ where
let RouterState { service, .. } = RouterState::from_ref(state);

#[allow(clippy::blocks_in_if_conditions)]
if user.claim.scopes.contains(&Scope::Admin)
if user.claim.is_admin()
|| user.claim.is_deployer()
|| service
.permit_client
.allowed(&user.id, &scope.to_string(), "develop") // TODO?: make this configurable per endpoint?
Expand Down

0 comments on commit 6c66c7b

Please sign in to comment.