AuthenticatedUser#

pydantic model mobu.models.user.AuthenticatedUser#

Represents an authenticated user with a token.

Parameters:

data (Any)

Show JSON schema
{
   "title": "AuthenticatedUser",
   "description": "Represents an authenticated user with a token.",
   "type": "object",
   "properties": {
      "username": {
         "description": "Must start with 'bot-mobu'",
         "examples": [
            "bot-mobu-testuser"
         ],
         "pattern": "^bot-mobu",
         "title": "Username",
         "type": "string"
      },
      "uidnumber": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "If omitted, Gafaelfawr will assign a UID. (Gafaelfawr UID assignment requires Firestore be configured.)",
         "examples": [
            60001
         ],
         "title": "Numeric UID"
      },
      "gidnumber": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "If omitted but a UID was specified, use a GID equal to the UID. If both are omitted, Gafaelfawr will assign a UID and GID. (Gafaelfawr UID and GID assignment requires Firestore and synthetic user private groups to be configured.)",
         "examples": [
            60001
         ],
         "title": "Primary GID"
      },
      "groups": {
         "default": [],
         "description": "Groups of which the user is a member",
         "items": {
            "$ref": "#/$defs/Group"
         },
         "title": "Groups",
         "type": "array"
      },
      "scopes": {
         "examples": [
            [
               "exec:notebook",
               "read:tap"
            ]
         ],
         "items": {
            "type": "string"
         },
         "title": "Token scopes",
         "type": "array"
      },
      "token": {
         "examples": [
            "gt-1PhgAeB-9Fsa-N1NhuTu_w.oRvMvAQp1bWfx8KCJKNohg"
         ],
         "title": "Authentication token for user",
         "type": "string"
      }
   },
   "$defs": {
      "Group": {
         "description": "Configuration for the group memberships of a user.",
         "properties": {
            "name": {
               "examples": [
                  "g_special_users"
               ],
               "minLength": 1,
               "pattern": "^g_",
               "title": "Name of the group",
               "type": "string"
            },
            "id": {
               "examples": [
                  123181
               ],
               "title": "Numeric GID of the group",
               "type": "integer"
            }
         },
         "required": [
            "name",
            "id"
         ],
         "title": "Group",
         "type": "object"
      }
   },
   "required": [
      "username",
      "scopes",
      "token"
   ]
}

Fields:
field gidnumber: int | None = None#

If omitted but a UID was specified, use a GID equal to the UID. If both are omitted, Gafaelfawr will assign a UID and GID. (Gafaelfawr UID and GID assignment requires Firestore and synthetic user private groups to be configured.)

field groups: list[Group] = []#

Groups of which the user is a member

field scopes: list[str] [Required]#
field token: str [Required]#
field uidnumber: int | None = None#

If omitted, Gafaelfawr will assign a UID. (Gafaelfawr UID assignment requires Firestore be configured.)

field username: str [Required]#

Must start with ‘bot-mobu’

Constraints:
  • pattern = ^bot-mobu

to_client_user()#
Return type:

User