Skip to content

Commit fee013a

Browse files
committed
feat: deprecate OIDC and Service certificates in the admin
Remove both from the admin menu and mark the entities, controllers, repositories and supporting classes @deprecated. The entities and their tables stay, so existing rows survive and remain reachable by URL; every page of the two now carries a warning saying so.
1 parent b9e46d0 commit fee013a

14 files changed

Lines changed: 159 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
- [#98](https://github.com/itk-dev/devops_itksites/pull/98)
11+
Deprecate OIDC and Service certificates
12+
- Remove both from the admin menu
13+
- Mark the entities, controllers, repositories and supporting classes
14+
`@deprecated`
15+
- Keep the entities and their tables, so existing rows survive and stay
16+
reachable by URL
17+
- Warn on every page of the two, since a direct link is now the only way in
1018
- [#96](https://github.com/itk-dev/devops_itksites/pull/96)
1119
Show the Service Agreements monthly price as Danish kroner,
1220
`12.500,50 kr.`, on index and detail

src/Controller/Admin/DashboardController.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ public function configureMenuItems(): iterable
5656
yield MenuItem::linkTo(InstallationCrudController::class, 'Installations', 'fas fa-folder');
5757
yield MenuItem::linkTo(SiteCrudController::class, 'Sites', 'fas fa-bookmark');
5858
yield MenuItem::linkTo(DomainCrudController::class, 'Domains', 'fas fa-link');
59-
yield MenuItem::linkTo(OIDCCrudController::class, 'OIDC', 'fas fa-key');
60-
yield MenuItem::linkTo(ServiceCertificateCrudController::class, 'Service certificates', 'fas fa-lock');
59+
// OIDC and Service certificates are deprecated. The controllers and
60+
// entities are kept so existing rows stay reachable by URL, but the
61+
// menu no longer invites new registrations.
6162
yield MenuItem::linkTo(SecurityContractCrudController::class, 'Service Agreements', 'fas fa-file-contract');
6263
yield MenuItem::section('Dependencies');
6364
yield MenuItem::linkTo(PackageCrudController::class, 'Packages', 'fas fa-cube');

src/Controller/Admin/OIDCCrudController.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use App\Entity\OIDC;
88
use App\Repository\SiteRepository;
9+
use App\Trait\DeprecatedCrudControllerTrait;
910
use EasyCorp\Bundle\EasyAdminBundle\Config\Crud;
1011
use EasyCorp\Bundle\EasyAdminBundle\Field\ChoiceField;
1112
use EasyCorp\Bundle\EasyAdminBundle\Field\DateField;
@@ -14,8 +15,14 @@
1415
use EasyCorp\Bundle\EasyAdminBundle\Field\UrlField;
1516
use Symfony\Component\Translation\TranslatableMessage;
1617

18+
/**
19+
* @deprecated Removed from the admin menu. Kept so existing OIDC rows stay
20+
* reachable by URL until the entity itself goes away.
21+
*/
1722
class OIDCCrudController extends AbstractFullCrudController
1823
{
24+
use DeprecatedCrudControllerTrait;
25+
1926
public function __construct(
2027
private readonly SiteRepository $siteRepository)
2128
{
@@ -26,6 +33,12 @@ public static function getEntityFqcn(): string
2633
return OIDC::class;
2734
}
2835

36+
#[\Override]
37+
protected function getDeprecationNotice(): string
38+
{
39+
return 'OIDC registrations are deprecated and no longer maintained here. This page is only reachable by direct link, so that existing entries stay readable. Do not add new ones.';
40+
}
41+
2942
#[\Override]
3043
public function configureFields(string $pageName): iterable
3144
{

src/Controller/Admin/ServiceCertificateCrudController.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use App\Entity\ServiceCertificate;
88
use App\Form\Type\ServiceCertificate\ServiceType;
99
use App\Repository\SiteRepository;
10+
use App\Trait\DeprecatedCrudControllerTrait;
1011
use EasyCorp\Bundle\EasyAdminBundle\Config\Crud;
1112
use EasyCorp\Bundle\EasyAdminBundle\Field\ChoiceField;
1213
use EasyCorp\Bundle\EasyAdminBundle\Field\CollectionField;
@@ -16,8 +17,14 @@
1617
use EasyCorp\Bundle\EasyAdminBundle\Field\UrlField;
1718
use Symfony\Component\Translation\TranslatableMessage;
1819

20+
/**
21+
* @deprecated Removed from the admin menu. Kept so existing service certificate
22+
* rows stay reachable by URL until the entity itself goes away.
23+
*/
1924
class ServiceCertificateCrudController extends AbstractFullCrudController
2025
{
26+
use DeprecatedCrudControllerTrait;
27+
2128
public function __construct(
2229
private readonly SiteRepository $siteRepository,
2330
) {
@@ -28,6 +35,12 @@ public static function getEntityFqcn(): string
2835
return ServiceCertificate::class;
2936
}
3037

38+
#[\Override]
39+
protected function getDeprecationNotice(): string
40+
{
41+
return 'Service certificates are deprecated and no longer maintained here. This page is only reachable by direct link, so that existing entries stay readable. Do not add new ones.';
42+
}
43+
3144
#[\Override]
3245
public function configureCrud(Crud $crud): Crud
3346
{

src/Entity/OIDC.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
use Symfony\Component\Serializer\Attribute\SerializedName;
1212
use Symfony\Component\Validator\Constraints as Assert;
1313

14+
/**
15+
* @deprecated OIDC registrations are no longer maintained here. The entity is
16+
* kept so the table and its rows survive; do not add new usages.
17+
*/
1418
#[ORM\Entity(repositoryClass: OIDCRepository::class)]
1519
class OIDC extends AbstractBaseEntity
1620
{

src/Entity/ServiceCertificate.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
use Symfony\Component\Serializer\Attribute\Groups;
1414
use Symfony\Component\Validator\Constraints as Assert;
1515

16+
/**
17+
* @deprecated Service certificates are no longer maintained here. The entity is
18+
* kept so the table and its rows survive; do not add new usages.
19+
*/
1620
#[ORM\Entity(repositoryClass: ServiceCertificateRepository::class)]
1721
class ServiceCertificate extends AbstractBaseEntity implements \Stringable
1822
{

src/Entity/ServiceCertificate/Service.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
use Symfony\Component\Serializer\Attribute\Groups;
1212
use Symfony\Component\Validator\Constraints as Assert;
1313

14+
/**
15+
* @deprecated Together with {@see ServiceCertificate}. The entity is
16+
* kept so the table and its rows survive; do not add new usages.
17+
*/
1418
#[ORM\Entity(repositoryClass: ServiceRepository::class)]
1519
#[ORM\Table(name: 'service_certificate_service')]
1620
class Service extends AbstractBaseEntity implements \Stringable

src/EventListener/OIDCChangedListener.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
use Doctrine\ORM\Event\PreFlushEventArgs;
1111
use Doctrine\ORM\Events;
1212

13+
/**
14+
* @deprecated together with {@see OIDC}
15+
*/
1316
#[AsEntityListener(event: Events::preFlush, method: 'preFlush', entity: OIDC::class)]
1417
class OIDCChangedListener
1518
{

src/Form/Type/ServiceCertificate/ServiceType.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
use Symfony\Component\OptionsResolver\OptionsResolver;
1414
use Symfony\Component\Translation\TranslatableMessage;
1515

16+
/**
17+
* @deprecated together with {@see \App\Entity\ServiceCertificate}
18+
*/
1619
class ServiceType extends AbstractType
1720
{
1821
public function __construct(private readonly ServiceRepository $serviceRepository)

src/Repository/OIDCRepository.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
* @method OIDC|null findOneBy(array $criteria, array $orderBy = null)
1616
* @method OIDC[] findAll()
1717
* @method OIDC[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
18+
*
19+
* @deprecated together with {@see OIDC}
1820
*/
1921
class OIDCRepository extends ServiceEntityRepository
2022
{

0 commit comments

Comments
 (0)