auth0-integration 0.6.1

Auth0 client library for M2M token retrieval and JWT validation (RS256)
Documentation
use serde::{Deserialize, Serialize};

#[derive(Debug, Deserialize, Serialize)]
pub struct Auth0User {
    pub user_id: String,
    pub email: String,
    pub email_verified: bool,
    pub name: Option<String>,
    pub picture: Option<String>,
}

impl Auth0User {
    /// Creates a new `Auth0User`.
    ///
    /// This struct is typically deserialized from Auth0 API responses, but
    /// `new()` is provided for convenience in tests or manual construction.
    ///
    /// # Parameters
    ///
    /// | Parameter        | Type            | Description                                      |
    /// |------------------|-----------------|--------------------------------------------------|
    /// | `user_id`        | `String`        | Auth0 user ID (e.g. `"auth0|64a1b2c3d4e5f6"`)   |
    /// | `email`          | `String`        | User's email address                             |
    /// | `email_verified` | `bool`          | Whether the email has been verified              |
    /// | `name`           | `Option<String>`| Full display name, if provided                   |
    /// | `picture`        | `Option<String>`| URL of the user's profile picture, if provided   |
    ///
    /// # Example
    ///
    /// ```rust
    /// use auth0_integration::models::Auth0User;
    ///
    /// let user = Auth0User::new(
    ///     "auth0|64a1b2c3d4e5f6".to_string(),
    ///     "jane@example.com".to_string(),
    ///     true,
    ///     Some("Jane Doe".to_string()),
    ///     None,
    /// );
    /// ```
    pub fn new(
        user_id: String,
        email: String,
        email_verified: bool,
        name: Option<String>,
        picture: Option<String>,
    ) -> Self {
        Self { user_id, email, email_verified, name, picture }
    }
}