pub struct UpstreamAuth {
pub auth_token: Option<String>,
pub auth_token_env: Option<String>,
pub api_key: Option<String>,
pub api_key_env: Option<String>,
}Fields§
§auth_token: Option<String>Bearer token, e.g. OpenAI style
auth_token_env: Option<String>Environment variable name for bearer token (preferred over storing secrets on disk)
api_key: Option<String>Optional API key header for some providers
api_key_env: Option<String>Environment variable name for API key header value
Implementations§
Source§impl UpstreamAuth
impl UpstreamAuth
pub fn resolve_auth_token(&self) -> Option<String>
pub fn resolve_api_key(&self) -> Option<String>
Trait Implementations§
Source§impl Clone for UpstreamAuth
impl Clone for UpstreamAuth
Source§fn clone(&self) -> UpstreamAuth
fn clone(&self) -> UpstreamAuth
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for UpstreamAuth
impl Debug for UpstreamAuth
Source§impl Default for UpstreamAuth
impl Default for UpstreamAuth
Source§fn default() -> UpstreamAuth
fn default() -> UpstreamAuth
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for UpstreamAuth
impl<'de> Deserialize<'de> for UpstreamAuth
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<UpstreamAuth, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<UpstreamAuth, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for UpstreamAuth
impl Serialize for UpstreamAuth
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for UpstreamAuth
impl RefUnwindSafe for UpstreamAuth
impl Send for UpstreamAuth
impl Sync for UpstreamAuth
impl Unpin for UpstreamAuth
impl UnwindSafe for UpstreamAuth
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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