fix: persist runtime proxy token
This commit is contained in:
@@ -610,7 +610,8 @@ async fn check_auth(state: &AppState, headers: &HeaderMap) -> Result<Option<i64>
|
||||
.and_then(|v| v.split_whitespace().next())
|
||||
.ok_or_else(|| AppError::Unauthorized("Missing Authorization header".into()))?;
|
||||
|
||||
let result = authorize_downstream_token(auth, &state.db, Some(&state.config.auth.proxy_token))
|
||||
let proxy_token = state.runtime_proxy_token();
|
||||
let result = authorize_downstream_token(auth, &state.db, Some(&proxy_token))
|
||||
.await
|
||||
.map_err(AppError::Unauthorized)?;
|
||||
|
||||
@@ -1693,6 +1694,7 @@ mod tests {
|
||||
crate::services::builtin_keys::BuiltinKeys {
|
||||
comfyui_agent: (0, "sk-comfyui-test".to_string()),
|
||||
},
|
||||
crate::services::runtime_auth::RuntimeAuthSettings::from_token_for_test("proxy"),
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user