@@ -1333,7 +1333,8 @@ pub(super) async fn handle_list_provider_profiles(
13331333) -> Result < Response < ListProviderProfilesResponse > , Status > {
13341334 let request = request. into_inner ( ) ;
13351335 let workspace =
1336- super :: workspace:: resolve_workspace ( state. store . as_ref ( ) , & request. workspace ) . await ?;
1336+ super :: workspace:: resolve_profile_workspace ( state. store . as_ref ( ) , & request. workspace )
1337+ . await ?;
13371338 let limit = clamp_limit ( request. limit , 100 , MAX_PAGE_SIZE ) as usize ;
13381339 let offset = request. offset as usize ;
13391340 let mut profiles = merged_provider_profiles ( state. store . as_ref ( ) , & workspace) . await ?;
@@ -1353,7 +1354,7 @@ pub(super) async fn handle_get_provider_profile(
13531354) -> Result < Response < ProviderProfileResponse > , Status > {
13541355 let req = request. into_inner ( ) ;
13551356 let workspace =
1356- super :: workspace:: resolve_workspace ( state. store . as_ref ( ) , & req. workspace ) . await ?;
1357+ super :: workspace:: resolve_profile_workspace ( state. store . as_ref ( ) , & req. workspace ) . await ?;
13571358 let id = req. id ;
13581359 let id = normalize_profile_id_request ( & id) ?;
13591360 let profile = get_provider_type_profile ( state. store . as_ref ( ) , & workspace, & id)
@@ -1372,7 +1373,8 @@ pub(super) async fn handle_import_provider_profiles(
13721373) -> Result < Response < ImportProviderProfilesResponse > , Status > {
13731374 let request = request. into_inner ( ) ;
13741375 let workspace =
1375- super :: workspace:: resolve_workspace ( state. store . as_ref ( ) , & request. workspace ) . await ?;
1376+ super :: workspace:: resolve_profile_workspace ( state. store . as_ref ( ) , & request. workspace )
1377+ . await ?;
13761378 let ( profiles, mut diagnostics) = profiles_from_import_items ( & request. profiles ) ;
13771379 add_empty_profile_set_diagnostic ( & profiles, & mut diagnostics) ;
13781380 let _sandbox_sync_guard = state. compute . sandbox_sync_guard ( ) . await ;
@@ -1438,7 +1440,8 @@ pub(super) async fn handle_update_provider_profiles(
14381440) -> Result < Response < UpdateProviderProfilesResponse > , Status > {
14391441 let request = request. into_inner ( ) ;
14401442 let workspace =
1441- super :: workspace:: resolve_workspace ( state. store . as_ref ( ) , & request. workspace ) . await ?;
1443+ super :: workspace:: resolve_profile_workspace ( state. store . as_ref ( ) , & request. workspace )
1444+ . await ?;
14421445 let items = request. profile . into_iter ( ) . collect :: < Vec < _ > > ( ) ;
14431446 let ( profiles, mut diagnostics) = profiles_from_import_items ( & items) ;
14441447 add_empty_profile_set_diagnostic ( & profiles, & mut diagnostics) ;
@@ -1553,7 +1556,8 @@ pub(super) async fn handle_lint_provider_profiles(
15531556) -> Result < Response < LintProviderProfilesResponse > , Status > {
15541557 let request = request. into_inner ( ) ;
15551558 let workspace =
1556- super :: workspace:: resolve_workspace ( state. store . as_ref ( ) , & request. workspace ) . await ?;
1559+ super :: workspace:: resolve_profile_workspace ( state. store . as_ref ( ) , & request. workspace )
1560+ . await ?;
15571561 let ( profiles, mut diagnostics) = profiles_from_import_items ( & request. profiles ) ;
15581562 add_empty_profile_set_diagnostic ( & profiles, & mut diagnostics) ;
15591563 diagnostics
@@ -1573,7 +1577,7 @@ pub(super) async fn handle_delete_provider_profile(
15731577) -> Result < Response < DeleteProviderProfileResponse > , Status > {
15741578 let req = request. into_inner ( ) ;
15751579 let workspace =
1576- super :: workspace:: resolve_workspace ( state. store . as_ref ( ) , & req. workspace ) . await ?;
1580+ super :: workspace:: resolve_profile_workspace ( state. store . as_ref ( ) , & req. workspace ) . await ?;
15771581 let id = req. id ;
15781582 let id = normalize_profile_id_request ( & id) ?;
15791583 let _sandbox_sync_guard = state. compute . sandbox_sync_guard ( ) . await ;
@@ -7086,9 +7090,7 @@ mod tests {
70867090 workspace : "default" . to_string ( ) ,
70877091 } ) ,
70887092 r#type : "claude" . to_string ( ) ,
7089- credentials : [ ( "ANTHROPIC_API_KEY" . to_string ( ) , "sk-123" . to_string ( ) ) ]
7090- . into_iter ( )
7091- . collect ( ) ,
7093+ credentials : HashMap :: from ( [ ( "ANTHROPIC_API_KEY" . to_string ( ) , "sk-123" . to_string ( ) ) ] ) ,
70927094 config : HashMap :: new ( ) ,
70937095 credential_expires_at_ms : HashMap :: new ( ) ,
70947096 profile_workspace : "other-workspace" . to_string ( ) ,
@@ -7113,9 +7115,7 @@ mod tests {
71137115 workspace : "default" . to_string ( ) ,
71147116 } ) ,
71157117 r#type : "claude" . to_string ( ) ,
7116- credentials : [ ( "ANTHROPIC_API_KEY" . to_string ( ) , "sk-123" . to_string ( ) ) ]
7117- . into_iter ( )
7118- . collect ( ) ,
7118+ credentials : HashMap :: from ( [ ( "ANTHROPIC_API_KEY" . to_string ( ) , "sk-123" . to_string ( ) ) ] ) ,
71197119 config : HashMap :: new ( ) ,
71207120 credential_expires_at_ms : HashMap :: new ( ) ,
71217121 profile_workspace : String :: new ( ) ,
@@ -7139,9 +7139,7 @@ mod tests {
71397139 workspace : "default" . to_string ( ) ,
71407140 } ) ,
71417141 r#type : "claude" . to_string ( ) ,
7142- credentials : [ ( "ANTHROPIC_API_KEY" . to_string ( ) , "sk-123" . to_string ( ) ) ]
7143- . into_iter ( )
7144- . collect ( ) ,
7142+ credentials : HashMap :: from ( [ ( "ANTHROPIC_API_KEY" . to_string ( ) , "sk-123" . to_string ( ) ) ] ) ,
71457143 config : HashMap :: new ( ) ,
71467144 credential_expires_at_ms : HashMap :: new ( ) ,
71477145 profile_workspace : "default" . to_string ( ) ,
@@ -7165,9 +7163,7 @@ mod tests {
71657163 workspace : "default" . to_string ( ) ,
71667164 } ) ,
71677165 r#type : "claude" . to_string ( ) ,
7168- credentials : [ ( "ANTHROPIC_API_KEY" . to_string ( ) , "sk-123" . to_string ( ) ) ]
7169- . into_iter ( )
7170- . collect ( ) ,
7166+ credentials : HashMap :: from ( [ ( "ANTHROPIC_API_KEY" . to_string ( ) , "sk-123" . to_string ( ) ) ] ) ,
71717167 config : HashMap :: new ( ) ,
71727168 credential_expires_at_ms : HashMap :: new ( ) ,
71737169 profile_workspace : "default" . to_string ( ) ,
@@ -7260,9 +7256,7 @@ mod tests {
72607256 workspace : "default" . to_string ( ) ,
72617257 } ) ,
72627258 r#type : "ws-custom" . to_string ( ) ,
7263- credentials : [ ( "TOKEN" . to_string ( ) , "val" . to_string ( ) ) ]
7264- . into_iter ( )
7265- . collect ( ) ,
7259+ credentials : HashMap :: from ( [ ( "TOKEN" . to_string ( ) , "val" . to_string ( ) ) ] ) ,
72667260 config : HashMap :: new ( ) ,
72677261 credential_expires_at_ms : HashMap :: new ( ) ,
72687262 profile_workspace : "default" . to_string ( ) ,
0 commit comments