Skip to main content

UserConfig

Struct UserConfig 

Source
pub struct UserConfig {
    pub additional_fields: Option<IndexMap<String, UserFieldConfig>>,
}
Expand description

Application user schema.

Fields§

§additional_fields: Option<IndexMap<String, UserFieldConfig>>

Public field policies. None preserves omission; Some(IndexMap::new()) is explicitly empty.

Implementations§

Source§

impl UserConfig

Source

pub async fn storage_fields_for_adapter( &self, input: FieldMap, create: bool, supports_native_json: bool, native_json_field: impl Fn(&str) -> bool, ) -> AuthResult<FieldMap>

Apply storage policies before converting JSON for the selected adapter.

Source

pub async fn storage_fields_with_binding( &self, input: FieldMap, create: bool, bind: impl Fn(&str, &UserFieldConfig, Value) -> AuthResult<Value>, ) -> AuthResult<FieldMap>

Bind transformed fields to an adapter without repeating defaults or application transforms.

Source§

impl UserConfig

Source

pub async fn organization_storage_fields( &self, core: FieldMap, extras: FieldMap, create: bool, ) -> AuthResult<FieldMap>

Apply configured policies once to logical core fields and application fields. The adapter owns id; custom field attributes cannot replace its policy.

Source

pub fn parse_organization_input( &self, input: &FieldMap, prefix: &str, partial: bool, ) -> AuthResult<FieldMap>

Validate Organization route fields without applying adapter defaults or transforms.

Source

pub async fn output_fields(&self, storage: &FieldMap) -> AuthResult<FieldMap>

Apply the adapter’s field mapping and output transforms before route visibility filtering.

Source

pub async fn output_fields_many( &self, storage: &[FieldMap], ) -> AuthResult<Vec<FieldMap>>

Project a database result while retaining row order and per-row field order.

Source

pub fn filter_returned_fields(&self, fields: &mut FieldMap)

Apply only returned flags to fields already projected by the adapter.

Source§

impl UserConfig

Source

pub async fn organization_output_records( &self, records: Vec<AdapterRecord>, supports_native_json: bool, ) -> AuthResult<Vec<FieldMap>>

Project Organization rows in one batch while retaining adapter-owned IDs.

Source

pub async fn organization_output_records_then<R: Send, F>( &self, records: Vec<AdapterRecord>, supports_native_json: bool, complete: impl Fn(usize, FieldMap) -> F + Sync, ) -> AuthResult<Vec<R>>
where F: Future<Output = AuthResult<R>> + Send,

Continue each Organization row after projection without cancelling started peers.

Source

pub async fn organization_output_records_batches_then<V: Send, R: Send, F>( &self, records: Vec<AdapterRecord>, supports_native_json: bool, decode: impl Fn(usize, FieldMap) -> AuthResult<V> + Sync, complete: impl Fn(Vec<(usize, V)>) -> F + Sync, ) -> AuthResult<Vec<R>>
where F: Future<Output = AuthResult<Vec<(usize, R)>>> + Send,

Decode ready Organization rows before continuing their synchronous adapter reads together.

Source

pub fn record_storage_key<'a>(&'a self, name: &'a str) -> &'a str

Resolve a logical field in an adapter-owned record.

Source

pub async fn project_record( &self, storage: &FieldMap, supports_native_json: bool, supports_native_dates: bool, ) -> AuthResult<FieldMap>

Project a raw adapter record without retaining unmapped storage field names.

Source

pub async fn project_records( &self, storage: &[FieldMap], supports_native_json: bool, supports_native_dates: bool, ) -> AuthResult<Vec<FieldMap>>

Project raw adapter records together without retaining unmapped storage field names.

Source

pub async fn project_records_then<R: Send, F>( &self, storage: &[FieldMap], supports_native_json: bool, supports_native_dates: bool, complete: impl Fn(usize, FieldMap) -> F + Sync, ) -> AuthResult<Vec<R>>
where F: Future<Output = AuthResult<R>> + Send,

Complete each successfully projected row without cancelling other started rows. The original row index remains available for adapter-owned association data.

Source

pub async fn project_records_batches_then<R: Send, F>( &self, storage: &[FieldMap], supports_native_json: bool, supports_native_dates: bool, complete: impl Fn(Vec<(usize, FieldMap)>) -> F + Sync, ) -> AuthResult<Vec<R>>
where F: Future<Output = AuthResult<Vec<(usize, R)>>> + Send,

Continue ready raw records as a batch, retaining each original row index.

Source

pub async fn record_storage_fields_for_adapter( &self, input: FieldMap, create: bool, supports_native_json: bool, native_json_field: impl Fn(&str) -> bool, ) -> AuthResult<FieldMap>

Apply adapter input policies once to a complete logical record or update patch. Native adapter writes do not run HTTP input validation or remove input: false fields.

Source

pub async fn record_storage_fields_with_binding( &self, input: FieldMap, create: bool, bind: impl Fn(&str, &UserFieldConfig, Value) -> AuthResult<Value>, ) -> AuthResult<FieldMap>

Bind a complete record after its storage policies, while retaining force-allowed IDs.

Source

pub async fn record_output_fields( &self, core: FieldMap, storage: &FieldMap, supports_native_json: bool, supports_native_dates: bool, ) -> AuthResult<FieldMap>

Project stored values without applying endpoint visibility or decoding replacement types. The caller must invoke this after the write and before cache writes or database after hooks.

Source

pub async fn project_adapter_records( &self, records: Vec<AdapterRecord>, supports_native_json: bool, supports_native_dates: bool, ) -> AuthResult<Vec<FieldMap>>

Project extracted records in row order, interleaving synchronous callbacks by field.

Source

pub async fn project_adapter_records_with_capabilities( &self, records: Vec<AdapterRecord>, capabilities: FieldOutputCapabilities, supports_native_dates: bool, ) -> AuthResult<Vec<FieldMap>>

Project adapter fields with the database’s JSON, array, boolean, and date conversions.

Source

pub async fn project_adapter_records_then<R: Send, F>( &self, records: Vec<AdapterRecord>, supports_native_json: bool, supports_native_dates: bool, complete: impl Fn(usize, FieldMap) -> F + Sync, ) -> AuthResult<Vec<R>>
where F: Future<Output = AuthResult<R>> + Send,

Complete each extracted row after its output policies, retaining the original row order. A failed projection skips its completion; other started rows still finish before an error returns.

Source

pub async fn project_adapter_records_batches_then<R: Send, F>( &self, records: Vec<AdapterRecord>, supports_native_json: bool, supports_native_dates: bool, complete: impl Fn(Vec<(usize, FieldMap)>) -> F + Sync, ) -> AuthResult<Vec<R>>
where F: Future<Output = AuthResult<Vec<(usize, R)>>> + Send,

Continue ready extracted records together, retaining their original row indices.

Source§

impl UserConfig

Source

pub fn stored_username_field( &self, fields: &FieldMap, name: &str, ) -> AuthResult<Option<Option<String>>>

Read one stored username field for the implicit adapter’s typed columns. Keep the storage entry so output transforms can observe the original stored value once.

Source§

impl UserConfig

Source

pub fn fields(&self) -> &IndexMap<String, UserFieldConfig>

Runtime fields. An omitted map has no fields.

Source

pub fn fields_mut(&mut self) -> &mut IndexMap<String, UserFieldConfig>

Configure fields, creating an explicitly present map when omitted.

Source

pub fn parse_input( &self, input: &FieldMap, create: bool, ) -> AuthResult<FieldMap>

Parse public input. Updates omit missing fields and never apply creation defaults.

Source

pub fn parse_provider_input( &self, profile: &FieldMap, create: bool, ) -> AuthResult<FieldMap>

Parse an OAuth provider profile without trusting protected application fields.

Source

pub async fn storage_fields( &self, input: FieldMap, create: bool, ) -> AuthResult<FieldMap>

Map configured fields to application storage columns and await adapter transforms.

Trait Implementations§

Source§

impl Clone for UserConfig

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for UserConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more