pub struct CredentialFormSchema {
pub fields: Vec<FormField>,
pub instructions_markdown: String,
}Expand description
Describes the form fields and instructions for entering a credential.
Fields§
§fields: Vec<FormField>Input fields to render.
instructions_markdown: StringMarkdown instructions shown above the form (how to get the key, etc.).
Implementations§
Source§impl CredentialFormSchema
impl CredentialFormSchema
Sourcepub fn empty() -> CredentialFormSchema
pub fn empty() -> CredentialFormSchema
Schema with no fields (keyless integrations, e.g. test simulators).
Sourcepub fn api_key(instructions_markdown: impl Into<String>) -> CredentialFormSchema
pub fn api_key(instructions_markdown: impl Into<String>) -> CredentialFormSchema
The common single-field API key schema.
Sourcepub fn has_groups(&self) -> bool
pub fn has_groups(&self) -> bool
Whether the schema declares any mutually-exclusive credential groups
(e.g. “API key” or “OAuth”). When it does, at least one complete group
is required by CredentialFormSchema::validate.
Sourcepub fn validate(&self, fields: &BTreeMap<String, String>) -> Vec<String>
pub fn validate(&self, fields: &BTreeMap<String, String>) -> Vec<String>
Validate a submitted field map against this schema.
Rules:
- Every ungrouped required field must be present and non-empty.
- Fields sharing a
grouplabel form a mutually-exclusive alternative (e.g. MAI’s “API key” group vs its “Entra ID OAuth” group). A group is touched when any of its fields has a value; a touched group must have all of its required fields filled (no partially-entered OAuth blocks). - When the schema declares any groups, at least one group must be complete, so a provider cannot be saved with no credential at all.
Returns the list of human-readable validation errors; empty means valid. Unknown keys are ignored — drivers read only the fields they declare.
Trait Implementations§
Source§impl Clone for CredentialFormSchema
impl Clone for CredentialFormSchema
Source§fn clone(&self) -> CredentialFormSchema
fn clone(&self) -> CredentialFormSchema
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 CredentialFormSchema
impl Debug for CredentialFormSchema
Source§impl Serialize for CredentialFormSchema
impl Serialize for CredentialFormSchema
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 CredentialFormSchema
impl RefUnwindSafe for CredentialFormSchema
impl Send for CredentialFormSchema
impl Sync for CredentialFormSchema
impl Unpin for CredentialFormSchema
impl UnsafeUnpin for CredentialFormSchema
impl UnwindSafe for CredentialFormSchema
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request