# Throttle Rates

# Preamble

This guide will explain how to configure custom throttle rates for custom rate limits. Psono comes preconfigured with reasonable defaults that are chosen to be produce the least friction and false positive blocks, yet sometimes you may run into an Error 429 and may want to customize these rates.

TIP

Rates are "global" (if you use a central cache) or per process (controlled by the environment variable UWSGI_PROCESSES and defaults to 10)

# Rate Limit Settings

The values below are the server defaults. Add the settings you want to change to settings.yaml and restart the server. Each setting can also be overridden with an environment variable by prefixing its name with PSONO_. General anonymous or user rate limits also apply to requests with a scoped rate limit.

# Access without credentials

All access without credentials is controlled by this rate limit. This rate limit works on a 'per IP' basis.

THROTTLE_RATE_ANON: '14400/day'

Restart the server afterward

# Avatar management

Requests to list, upload, or delete a user's avatar are controlled by this rate limit. This rate limit works on a 'per user' basis.

THROTTLE_RATE_AVATAR: '10/minute'

Restart the server afterward

# Avatar images

Requests to retrieve avatar images are controlled by this rate limit. This rate limit works on a 'per IP' basis.

THROTTLE_RATE_AVATAR_IMAGE: '100/day'

Restart the server afterward

# Pre-login

Requests to retrieve a user's password hashing parameters before login are controlled by this rate limit. This rate limit works on a 'per IP' basis.

THROTTLE_RATE_PRE_LOGIN: '48/day'

Restart the server afterward

# SSO login initiation

Requests to initiate a SAML or OpenID Connect login are controlled by this rate limit. This rate limit works on a 'per IP' basis. If this setting is not specified, it falls back to THROTTLE_RATE_LOGIN, whose default is 48/day.

THROTTLE_RATE_INITIATELOGIN: '48/day'

Restart the server afterward

# Login

All login requests are throttled by scope. This rate limit works on a 'per IP' basis.

THROTTLE_RATE_LOGIN: '48/day'

Restart the server afterward

# API key login

Requests to log in with an API key are controlled by this rate limit. This rate limit works on a 'per IP' basis.

THROTTLE_RATE_API_KEY_LOGIN: '60/hour'

Restart the server afterward

# API key management

Requests to list, create, update, or delete API keys are controlled by this rate limit. This rate limit works on a 'per user' basis.

THROTTLE_RATE_API_KEY: '300/minute'

Restart the server afterward

# API key secret assignments

Requests to list, add, or remove secrets assigned to an API key are controlled by this rate limit. This rate limit works on a 'per user' basis.

THROTTLE_RATE_API_KEY_SECRET: '300/minute'

Restart the server afterward

# API key inspection

Requests to inspect an API key's permissions and available secrets are controlled by this rate limit. This rate limit works on a 'per IP' basis.

THROTTLE_RATE_API_KEY_ACCESS_INSPECT: '300/minute'

Restart the server afterward

# Secret access with an API key

Requests to read or update secrets directly with an API key are controlled by this rate limit. This rate limit works on a 'per IP' basis.

THROTTLE_RATE_API_KEY_ACCESS_SECRET: '600/minute'

Restart the server afterward

All requests to access a link share are controlled by this rate limit. This rate limit works on a 'per IP' basis.

THROTTLE_RATE_LINK_SHARE_SECRET: '60/hour'

Restart the server afterward

# Emergency Code and Recovery Code Access

All requests to use emergency codes and recovery codes is controlled by this rate limit. This rate limit works on a 'per IP' basis.

THROTTLE_RATE_PASSWORD: '24/day'

Restart the server afterward

# All authenticated requests

All authenticated requests use this rate limit in addition to any scoped rate limit. This rate limit works on a 'per user' basis.

THROTTLE_RATE_USER: '86400/day'

Restart the server afterward

# Health checks

All requests to the /healthcheck/ endpoint are controlled by this rate limit. This rate limit works on a 'per IP' basis.

THROTTLE_RATE_HEALTH_CHECK: '61/hour'

Restart the server afterward

# Server information

Requests to the /info/ endpoint are controlled by this rate limit. This rate limit works on a 'per IP' basis.

THROTTLE_RATE_INFO: '600/hour'

Restart the server afterward

# All user status checks

All clients periodically ask the server for updates like new shares and so on. The client is calling the /user/status/ endpoint and this config controls the rate limit for this endpoint and session key checks. This rate limit works on a 'per user' basis.

THROTTLE_RATE_STATUS_CHECK: '61/minute'

Restart the server afterward

# Google Authenticator

Whenever a user uses a google authenticator as second factor then this config will control the allowed rate limit. This rate limit works on a 'per user' basis.

THROTTLE_RATE_GA_VERIFY: '6/minute'

Restart the server afterward

# DUO

Whenever a user uses DUO as second factor then this config will control the allowed rate limit. This rate limit works on a 'per user' basis.

THROTTLE_RATE_DUO_VERIFY: '6/minute'

Restart the server afterward

# WebAuthn

Whenever a user uses WebAuthn as a second factor, this setting controls the allowed rate limit. This rate limit works on a 'per user' basis.

THROTTLE_RATE_WEBAUTHN_VERIFY: '6/minute'

Restart the server afterward

# Yubikey

Whenever a user uses a Yubikey as second factor then this config will control the allowed rate limit. This rate limit works on a 'per user' basis.

THROTTLE_RATE_YUBIKEY_OTP_VERIFY: '6/minute'

Restart the server afterward

# Registration

Whenever a user registers then this config will control the allowed rate limit. This rate limit works on a 'per IP' basis.

THROTTLE_RATE_REGISTRATION: '20/day'

Restart the server afterward

# User deletion

Whenever a user wants to delete his account he needs to provide his password. This rate limit will protect against bruteforce attacks. This rate limit works on a 'per user' basis.

THROTTLE_RATE_USER_DELETE: '20/day'

Restart the server afterward

# User update

Whenever a user wants to update his password or email address he needs to provide his (old) password. This rate limit will protect against bruteforce attacks. This rate limit works on a 'per user' basis.

THROTTLE_RATE_USER_UPDATE: '20/day'

Restart the server afterward

# Fileserver Alive

The fileserver is periodically announcing it being alive and this setting controls how often a single ip can call the appropriate endpoint. This rate limit works on a 'per ip' basis.

THROTTLE_RATE_FILESERVER_ALIVE: '61/minute'

Restart the server afterward

# Gateway Alive

Gateways periodically announce that they are alive. This setting controls how often the endpoint can be called on a 'per gateway' basis.

THROTTLE_RATE_GATEWAY_ALIVE: '61/minute'

Restart the server afterward

# Gateway clusters

Requests to list the gateway clusters available to a user are controlled by this rate limit. This rate limit works on a 'per user' basis.

THROTTLE_RATE_GATEWAY_CLUSTERS: '600/minute'

Restart the server afterward

# Gateway launch

Requests to create a gateway launch are controlled by this rate limit. This rate limit works on a 'per user' basis.

THROTTLE_RATE_GATEWAY_LAUNCH: '600/minute'

Restart the server afterward

# Gateway launch trade

Requests from a gateway to exchange a launch code for connection data are controlled by this rate limit. This rate limit works on a 'per gateway' basis.

THROTTLE_RATE_GATEWAY_LAUNCH_TRADE: '600/minute'

Restart the server afterward

# Gateway launch status

Requests from a gateway to check whether launches are still authorized are controlled by this rate limit. This rate limit works on a 'per gateway' basis.

THROTTLE_RATE_GATEWAY_LAUNCH_STATUS: '600/minute'

Restart the server afterward

# Fileserver Upload

Whenever a user is uploading something to the fileserver, the fileserver will relay the request to the server. This rate limit controls how often such a request can be handled. This rate limit works on a 'per fileserver' basis.

THROTTLE_RATE_FILESERVER_UPLOAD: '10000/minute'

Restart the server afterward

# Fileserver Download

Whenever a user is downloading something from the fileserver, the fileserver will relay the request to the server. This rate limit controls how often such a request can be handled. This rate limit works on a 'per fileserver' basis.

THROTTLE_RATE_RATE_FILESERVER_DOWNLOAD: '10000/minute'

Restart the server afterward

# Device code tokens

Requests to retrieve a session token after device-code approval are controlled by this rate limit. This rate limit works on a 'per IP' basis.

THROTTLE_RATE_DEVICE_CODE_TOKEN: '500/day'

Restart the server afterward