Skip to main content

Settings

The settings are shown by xTIPP under Konfiguration → Erweiterungen, in the settings of the plugin.

SettingKeyDefaultMeaning
Anfragen pro Minuterate_limit60Maximum number of requests per minute and API key (1 to 10000). More requests answer 429.
API-Zugriff erlauben fürallowed_usersAlle Benutzer (all)Who may create keys, call the API and open Swagger UI. See Access to the API.
Nur HTTPS erlaubenrequire_httpsonRequests over plain HTTP answer 403 before the API key is processed. See HTTPS only.

Access to the API​

The setting allowed_users decides who may use the API:

  • Alle Benutzer (all, default): every active user.
  • Nur Administratoren (admins): only users with the role Admin.
  • Nur ausgewählte Mitglieder (Rolle "API-Benutzer") (role): only the users with the role API-Benutzer. Administrators need the role, too. The role is created when the plugin is activated. Assign it in the user management of the admin area (edit a user, roles).

Users without access:

  • do not see API-Schlüssel in the profile menu,
  • cannot create or regenerate a key,
  • cannot open Swagger UI (404).

An existing key of such a user is not deleted. It answers 401 as long as the user has no access, and works again as soon as access is allowed (setting changed or role assigned). The user can still open /api-schluessel by its address to revoke or delete the key.

HTTPS only​

With require_https on (recommended), a request over plain HTTP answers 403 and its key is not processed, so API keys are never accepted in clear text. A client that already sent its key over HTTP should regenerate it.

Behind a reverse proxy​

If a reverse proxy or load balancer terminates TLS, PHP only sees HTTP. Either:

  • Trust the proxy (xTIPP 1.0.36 and newer): add its address to TRUSTED_PROXIES in the .env of xTIPP, for example TRUSTED_PROXIES=172.17.0.1 or a list like 172.17.0.1,10.0.0.0/8. Then X-Forwarded-Proto of this proxy counts, for the API as well as for the redirect of xTIPP to the https address.

  • Or pass HTTPS to PHP in the web server:

    fastcgi_param HTTPS on;
    SetEnvIf X-Forwarded-Proto https HTTPS=on

Without either, X-Forwarded-Proto is ignored and every API call answers 403.

danger

Only list the real proxies in TRUSTED_PROXIES. With * and a site that can also be reached without the proxy, a client can send X-Forwarded-Proto: https over plain HTTP and pass the HTTPS check.

Disable require_https only if your setup cannot do either of the above.