UserInfo

pydantic model gafaelfawr.models.userinfo.UserInfo

Metadata about a user.

All user metadata from whatever source (admin request, GitHub, LDAP, Firestore, etc.).

Parameters:

data (Any)

Show JSON schema
{
   "title": "UserInfo",
   "description": "Metadata about a user.\n\nAll user metadata from whatever source (admin request, GitHub, LDAP,\nFirestore, etc.).",
   "type": "object",
   "properties": {
      "username": {
         "description": "User to whom the token was issued",
         "examples": [
            "someuser"
         ],
         "maxLength": 64,
         "minLength": 1,
         "title": "Username",
         "type": "string"
      },
      "name": {
         "anyOf": [
            {
               "minLength": 1,
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            "Alice Example"
         ],
         "title": "Preferred full name"
      },
      "email": {
         "anyOf": [
            {
               "minLength": 1,
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            "alice@example.com"
         ],
         "title": "Email address"
      },
      "uid": {
         "anyOf": [
            {
               "minimum": 1,
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "examples": [
            4123
         ],
         "title": "UID number"
      },
      "gid": {
         "anyOf": [
            {
               "minimum": 1,
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "GID of primary group. If set, this will also be the GID of one of the groups of which the user is a member.",
         "examples": [
            4123
         ],
         "title": "Primary GID"
      },
      "groups": {
         "default": [],
         "description": "Groups of which the user is a member",
         "items": {
            "$ref": "#/$defs/Group"
         },
         "title": "Groups",
         "type": "array"
      },
      "quota": {
         "anyOf": [
            {
               "$ref": "#/$defs/Quota"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Quota"
      }
   },
   "$defs": {
      "Group": {
         "description": "Information about a single group.",
         "properties": {
            "name": {
               "examples": [
                  "g_special_users"
               ],
               "minLength": 1,
               "pattern": "^[a-zA-Z][a-zA-Z0-9._-]*$",
               "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"
      },
      "NotebookQuota": {
         "description": "Notebook Aspect quota information for a user.",
         "properties": {
            "cpu": {
               "examples": [
                  4.0
               ],
               "title": "CPU equivalents",
               "type": "number"
            },
            "memory": {
               "examples": [
                  16.0
               ],
               "title": "Maximum memory use (GiB)",
               "type": "number"
            }
         },
         "required": [
            "cpu",
            "memory"
         ],
         "title": "NotebookQuota",
         "type": "object"
      },
      "Quota": {
         "description": "Quota information for a user.",
         "properties": {
            "api": {
               "additionalProperties": {
                  "type": "integer"
               },
               "default": {},
               "description": "Mapping of service names to allowed requests per 15 minutes.",
               "examples": [
                  {
                     "datalinker": 500,
                     "hips": 2000,
                     "tap": 500,
                     "vo-cutouts": 100
                  }
               ],
               "title": "API quotas",
               "type": "object"
            },
            "notebook": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/NotebookQuota"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Notebook Aspect quotas"
            }
         },
         "title": "Quota",
         "type": "object"
      }
   },
   "required": [
      "username"
   ]
}

Fields:
field email: str | None = None
Constraints:
  • min_length = 1

field gid: int | None = None

GID of primary group. If set, this will also be the GID of one of the groups of which the user is a member.

Constraints:
  • ge = 1

field groups: list[Group] = []

Groups of which the user is a member

field name: str | None = None
Constraints:
  • min_length = 1

field quota: Quota | None = None
field uid: int | None = None
Constraints:
  • ge = 1

field username: str [Required]

User to whom the token was issued

Constraints:
  • min_length = 1

  • max_length = 64