feat: add instance config endpoint

This commit is contained in:
Maël Gangloff
2024-08-04 15:49:38 +02:00
parent e413bfedc0
commit 7cf2375952
13 changed files with 115 additions and 23 deletions

48
src/Entity/Instance.php Normal file
View File

@@ -0,0 +1,48 @@
<?php
namespace App\Entity;
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Get;
use App\Controller\InstanceController;
#[ApiResource(
operations: [
new Get(
uriTemplate: '/config',
controller: InstanceController::class,
shortName: 'Configuration',
read: false,
),
]
)]
class Instance
{
private ?bool $oauthEnabled = null;
private ?bool $limitedFeatures = null;
public function isSsoLogin(): ?bool
{
return $this->oauthEnabled;
}
public function setOauthEnabled(bool $oauthEnabled): static
{
$this->oauthEnabled = $oauthEnabled;
return $this;
}
public function isLimitedFeatures(): ?bool
{
return $this->limitedFeatures;
}
public function setLimitedFeatures(bool $limitedFeatures): static
{
$this->limitedFeatures = $limitedFeatures;
return $this;
}
}