File tree Expand file tree Collapse file tree 14 files changed +49
-32
lines changed
inferadb-control-config/src
inferadb-control-const/src
inferadb-control-core/src
inferadb-control-discovery/src
inferadb-control-engine-client/src
inferadb-control-storage/src
inferadb-control-test-fixtures/src
inferadb-control-types/src Expand file tree Collapse file tree 14 files changed +49
-32
lines changed Original file line number Diff line number Diff line change @@ -397,13 +397,13 @@ pub async fn logout(
397397 jar : CookieJar ,
398398) -> Result < ( CookieJar , Json < LogoutResponse > ) > {
399399 // Get session ID from cookie
400- if let Some ( cookie) = jar. get ( SESSION_COOKIE_NAME ) {
401- if let Ok ( session_id) = cookie. value ( ) . parse :: < i64 > ( ) {
402- let repos = RepositoryContext :: new ( ( * state . storage ) . clone ( ) ) ;
403- // Revoke session
404- // Ignore errors if session doesn't exist
405- let _ = repos . user_session . revoke ( session_id ) . await ;
406- }
400+ if let Some ( cookie) = jar. get ( SESSION_COOKIE_NAME )
401+ && let Ok ( session_id) = cookie. value ( ) . parse :: < i64 > ( )
402+ {
403+ let repos = RepositoryContext :: new ( ( * state . storage ) . clone ( ) ) ;
404+ // Revoke session
405+ // Ignore errors if session doesn't exist
406+ let _ = repos . user_session . revoke ( session_id ) . await ;
407407 }
408408
409409 // Remove session cookie
Original file line number Diff line number Diff line change @@ -703,18 +703,17 @@ pub async fn create_invitation(
703703 }
704704
705705 // Check if user with this email already exists and is a member
706- if let Some ( existing_email) = repos. user_email . get_by_email ( & payload. email ) . await ? {
707- if repos
706+ if let Some ( existing_email) = repos. user_email . get_by_email ( & payload. email ) . await ?
707+ && repos
708708 . org_member
709709 . get_by_org_and_user ( org_ctx. organization_id , existing_email. user_id )
710710 . await ?
711711 . is_some ( )
712- {
713- return Err ( CoreError :: AlreadyExists (
714- "User is already a member of this organization" . to_string ( ) ,
715- )
716- . into ( ) ) ;
717- }
712+ {
713+ return Err ( CoreError :: AlreadyExists (
714+ "User is already a member of this organization" . to_string ( ) ,
715+ )
716+ . into ( ) ) ;
718717 }
719718
720719 // Check for existing invitation
Original file line number Diff line number Diff line change @@ -99,14 +99,14 @@ pub async fn delete_user(
9999 if membership. role == inferadb_control_core:: entities:: OrganizationRole :: Owner {
100100 // Check if this user is the only owner
101101 let owner_count = repos. org_member . count_owners ( membership. organization_id ) . await ?;
102- if owner_count <= 1 {
103- if let Some ( org) = repos. org . get ( membership. organization_id ) . await ? {
104- return Err ( CoreError :: Validation ( format ! (
105- "Cannot delete account while being the only owner of organization '{}'. Please transfer ownership or delete the organization first." ,
106- org . name
107- ) )
108- . into ( ) ) ;
109- }
102+ if owner_count <= 1
103+ && let Some ( org) = repos. org . get ( membership. organization_id ) . await ?
104+ {
105+ return Err ( CoreError :: Validation ( format ! (
106+ "Cannot delete account while being the only owner of organization '{}'. Please transfer ownership or delete the organization first." ,
107+ org . name
108+ ) )
109+ . into ( ) ) ;
110110 }
111111 }
112112 }
Original file line number Diff line number Diff line change 11// REST API handlers and routes
22
3+ #![ deny( unsafe_code) ]
4+
35use std:: sync:: Arc ;
46
57use inferadb_control_core:: { ControlConfig , startup} ;
Original file line number Diff line number Diff line change @@ -76,10 +76,10 @@ impl JwksCache {
7676 // Check cache first
7777 {
7878 let cache = self . jwks . read ( ) . await ;
79- if let Some ( ( jwks, cached_at) ) = cache. as_ref ( ) {
80- if cached_at. elapsed ( ) < self . ttl {
81- return Ok ( jwks . clone ( ) ) ;
82- }
79+ if let Some ( ( jwks, cached_at) ) = cache. as_ref ( )
80+ && cached_at. elapsed ( ) < self . ttl
81+ {
82+ return Ok ( jwks . clone ( ) ) ;
8383 }
8484 }
8585
Original file line number Diff line number Diff line change 2626//! The control service reads its configuration from the `control:` section. Any `engine:` section
2727//! is ignored by control (and vice versa when engine reads the same file).
2828
29+ #![ deny( unsafe_code) ]
30+
2931pub mod refresh;
3032
3133use std:: path:: Path ;
Original file line number Diff line number Diff line change 88//! - Business limit constants (max sessions, passkeys, organizations)
99//! - Rate limit category identifiers
1010
11+ #![ deny( unsafe_code) ]
12+
1113pub mod auth;
1214pub mod duration;
1315pub mod limits;
Original file line number Diff line number Diff line change 1+ #![ deny( unsafe_code) ]
2+
13// Re-export configuration from dedicated config crate
24pub use inferadb_control_config as config;
35pub use inferadb_control_config:: { ConfigRefresher , ControlConfig } ;
Original file line number Diff line number Diff line change 99//! - **Static**: Use service URL directly (no discovery)
1010//! - **Kubernetes**: Discover pod IPs from Kubernetes Endpoints API
1111
12+ #![ deny( unsafe_code) ]
13+
1214use std:: fmt;
1315
1416use async_trait:: async_trait;
Original file line number Diff line number Diff line change @@ -230,11 +230,11 @@ impl EngineClient {
230230 // Check cache first
231231 {
232232 let cache = self . endpoint_cache . read ( ) ;
233- if let Some ( cached) = cache. as_ref ( ) {
234- if cached. is_valid ( ) {
235- debug ! ( count = cached . endpoints . len ( ) , "Using cached engine endpoints" ) ;
236- return cached. endpoints . clone ( ) ;
237- }
233+ if let Some ( cached) = cache. as_ref ( )
234+ && cached. is_valid ( )
235+ {
236+ debug ! ( count = cached. endpoints. len ( ) , "Using cached engine endpoints" ) ;
237+ return cached . endpoints . clone ( ) ;
238238 }
239239 }
240240
You can’t perform that action at this time.
0 commit comments