Uniform Chat
  • Uniform.Matrix
  • API
Search Results for

    Show / Hide Table of Contents
    • Uniform.Matrix.Protocol.Core
      • Introduction
    • Uniform.Matrix.Protocol.Client
      • Introduction
      • Log in
      • Receive events
      • Rooms and messages
      • Directories and account data
      • Files and devices
      • Errors
    • Uniform.Matrix.Protocol.Crypto
      • Introduction
    • Uniform.Matrix.Hosting
      • Introduction
    • Uniform.Matrix.Gui.Terminal
      • Introduction
    • Uniform.Matrix.Audio
      • Introduction
    • Uniform.Matrix.Video
      • Introduction
    • Uniform.Stun.Protocol
      • Introduction
    • Uniform.Stun
      • Introduction
    • Uniform.LiveKit.Protocol
      • Introduction
    • Uniform.LiveKit
      • Introduction
    • Uniform.Matrix.WebRtc
      • Introduction
    • Uniform.Matrix.Client
      • Introduction
      • Room state
      • Rich text
      • Local storage
      • Outbox
      • Track rooms
    • Uniform.Matrix.Calls
      • Introduction
    • Uniform.Chat.Terminal
      • Introduction
    • Uniform.Chat.Avalonia
      • Introduction
      • View models
      • Views
    • Uniform.Chat.Desktop
      • Introduction
    • Uniform.Chat.Android
      • Introduction
    • Uniform.Matrix.Protocol.Server
      • Introduction
    • Uniform.Matrix.Server
      • Introduction
      • Requests
      • Storage
      • Events and state
      • Sync and the stream
      • Services
      • Push rules and pushers
      • Presence
      • URL previews
      • Rate limits
      • Federation
      • Testing
    • Uniform.Chat.Server
      • Introduction
    • Uniform.Turn
      • Introduction
    • Uniform.Stun.Hosting
      • Introduction
    • Uniform.Stun.Server
      • Introduction
    • Uniform.LiveKit.Authorization
      • Introduction
    • Uniform.LiveKit.Hosting
      • Introduction
    • Uniform.LiveKit.Server
      • Introduction
    • Building
    • Testing
    • Documentation

    Requests

    ASP.NET Core minimal APIs, one Map… extension per spec area in Endpoints/. Each endpoint reads the request, calls a service and returns JSON.

    • MatrixHttp.HandleAsync wraps every request: CORS headers, and standard errors from exceptions. A MatrixException becomes its status and errcode; MatrixErrorException adds fields such as current_version; AuthenticationRequiredException answers 401 with the user-interactive auth flows; bad JSON becomes M_BAD_JSON or M_NOT_JSON; unknown paths M_UNRECOGNIZED.
    • RequireAccessToken() on a route group checks the token from the Authorization header (or the deprecated access_token query parameter); handlers get the user with http.GetRequester(), or http.GetOwnRequester(userId) for endpoints that take a user ID and must refuse other users.
    • The Requester carries the account's admin, suspended and locked flags. A locked account is refused with M_USER_LOCKED and soft_logout on every request but logging out. RejectSuspended() refuses suspended accounts with M_USER_SUSPENDED on sending, joining, inviting, creating rooms, profile changes and uploads. RequireAdmin() guards AdminEndpoints, which serve the spec's whois, suspend and lock and a subset of Synapse's admin API at its paths.
    • Requests through the local admin socket need no access token: AdminSocket marks the socket's connections, and they act as an admin without an account. File permissions decide who may open the socket. ManagementEndpoints answer only there, for uniform-chat-server manage: the status with the counters and the server's files, and the settings, read with their sources, applied live and saved by the server. They take known options that are not secret, with valid values; elsewhere they answer as unknown.
    • Access tokens are stored as SHA-256 hashes, so a leaked database does not leak sessions.
    • Edit this page
    In this article
    Back to top Uniform Chat