6#ifndef CSRFPROTECTION_H
7#define CSRFPROTECTION_H
9#include <Cutelyst/Plugin>
10#include <Cutelyst/cutelyst_global.h>
15class CSRFProtectionPrivate;
271 void setDefaultDetachTo(
const QString &actionNameOrPath);
277 void setFormFieldName(
const QByteArray &fieldName);
283 void setErrorMsgStashKey(
const QString &keyName);
290 void setIgnoredNamespaces(
const QStringList &namespaces);
299 void setUseSessions(
bool useSessions);
317 void setCookieHttpOnly(
bool httpOnly);
324 void setCookieName(
const QByteArray &cookieName);
330 void setHeaderName(
const QByteArray &headerName);
338 void setGenericErrorMessage(
const QString &message);
345 void setGenericErrorContentType(
const QByteArray &type);
350 static QByteArray getToken(
Context *c);
363 static QString getTokenFormField(
Context *c);
372 static bool checkPassed(
Context *c);
378 const std::unique_ptr<CSRFProtectionPrivate> d_ptr;
The Cutelyst Application.
Protect input forms against Cross Site Request Forgery (CSRF/XSRF) attacks.
~CSRFProtection() override
The Cutelyst namespace holds all public Cutelyst API.