use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\Attribute\FrontpageRoute;
-use OCP\AppFramework\Http\Attribute\OpenAPI;
use OCP\AppFramework\Http\JSONResponse;
use OCP\IRequest;
-#[OpenAPI(scope: OpenAPI::SCOPE_IGNORE)]
class CSRFTokenController extends Controller {
public function __construct(
string $appName,
}
/**
+ * Returns a new CSRF token.
+ *
* @NoAdminRequired
* @NoCSRFRequired
* @PublicPage
+ *
+ * @return JSONResponse<Http::STATUS_OK, array{token: string}, array{}>|JSONResponse<Http::STATUS_FORBIDDEN, array<empty>, array{}>
+ *
+ * 200: CSRF token returned
+ * 403: Strict cookie check failed
*/
#[FrontpageRoute(verb: 'GET', url: '/csrftoken')]
public function index(): JSONResponse {
}
}
},
+ "/index.php/csrftoken": {
+ "get": {
+ "operationId": "csrf_token-index",
+ "summary": "Returns a new CSRF token.",
+ "tags": [
+ "csrf_token"
+ ],
+ "security": [
+ {},
+ {
+ "bearer_auth": []
+ },
+ {
+ "basic_auth": []
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "CSRF token returned",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "token"
+ ],
+ "properties": {
+ "token": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Strict cookie check failed",
+ "content": {
+ "application/json": {
+ "schema": {}
+ }
+ }
+ }
+ }
+ }
+ },
"/index.php/login/v2/poll": {
"post": {
"operationId": "client_flow_login_v2-poll",
}
}
},
+ "/index.php/csrftoken": {
+ "get": {
+ "operationId": "csrf_token-index",
+ "summary": "Returns a new CSRF token.",
+ "tags": [
+ "csrf_token"
+ ],
+ "security": [
+ {},
+ {
+ "bearer_auth": []
+ },
+ {
+ "basic_auth": []
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "CSRF token returned",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "token"
+ ],
+ "properties": {
+ "token": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Strict cookie check failed",
+ "content": {
+ "application/json": {
+ "schema": {}
+ }
+ }
+ }
+ }
+ }
+ },
"/index.php/login/v2/poll": {
"post": {
"operationId": "client_flow_login_v2-poll",