<?php

declare(strict_types=1);

namespace OCA\Mitgliederverwaltung\AppInfo;

use OCA\Mitgliederverwaltung\Middleware\AuthorizationMiddleware;
use OCA\Mitgliederverwaltung\Middleware\RateLimitMiddleware;
use OCA\Mitgliederverwaltung\Middleware\SecurityHeadersMiddleware;
use OCP\AppFramework\App;
use OCP\AppFramework\Bootstrap\IBootContext;
use OCP\AppFramework\Bootstrap\IBootstrap;
use OCP\AppFramework\Bootstrap\IRegistrationContext;

class Application extends App implements IBootstrap {
    public const APP_ID = 'mitgliederverwaltung';

    public function __construct() {
        parent::__construct(self::APP_ID);
    }

    public function register(IRegistrationContext $context): void {
        $context->registerMiddleware(AuthorizationMiddleware::class);
        $context->registerMiddleware(RateLimitMiddleware::class);
        $context->registerMiddleware(SecurityHeadersMiddleware::class);
    }

    public function boot(IBootContext $context): void {
    }
}
