Settings
The settings are shown by xTIPP under Konfiguration → Erweiterungen, in the settings of the plugin.
| Setting | Key | Default | Meaning |
|---|---|---|---|
| Anfragen pro Minute | rate_limit | 60 | Maximum number of requests per minute and API key (1 to 10000). More requests answer 429. |
| API-Zugriff erlauben für | allowed_users | Alle Benutzer (all) | Who may create keys, call the API and open Swagger UI. See Access to the API. |
| Nur HTTPS erlauben | require_https | on | Requests 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 roleAdmin. - Nur ausgewählte Mitglieder (Rolle "API-Benutzer") (
role): only the users with the roleAPI-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_PROXIESin the.envof xTIPP, for exampleTRUSTED_PROXIES=172.17.0.1or a list like172.17.0.1,10.0.0.0/8. ThenX-Forwarded-Protoof this proxy counts, for the API as well as for the redirect of xTIPP to thehttpsaddress. -
Or pass
HTTPSto 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.
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.