Fix auth
This commit is contained in:
parent
738296345e
commit
27708143ec
6 changed files with 48 additions and 88 deletions
|
@ -1,4 +1,4 @@
|
|||
use std::{cell::Ref, path::Path, rc::Rc};
|
||||
use std::{error::Error, fmt, path::Path, rc::Rc};
|
||||
|
||||
use agent_client_protocol::{self as acp};
|
||||
use anyhow::Result;
|
||||
|
@ -16,7 +16,7 @@ pub trait AgentConnection {
|
|||
cx: &mut AsyncApp,
|
||||
) -> Task<Result<Entity<AcpThread>>>;
|
||||
|
||||
fn state(&self) -> Ref<'_, acp::AgentState>;
|
||||
fn auth_methods(&self) -> Vec<acp::AuthMethod>;
|
||||
|
||||
fn authenticate(&self, method: acp::AuthMethodId, cx: &mut App) -> Task<Result<()>>;
|
||||
|
||||
|
@ -24,3 +24,13 @@ pub trait AgentConnection {
|
|||
|
||||
fn cancel(&self, session_id: &acp::SessionId, cx: &mut App);
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct AuthRequired;
|
||||
|
||||
impl Error for AuthRequired {}
|
||||
impl fmt::Display for AuthRequired {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(f, "AuthRequired")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue