Refactor authentication handling and permission checks in self-serve routes

This commit is contained in:
Jeppe Bundgaard
2026-06-29 14:53:58 +02:00
parent 6cc4f2759d
commit 02b6df5e3b
4 changed files with 95 additions and 45 deletions
@@ -12,6 +12,10 @@ it('wires self-serve machine types, eligibility, summaries, and machine-start we
expect($vehicleConditionsRoute)->toContain('/department/selfserve/vehicle/allowed');
expect($vehicleConditionsRoute)->toContain('/department/selfserve/washes/summary');
expect($vehicleConditionsRoute)->toContain('synchronizeSession');
expect($vehicleConditionsRoute)->toContain("definePermission('list_own_department_selfserve_vehicle_conditions', subusers_permission_node_key::SELFSERVE_LIST)");
expect($vehicleConditionsRoute)->toContain("definePermission('add_own_department_selfserve_vehicle_conditions', subusers_permission_node_key::SELFSERVE_ADD)");
expect($vehicleConditionsRoute)->toContain('getAuthenticatedSelfServePrincipal');
expect($vehicleConditionsRoute)->toContain('resolveEffectiveCustomerNumber()');
expect($webhookRoute)->not->toBeFalse();
expect($webhookRoute)->toContain('/relay/button/press/post');
@@ -189,6 +193,7 @@ it('wires machine relay status get and set endpoints', function (): void {
expect($moduleSelfServeRoute)->not->toBeFalse();
expect($relayController)->not->toBeFalse();
expect($moduleSelfServeRoute)->toContain("definePermission(self::CUSTOMER_SELFSERVE_PERMISSION, subusers_permission_node_key::SELFSERVE_LIST)");
expect($moduleSelfServeRoute)->toContain('/modules/self-serve/lane/relay/machine/status');
expect($moduleSelfServeRoute)->toContain('/modules/self-serve/lane/relay/machine/set');
expect($moduleSelfServeRoute)->toContain('/modules/self-serve/lane/relay/machine_program_picker/status');