mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-08-03 02:51:17 +08:00
Fix Claude Desktop Cowork egress profile (#3172)
This commit is contained in:
@@ -946,6 +946,7 @@ fn build_gateway_profile(
|
|||||||
model_specs: Option<&[InferenceModelSpec]>,
|
model_specs: Option<&[InferenceModelSpec]>,
|
||||||
) -> Value {
|
) -> Value {
|
||||||
let mut profile = json!({
|
let mut profile = json!({
|
||||||
|
"coworkEgressAllowedHosts": ["*"],
|
||||||
"disableDeploymentModeChooser": true,
|
"disableDeploymentModeChooser": true,
|
||||||
"inferenceGatewayApiKey": api_key,
|
"inferenceGatewayApiKey": api_key,
|
||||||
"inferenceGatewayAuthScheme": "bearer",
|
"inferenceGatewayAuthScheme": "bearer",
|
||||||
@@ -1404,6 +1405,7 @@ mod tests {
|
|||||||
assert_eq!(profile["inferenceGatewayApiKey"], json!("test-token"));
|
assert_eq!(profile["inferenceGatewayApiKey"], json!("test-token"));
|
||||||
assert_eq!(profile["inferenceGatewayAuthScheme"], json!("bearer"));
|
assert_eq!(profile["inferenceGatewayAuthScheme"], json!("bearer"));
|
||||||
assert_eq!(profile["disableDeploymentModeChooser"], json!(true));
|
assert_eq!(profile["disableDeploymentModeChooser"], json!(true));
|
||||||
|
assert_eq!(profile["coworkEgressAllowedHosts"], json!(["*"]));
|
||||||
assert!(profile.get("inferenceModels").is_none());
|
assert!(profile.get("inferenceModels").is_none());
|
||||||
assert_eq!(meta["appliedId"], json!(PROFILE_ID));
|
assert_eq!(meta["appliedId"], json!(PROFILE_ID));
|
||||||
assert!(meta["entries"]
|
assert!(meta["entries"]
|
||||||
@@ -1464,6 +1466,7 @@ mod tests {
|
|||||||
json!("http://127.0.0.1:15721/claude-desktop")
|
json!("http://127.0.0.1:15721/claude-desktop")
|
||||||
);
|
);
|
||||||
assert_eq!(profile["inferenceGatewayAuthScheme"], json!("bearer"));
|
assert_eq!(profile["inferenceGatewayAuthScheme"], json!("bearer"));
|
||||||
|
assert_eq!(profile["coworkEgressAllowedHosts"], json!(["*"]));
|
||||||
assert_ne!(profile["inferenceGatewayApiKey"], json!("test-token"));
|
assert_ne!(profile["inferenceGatewayApiKey"], json!("test-token"));
|
||||||
assert!(profile["inferenceGatewayApiKey"]
|
assert!(profile["inferenceGatewayApiKey"]
|
||||||
.as_str()
|
.as_str()
|
||||||
|
|||||||
Reference in New Issue
Block a user