mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 09:20:22 +08:00
fix(provider): 隐藏 Windsurf refresh token 刷新入口
This commit is contained in:
@@ -50,6 +50,7 @@ pub(crate) struct ProviderKeyAuthSemantics {
|
||||
credential_kind: ProviderKeyCredentialKind,
|
||||
runtime_auth_kind: ProviderKeyRuntimeAuthKind,
|
||||
oauth_managed: bool,
|
||||
can_refresh_oauth: bool,
|
||||
}
|
||||
|
||||
impl ProviderKeyAuthSemantics {
|
||||
@@ -66,7 +67,7 @@ impl ProviderKeyAuthSemantics {
|
||||
}
|
||||
|
||||
pub(crate) const fn can_refresh_oauth(self) -> bool {
|
||||
self.oauth_managed
|
||||
self.can_refresh_oauth
|
||||
}
|
||||
|
||||
pub(crate) const fn can_export_oauth(self) -> bool {
|
||||
@@ -179,10 +180,12 @@ pub(crate) fn provider_key_auth_semantics(
|
||||
}
|
||||
};
|
||||
|
||||
let provider_type_normalized = provider_type.trim().to_ascii_lowercase();
|
||||
ProviderKeyAuthSemantics {
|
||||
credential_kind,
|
||||
runtime_auth_kind,
|
||||
oauth_managed,
|
||||
can_refresh_oauth: oauth_managed && provider_type_normalized != "windsurf",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -341,6 +344,7 @@ mod tests {
|
||||
let semantics = provider_key_auth_semantics(&sample_key("oauth"), "windsurf");
|
||||
|
||||
assert!(semantics.oauth_managed());
|
||||
assert!(!semantics.can_refresh_oauth());
|
||||
assert_eq!(
|
||||
semantics.credential_kind(),
|
||||
ProviderKeyCredentialKind::OAuthSession
|
||||
|
||||
Reference in New Issue
Block a user