pub struct AuthManager { /* private fields */ }Expand description
Selects exactly one active auth strategy per deployment, chosen via the
auth_method config value — there is no runtime engine for resolving
multiple simultaneously-required schemes. These three methods
(SqlServer/Windows/AzureAd) are the complete set SQL Server’s TDS
protocol accepts (see core::config_schema::AuthMethod’s doc comment)
— there is no per-request/HTTP-header credential relay concept here:
this server always connects to SQL Server with the one set of
operator-configured credentials resolved via credentials()’s config/
env/keychain cascade below, regardless of how a caller reaches this
MCP server (stdio or HTTP).
Implementations§
Source§impl AuthManager
impl AuthManager
pub fn new(auth_method: AuthMethod) -> Self
pub async fn login(&mut self, config: &AuthConfig) -> Result<Credentials>
Sourcepub fn set_credentials(&mut self, credentials: Credentials)
pub fn set_credentials(&mut self, credentials: Credentials)
Seeds in-memory credentials directly, bypassing OS-keychain/file storage entirely — for tests (which must never touch the real OS keychain as a side effect of running) and for callers that already hold validated credentials from elsewhere.
pub async fn credentials(&mut self) -> Result<Credentials>
Sourcepub async fn resolve_tds_auth(&mut self) -> Result<AuthMethod>
pub async fn resolve_tds_auth(&mut self) -> Result<AuthMethod>
Resolves this deployment’s active tiberius::AuthMethod from the
config/env/keychain cascade (credentials()).
Auto Trait Implementations§
impl !RefUnwindSafe for AuthManager
impl !UnwindSafe for AuthManager
impl Freeze for AuthManager
impl Send for AuthManager
impl Sync for AuthManager
impl Unpin for AuthManager
impl UnsafeUnpin for AuthManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more