Struct libqaul::api::Users [−][src]
Local user data and session management
Used entirely to namespace API endpoints on Qaul
instance,
without having long type identifiers.
Implementations
impl<'qaul> Users<'qaul>
[src]
pub fn drop(&'qaul self) -> &'qaul Qaul
[src]
Drop this scope and return back to global Qaul
scope
pub async fn list(&self) -> Vec<UserProfile>
[src]
Enumerate all users available
No information about sessions or existing login state is stored or accessible via this API.
pub async fn list_remote(&self) -> Vec<UserProfile>
[src]
Enumerate remote stored users available
pub async fn is_authenticated(&self, user: UserAuth) -> Result<()>
[src]
Check if a user ID and token combination is valid
pub async fn create(&self, pw: &str) -> Result<UserAuth>
[src]
Create a new user and authenticated session
The specified password pw
is used to encrypt the user’s
private key and message stores and should be kept safe from
potential attackers.
It’s mandatory to choose a password here, however it is possible for a frontend to choose a random sequence for a user, instead of leaving files completely unencrypted. In this case, there’s no real security, but a drive-by will still only grab encrypted files.
pub async fn delete(&self, user: UserAuth) -> Result<()>
[src]
Delete a local user from the auth store
This function requires a valid login for the user that’s being deleted. This does not delete any data associated with this user, or messages from the node (or other device nodes).
pub fn change_pw(&self, user: UserAuth, newpw: &str) -> Result<()>
[src]
Change the passphrase for an authenticated user
pub async fn login(&self, user: Identity, pw: &str) -> Result<UserAuth>
[src]
Create a new session login for a local User
pub async fn logout(&self, user: UserAuth) -> Result<()>
[src]
Drop the current session Token, invalidating it
pub async fn get(&self, user: Identity) -> Result<UserProfile>
[src]
Fetch the UserProfile
for a known identity, remote or local
No athentication is required for this endpoint, seeing as only
public information is exposed via the UserProfile
abstraction anyway.
pub async fn update(&self, user: UserAuth, update: UserUpdate) -> Result<()>
[src]
Update a UserProfile
with a lambda, if authentication passes
Auto Trait Implementations
impl<'chain> !RefUnwindSafe for Users<'chain>
impl<'chain> Send for Users<'chain>
impl<'chain> Sync for Users<'chain>
impl<'chain> Unpin for Users<'chain>
impl<'chain> !UnwindSafe for Users<'chain>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
pub fn vzip(self) -> V
impl<T> WithSubscriber for T
[src]
pub fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,