Skip to content

2 fa#782

Merged
salimkanoun merged 28 commits intoGaelO2-devfrom
2FA
Apr 10, 2026
Merged

2 fa#782
salimkanoun merged 28 commits intoGaelO2-devfrom
2FA

Conversation

@salimkanoun
Copy link
Copy Markdown
Collaborator

No description provided.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 23, 2026

badge

Code Coverage Summary

Filename                                                                                                          Stmts    Miss  Cover    Missing
--------------------------------------------------------------------------------------------------------------  -------  ------  -------  -------------------------------------------------------------------------------------------------------------------
Console/Commands/CreateUser.php                                                                                      23       0  100.00%
Console/Commands/DeleteAssociatedFiles.php                                                                           13      11  15.38%   47-65
Console/Commands/DeleteOrthancSeries.php                                                                             25      21  16.00%   54-83
Console/Commands/DeleteStudy.php                                                                                     61       2  96.72%   122-123
Console/Commands/DeleteVisitsOlderThan.php                                                                           58       5  91.38%   67, 81-82, 117-118
Console/Commands/GaelODeleteRessourcesRepository.php                                                                 44       4  90.91%   67-68, 115, 138
Console/Kernel.php                                                                                                    6       4  33.33%   29-32, 49
Exceptions/Handler.php                                                                                               11       4  63.64%   42-43, 77, 92
GaelO/Adapters/DatabaseDumperAdapter.php                                                                             30      30  0.00%    18-63
GaelO/Adapters/FileCacheAdapter.php                                                                                   5       0  100.00%
GaelO/Adapters/FrameworkAdapter.php                                                                                  34       7  79.41%   51-60, 114
GaelO/Adapters/HttpClientAdapter.php                                                                                108      94  12.96%   34-48, 51, 63, 73, 84-236
GaelO/Adapters/JobAdapter.php                                                                                         1       1  0.00%    12
GaelO/Adapters/MailerAdapter.php                                                                                     95      17  82.11%   99-100, 102-103, 105-106, 114-115, 138-139, 159-160, 165-166, 168-169, 174
GaelO/Adapters/MimeAdapter.php                                                                                        6       0  100.00%
GaelO/Adapters/PdfAdapter.php                                                                                         2       0  100.00%
GaelO/Adapters/PhoneNumberAdapter.php                                                                                 2       0  100.00%
GaelO/Adapters/SpreadsheetAdapter.php                                                                                49       0  100.00%
GaelO/Adapters/ValidatorAdapter.php                                                                                  49       2  95.92%   63, 67
GaelO/Adapters/ZipStreamAdapter.php                                                                                  13       4  69.23%   24-27
GaelO/Constants/Constants.php                                                                                         0       0  0.00%
GaelO/Constants/Enums/AnonProfileEnum.php                                                                             0       0  0.00%
GaelO/Constants/Enums/GenderEnum.php                                                                                  0       0  0.00%
GaelO/Constants/Enums/InclusionStatusEnum.php                                                                         0       0  0.00%
GaelO/Constants/Enums/InvestigatorFormStateEnum.php                                                                   0       0  0.00%
GaelO/Constants/Enums/JobEnum.php                                                                                     0       0  0.00%
GaelO/Constants/Enums/ModalityEnum.php                                                                                0       0  0.00%
GaelO/Constants/Enums/QualityControlStateEnum.php                                                                     0       0  0.00%
GaelO/Constants/Enums/ReviewStatusEnum.php                                                                            0       0  0.00%
GaelO/Constants/Enums/RoleEnum.php                                                                                    0       0  0.00%
GaelO/Constants/Enums/UploadStatusEnum.php                                                                            0       0  0.00%
GaelO/Constants/Enums/VisitStatusDoneEnum.php                                                                         0       0  0.00%
GaelO/Constants/MailConstants.php                                                                                     0       0  0.00%
GaelO/Constants/SettingsConstants.php                                                                                 0       0  0.00%
GaelO/DicomUtils.php                                                                                                 21      21  0.00%    13-58
GaelO/Entities/CenterEntity.php                                                                                       5       0  100.00%
GaelO/Entities/CountryEntity.php                                                                                      5       0  100.00%
GaelO/Entities/DicomSeriesEntity.php                                                                                 19       0  100.00%
GaelO/Entities/DicomStudyEntity.php                                                                                  30       0  100.00%
GaelO/Entities/DocumentationEntity.php                                                                               12       0  100.00%
GaelO/Entities/NotificationEntity.php                                                                                 7       0  100.00%
GaelO/Entities/PatientEntity.php                                                                                     29       0  100.00%
GaelO/Entities/ReviewEntity.php                                                                                      13       0  100.00%
GaelO/Entities/RoleEntity.php                                                                                         6       0  100.00%
GaelO/Entities/StudyEntity.php                                                                                       17       0  100.00%
GaelO/Entities/TrackerEntity.php                                                                                     21       0  100.00%
GaelO/Entities/UserEntity.php                                                                                        36       0  100.00%
GaelO/Entities/VisitEntity.php                                                                                       44       0  100.00%
GaelO/Entities/VisitGroupEntity.php                                                                                   7       0  100.00%
GaelO/Entities/VisitTypeEntity.php                                                                                   15       0  100.00%
GaelO/Exceptions/AbstractGaelOException.php                                                                           6       0  100.00%
GaelO/Exceptions/GaelOBadRequestException.php                                                                         1       0  100.00%
GaelO/Exceptions/GaelOConflictException.php                                                                           1       0  100.00%
GaelO/Exceptions/GaelOException.php                                                                                   1       0  100.00%
GaelO/Exceptions/GaelOForbiddenException.php                                                                          1       0  100.00%
GaelO/Exceptions/GaelONotFoundException.php                                                                           1       0  100.00%
GaelO/Exceptions/GaelOUnauthorizedException.php                                                                       1       0  100.00%
GaelO/Repositories/CenterRepository.php                                                                              24       0  100.00%
GaelO/Repositories/CountryRepository.php                                                                              4       0  100.00%
GaelO/Repositories/DicomSeriesRepository.php                                                                         43       0  100.00%
GaelO/Repositories/DicomStudyRepository.php                                                                          64       0  100.00%
GaelO/Repositories/DocumentationRepository.php                                                                       37       0  100.00%
GaelO/Repositories/PatientRepository.php                                                                             55       1  98.18%   97
GaelO/Repositories/ReviewRepository.php                                                                              87       1  98.85%   69
GaelO/Repositories/ReviewStatusRepository.php                                                                        20       0  100.00%
GaelO/Repositories/StudyRepository.php                                                                               57       0  100.00%
GaelO/Repositories/TrackerRepository.php                                                                             26       0  100.00%
GaelO/Repositories/UserRepository.php                                                                               180       1  99.44%   346
GaelO/Repositories/VisitGroupRepository.php                                                                          13       0  100.00%
GaelO/Repositories/VisitRepository.php                                                                              295       4  98.64%   68, 155, 217, 285
GaelO/Repositories/VisitTypeRepository.php                                                                           33       0  100.00%
GaelO/Services/AuthorizationService/AuthorizationPatientService.php                                                  19       2  89.47%   72-73
GaelO/Services/AuthorizationService/AuthorizationReviewService.php                                                   16       1  93.75%   60
GaelO/Services/AuthorizationService/AuthorizationStudyService.php                                                    12       0  100.00%
GaelO/Services/AuthorizationService/AuthorizationUserService.php                                                     12       0  100.00%
GaelO/Services/AuthorizationService/AuthorizationVisitService.php                                                    25       0  100.00%
GaelO/Services/CreateVisitService.php                                                                                25       0  100.00%
GaelO/Services/DicomService.php                                                                                      24       0  100.00%
GaelO/Services/ExportStudyService.php                                                                               156      30  80.77%   75, 115-116, 137, 161-170, 174-175, 185-186, 202, 258-260, 270-282, 305-306
GaelO/Services/FileCacheService.php                                                                                  19       6  68.42%   21, 49-59, 84, 91
GaelO/Services/FormService/FormService.php                                                                           50       7  86.00%   95-97, 101, 107, 131, 143
GaelO/Services/FormService/InvestigatorFormService.php                                                               20       0  100.00%
GaelO/Services/FormService/ReviewFormService.php                                                                     49       6  87.76%   43, 62, 101, 108-110
GaelO/Services/GaelOProcessingService/AzureService.php                                                               43      43  0.00%    26-127
GaelO/Services/GaelOProcessingService/AzureTokenService.php                                                          19      19  0.00%    25-53
GaelO/Services/GaelOProcessingService/GaelOProcessingService.php                                                    111     111  0.00%    21-254
GaelO/Services/GaelOStudiesService/AbstractGaelOStudy.php                                                           149      51  65.77%   71, 80, 86, 94-126, 203-237
GaelO/Services/GaelOStudiesService/AbstractVisitDecisions.php                                                        15       5  66.67%   43-73, 91
GaelO/Services/GaelOStudiesService/AbstractVisitRules.php                                                            63      13  79.37%   55-64, 120-121, 141-142, 166-167, 181
GaelO/Services/GaelOStudiesService/AssociatedFiles/AssociatedFile.php                                                 3       0  100.00%
GaelO/Services/GaelOStudiesService/DefaultCreatableVisitCalculator.php                                               15       2  86.67%   26, 32
GaelO/Services/GaelOStudiesService/DefaultGaelOStudy.php                                                              1       0  100.00%
GaelO/Services/GaelOStudiesService/Events/BaseStudyEvent.php                                                          2       0  100.00%
GaelO/Services/GaelOStudiesService/Events/BaseVisitEvent.php                                                         11       1  90.91%   49
GaelO/Services/GaelOStudiesService/Events/CorrectiveActionEvent.php                                                   5       0  100.00%
GaelO/Services/GaelOStudiesService/Events/GaelOStudyEventEnum.php                                                     0       0  0.00%
GaelO/Services/GaelOStudiesService/Events/QCModifiedEvent.php                                                        15       0  100.00%
GaelO/Services/GaelOStudiesService/Events/VisitConcludedEvent.php                                                     5       0  100.00%
GaelO/Services/GaelOStudiesService/ExpectedPatient/ExpectedPatient.php                                                3       0  100.00%
GaelO/Services/GaelOWsiProcessingService/GaelOWsiProcessingService.php                                               68      68  0.00%    17-142
GaelO/Services/ImportPatientService.php                                                                              65       5  92.31%   47, 76-77, 157, 174
GaelO/Services/MailService/MailListBuilder.php                                                                       27       0  100.00%
GaelO/Services/MailServices.php                                                                                     422      95  77.49%   77, 177-193, 224-242, 355-368, 528-541, 621-671
GaelO/Services/OrthancService.php                                                                                   260     141  45.77%   42-44, 53-260, 410, 414, 427-580
GaelO/Services/PdfServices.php                                                                                       11       0  100.00%
GaelO/Services/SpecificStudiesRules/TEST/TEST.php                                                                    11       2  81.82%   79-80
GaelO/Services/SpecificStudiesRules/TEST/TEST_FDG_PET0.php                                                           68       1  98.53%   106
GaelO/Services/SpecificStudiesRules/TEST/TEST_FDG_PET0_DECISION.php                                                  14       0  100.00%
GaelO/Services/SpecificStudiesRules/TEST/TEST_WB_CT0.php                                                             18      10  44.44%   14-19, 34-39, 49-54
GaelO/Services/StoreObjects/Export/ExportDataResults.php                                                              2       0  100.00%
GaelO/Services/StoreObjects/Export/ExportDicomResults.php                                                            11       2  81.82%   29-31
GaelO/Services/StoreObjects/Export/ExportFile.php                                                                     4       0  100.00%
GaelO/Services/StoreObjects/Export/ExportPatientResults.php                                                           9       1  88.89%   24
GaelO/Services/StoreObjects/Export/ExportReviewData.php                                                              25      25  0.00%    20-63
GaelO/Services/StoreObjects/Export/ExportReviewDataCollection.php                                                    12       9  25.00%   19-42
GaelO/Services/StoreObjects/Export/ExportReviewResults.php                                                            9       3  66.67%   24-27
GaelO/Services/StoreObjects/Export/ExportRoleChangesResults.php                                                       9       1  88.89%   24
GaelO/Services/StoreObjects/Export/ExportStudyResults.php                                                            57      10  82.46%   57, 66-96, 136, 166
GaelO/Services/StoreObjects/Export/ExportTrackerResults.php                                                           9       1  88.89%   26
GaelO/Services/StoreObjects/Export/ExportUserResults.php                                                              9       1  88.89%   24
GaelO/Services/StoreObjects/Export/ExportVisitsResults.php                                                            9       3  66.67%   21-24
GaelO/Services/StoreObjects/OrthancMetaData.php                                                                      71      71  0.00%    24-266
GaelO/Services/StoreObjects/OrthancSeries.php                                                                        47      28  40.43%   59-114
GaelO/Services/StoreObjects/TagAnon.php                                                                               3       0  100.00%
GaelO/Services/TreeService/AbstractTreeService.php                                                                   32       0  100.00%
GaelO/Services/TreeService/ControllerTreeService.php                                                                  5       0  100.00%
GaelO/Services/TreeService/InvestigatorTreeService.php                                                               10       0  100.00%
GaelO/Services/TreeService/MonitorTreeService.php                                                                     4       0  100.00%
GaelO/Services/TreeService/ReviewerTreeService.php                                                                   15       1  93.33%   34
GaelO/Services/VisitService.php                                                                                      86      17  80.23%   74, 85-111, 176, 186, 206
GaelO/UseCases/AddAffiliatedCenter/AddAffiliatedCenter.php                                                           27       2  92.59%   61-62
GaelO/UseCases/AddAffiliatedCenter/AddAffiliatedCenterRequest.php                                                     0       0  0.00%
GaelO/UseCases/AddAffiliatedCenter/AddAffiliatedCenterResponse.php                                                    0       0  0.00%
GaelO/UseCases/CreateCenter/CreateCenter.php                                                                         30       2  93.33%   65-66
GaelO/UseCases/CreateCenter/CreateCenterRequest.php                                                                   0       0  0.00%
GaelO/UseCases/CreateCenter/CreateCenterResponse.php                                                                  0       0  0.00%
GaelO/UseCases/CreateDocumentation/CreateDocumentation.php                                                           51       4  92.16%   42, 48, 88-89
GaelO/UseCases/CreateDocumentation/CreateDocumentationRequest.php                                                     0       0  0.00%
GaelO/UseCases/CreateDocumentation/CreateDocumentationResponse.php                                                    0       0  0.00%
GaelO/UseCases/CreateDocumentationFile/CreateDocumentationFile.php                                                   36       4  88.89%   44, 75-76, 85
GaelO/UseCases/CreateDocumentationFile/CreateDocumentationFileRequest.php                                             0       0  0.00%
GaelO/UseCases/CreateDocumentationFile/CreateDocumentationFileResponse.php                                            0       0  0.00%
GaelO/UseCases/CreateFileToForm/CreateFileToForm.php                                                                 55       7  87.27%   66, 80, 108-109, 123-125
GaelO/UseCases/CreateFileToForm/CreateFileToFormRequest.php                                                           0       0  0.00%
GaelO/UseCases/CreateFileToForm/CreateFileToFormResponse.php                                                          0       0  0.00%
GaelO/UseCases/CreateFileToVisit/CreateFileToVisit.php                                                               51       7  86.27%   53, 57, 67-70, 99-100
GaelO/UseCases/CreateFileToVisit/CreateFileToVisitRequest.php                                                         0       0  0.00%
GaelO/UseCases/CreateFileToVisit/CreateFileToVisitResponse.php                                                        0       0  0.00%
GaelO/UseCases/CreateInvestigatorForm/CreateInvestigatorForm.php                                                     43       3  93.02%   43, 76-77
GaelO/UseCases/CreateInvestigatorForm/CreateInvestigatorFormRequest.php                                               0       0  0.00%
GaelO/UseCases/CreateInvestigatorForm/CreateInvestigatorFormResponse.php                                              0       0  0.00%
GaelO/UseCases/CreateMagicLink/CreateMagicLink.php                                                                   37       2  94.59%   80-81
GaelO/UseCases/CreateMagicLink/CreateMagicLinkRequest.php                                                             0       0  0.00%
GaelO/UseCases/CreateMagicLink/CreateMagicLinkResponse.php                                                            0       0  0.00%
GaelO/UseCases/CreatePatientTags/CreatePatientTags.php                                                               50       2  96.00%   92-93
GaelO/UseCases/CreatePatientTags/CreatePatientTagsRequest.php                                                         0       0  0.00%
GaelO/UseCases/CreatePatientTags/CreatePatientTagsResponse.php                                                        0       0  0.00%
GaelO/UseCases/CreateReviewForm/CreateReviewForm.php                                                                 49       2  95.92%   95-96
GaelO/UseCases/CreateReviewForm/CreateReviewFormRequest.php                                                           0       0  0.00%
GaelO/UseCases/CreateReviewForm/CreateReviewFormResponse.php                                                          0       0  0.00%
GaelO/UseCases/CreateStudy/CreateStudy.php                                                                           48       7  85.42%   55, 63, 67, 71, 75, 95-96
GaelO/UseCases/CreateStudy/CreateStudyRequest.php                                                                     0       0  0.00%
GaelO/UseCases/CreateStudy/CreateStudyResponse.php                                                                    0       0  0.00%
GaelO/UseCases/CreateUser/CreateUser.php                                                                             60       0  100.00%
GaelO/UseCases/CreateUser/CreateUserRequest.php                                                                       0       0  0.00%
GaelO/UseCases/CreateUser/CreateUserResponse.php                                                                      0       0  0.00%
GaelO/UseCases/CreateUserRoles/CreateUserRoles.php                                                                   33       0  100.00%
GaelO/UseCases/CreateUserRoles/CreateUserRolesRequest.php                                                             0       0  0.00%
GaelO/UseCases/CreateUserRoles/CreateUserRolesResponse.php                                                            0       0  0.00%
GaelO/UseCases/CreateVisit/CreateVisit.php                                                                           91       4  95.60%   74, 153-154, 164
GaelO/UseCases/CreateVisit/CreateVisitRequest.php                                                                     0       0  0.00%
GaelO/UseCases/CreateVisit/CreateVisitResponse.php                                                                    0       0  0.00%
GaelO/UseCases/CreateVisitGroup/CreateVisitGroup.php                                                                 33       2  93.94%   76-77
GaelO/UseCases/CreateVisitGroup/CreateVisitGroupRequest.php                                                           0       0  0.00%
GaelO/UseCases/CreateVisitGroup/CreateVisitGroupResponse.php                                                          0       0  0.00%
GaelO/UseCases/CreateVisitType/CreateVisitType.php                                                                   41       4  90.24%   49, 62, 86-87
GaelO/UseCases/CreateVisitType/CreateVisitTypeRequest.php                                                             0       0  0.00%
GaelO/UseCases/CreateVisitType/CreateVisitTypeResponse.php                                                            0       0  0.00%
GaelO/UseCases/DeleteAffiliatedCenter/DeleteAffiliatedCenter.php                                                     22       0  100.00%
GaelO/UseCases/DeleteAffiliatedCenter/DeleteAffiliatedCenterRequest.php                                               0       0  0.00%
GaelO/UseCases/DeleteAffiliatedCenter/DeleteAffiliatedCenterResponse.php                                              0       0  0.00%
GaelO/UseCases/DeleteCenter/DeleteCenter.php                                                                         26       2  92.31%   61-62
GaelO/UseCases/DeleteCenter/DeleteCenterRequest.php                                                                   0       0  0.00%
GaelO/UseCases/DeleteCenter/DeleteCenterResponse.php                                                                  0       0  0.00%
GaelO/UseCases/DeleteDocumentation/DeleteDocumentation.php                                                           34       2  94.12%   63-64
GaelO/UseCases/DeleteDocumentation/DeleteDocumentationRequest.php                                                     0       0  0.00%
GaelO/UseCases/DeleteDocumentation/DeleteDocumentationResponse.php                                                    0       0  0.00%
GaelO/UseCases/DeleteFileOfForm/DeleteFileOfForm.php                                                                 51       6  88.24%   67, 94-95, 111-113
GaelO/UseCases/DeleteFileOfForm/DeleteFileOfFormRequest.php                                                           0       0  0.00%
GaelO/UseCases/DeleteFileOfForm/DeleteFileOfFormResponse.php                                                          0       0  0.00%
GaelO/UseCases/DeleteFileOfVisit/DeleteFileOfVisit.php                                                               41       4  90.24%   41, 49, 75-76
GaelO/UseCases/DeleteFileOfVisit/DeleteFileOfVisitRequest.php                                                         0       0  0.00%
GaelO/UseCases/DeleteFileOfVisit/DeleteFileOfVisitResponse.php                                                        0       0  0.00%
GaelO/UseCases/DeleteInvestigatorForm/DeleteInvestigatorForm.php                                                     59       2  96.61%   109-110
GaelO/UseCases/DeleteInvestigatorForm/DeleteInvestigatorFormRequest.php                                               0       0  0.00%
GaelO/UseCases/DeleteInvestigatorForm/DeleteInvestigatorFormResponse.php                                              0       0  0.00%
GaelO/UseCases/DeletePatientTags/DeletePatientTags.php                                                               48       2  95.83%   84-85
GaelO/UseCases/DeletePatientTags/DeletePatientTagsRequest.php                                                         0       0  0.00%
GaelO/UseCases/DeletePatientTags/DeletePatientTagsResponse.php                                                        0       0  0.00%
GaelO/UseCases/DeleteReviewForm/DeleteReviewForm.php                                                                 65       3  95.38%   118-119, 126
GaelO/UseCases/DeleteReviewForm/DeleteReviewFormRequest.php                                                           0       0  0.00%
GaelO/UseCases/DeleteReviewForm/DeleteReviewFormResponse.php                                                          0       0  0.00%
GaelO/UseCases/DeleteSeries/DeleteSeries.php                                                                         57       3  94.74%   102-103, 112
GaelO/UseCases/DeleteSeries/DeleteSeriesRequest.php                                                                   0       0  0.00%
GaelO/UseCases/DeleteSeries/DeleteSeriesResponse.php                                                                  0       0  0.00%
GaelO/UseCases/DeleteStudy/DeleteStudy.php                                                                           23       3  86.96%   52-53, 61
GaelO/UseCases/DeleteStudy/DeleteStudyRequest.php                                                                     0       0  0.00%
GaelO/UseCases/DeleteStudy/DeleteStudyResponse.php                                                                    0       0  0.00%
GaelO/UseCases/DeleteUser/DeleteUser.php                                                                             27       0  100.00%
GaelO/UseCases/DeleteUser/DeleteUserRequest.php                                                                       0       0  0.00%
GaelO/UseCases/DeleteUser/DeleteUserResponse.php                                                                      0       0  0.00%
GaelO/UseCases/DeleteUserNotifications/DeleteUserNotifications.php                                                   15       7  53.33%   33-38, 45
GaelO/UseCases/DeleteUserNotifications/DeleteUserNotificationsRequest.php                                             0       0  0.00%
GaelO/UseCases/DeleteUserNotifications/DeleteUserNotificationsResponse.php                                            0       0  0.00%
GaelO/UseCases/DeleteUserRole/DeleteUserRole.php                                                                     27       2  92.59%   56-57
GaelO/UseCases/DeleteUserRole/DeleteUserRoleRequest.php                                                               0       0  0.00%
GaelO/UseCases/DeleteUserRole/DeleteUserRoleResponse.php                                                              0       0  0.00%
GaelO/UseCases/DeleteVisit/DeleteVisit.php                                                                           56       4  92.86%   86-87, 98, 103
GaelO/UseCases/DeleteVisit/DeleteVisitRequest.php                                                                     0       0  0.00%
GaelO/UseCases/DeleteVisit/DeleteVisitResponse.php                                                                    0       0  0.00%
GaelO/UseCases/DeleteVisitGroup/DeleteVisitGroup.php                                                                 25       2  92.00%   56-57
GaelO/UseCases/DeleteVisitGroup/DeleteVisitGroupRequest.php                                                           0       0  0.00%
GaelO/UseCases/DeleteVisitGroup/DeleteVisitGroupResponse.php                                                          0       0  0.00%
GaelO/UseCases/DeleteVisitType/DeleteVisitType.php                                                                   24       2  91.67%   58-59
GaelO/UseCases/DeleteVisitType/DeleteVisitTypeRequest.php                                                             0       0  0.00%
GaelO/UseCases/DeleteVisitType/DeleteVisitTypeResponse.php                                                            0       0  0.00%
GaelO/UseCases/ExportDatabase/ExportDatabase.php                                                                     26       4  84.62%   38-39, 63-64
GaelO/UseCases/ExportDatabase/ExportDatabaseRequest.php                                                               0       0  0.00%
GaelO/UseCases/ExportDatabase/ExportDatabaseResponse.php                                                              0       0  0.00%
GaelO/UseCases/ExportStudyData/ExportStudyData.php                                                                   23       2  91.30%   51-52
GaelO/UseCases/ExportStudyData/ExportStudyDataRequest.php                                                             0       0  0.00%
GaelO/UseCases/ExportStudyData/ExportStudyDataResponse.php                                                            0       0  0.00%
GaelO/UseCases/ExportStudyFiles/ExportStudyFiles.php                                                                 18       7  61.11%   41-45, 55-60
GaelO/UseCases/ExportStudyFiles/ExportStudyFilesRequest.php                                                           0       0  0.00%
GaelO/UseCases/ExportStudyFiles/ExportStudyFilesResponse.php                                                          0       0  0.00%
GaelO/UseCases/FindUser/FindUser.php                                                                                 19       0  100.00%
GaelO/UseCases/FindUser/FindUserRequest.php                                                                           0       0  0.00%
GaelO/UseCases/FindUser/FindUserResponse.php                                                                          0       0  0.00%
GaelO/UseCases/ForgotPassword/ForgotPassword.php                                                                     28       1  96.43%   58
GaelO/UseCases/ForgotPassword/ForgotPasswordRequest.php                                                               0       0  0.00%
GaelO/UseCases/ForgotPassword/ForgotPasswordResponse.php                                                              0       0  0.00%
GaelO/UseCases/GetAdminTracker/GetAdminTracker.php                                                                   23       5  78.26%   39-41, 51-52
GaelO/UseCases/GetAdminTracker/GetAdminTrackerRequest.php                                                             0       0  0.00%
GaelO/UseCases/GetAdminTracker/GetAdminTrackerResponse.php                                                            0       0  0.00%
GaelO/UseCases/GetAffiliatedCenter/GetAffiliatedCenter.php                                                           19       2  89.47%   43-44
GaelO/UseCases/GetAffiliatedCenter/GetAffiliatedCenterRequest.php                                                     0       0  0.00%
GaelO/UseCases/GetAffiliatedCenter/GetAffiliatedCenterResponse.php                                                    0       0  0.00%
GaelO/UseCases/GetAssociatedDataForInvestigator/GetAssociatedDataForInvestigator.php                                 27       7  74.07%   45-50, 62
GaelO/UseCases/GetAssociatedDataForInvestigator/GetAssociatedDataForInvestigatorRequest.php                           0       0  0.00%
GaelO/UseCases/GetAssociatedDataForInvestigator/GetAssociatedDataForInvestigatorResponse.php                          0       0  0.00%
GaelO/UseCases/GetAssociatedDataForReview/GetAssociatedDataForReview.php                                             26       2  92.31%   52-53
GaelO/UseCases/GetAssociatedDataForReview/GetAssociatedDataForReviewRequest.php                                       0       0  0.00%
GaelO/UseCases/GetAssociatedDataForReview/GetAssociatedDataForReviewResponse.php                                      0       0  0.00%
GaelO/UseCases/GetAssociatedFilesForInvestigator/GetAssociatedFilesForInvestigator.php                               27       7  74.07%   45-50, 62
GaelO/UseCases/GetAssociatedFilesForInvestigator/GetAssociatedFilesForInvestigatorRequest.php                         0       0  0.00%
GaelO/UseCases/GetAssociatedFilesForInvestigator/GetAssociatedFilesForInvestigatorResponse.php                        0       0  0.00%
GaelO/UseCases/GetAssociatedFilesForReview/GetAssociatedFilesForReview.php                                           26       2  92.31%   52-53
GaelO/UseCases/GetAssociatedFilesForReview/GetAssociatedFilesForReviewRequest.php                                     0       0  0.00%
GaelO/UseCases/GetAssociatedFilesForReview/GetAssociatedFilesForReviewResponse.php                                    0       0  0.00%
GaelO/UseCases/GetCenter/GetCenter.php                                                                               27       2  92.59%   52-53
GaelO/UseCases/GetCenter/GetCenterRequest.php                                                                         0       0  0.00%
GaelO/UseCases/GetCenter/GetCenterResponse.php                                                                        0       0  0.00%
GaelO/UseCases/GetCentersFromStudy/GetCentersFromStudy.php                                                           27       2  92.59%   64-65
GaelO/UseCases/GetCentersFromStudy/GetCentersFromStudyRequest.php                                                     0       0  0.00%
GaelO/UseCases/GetCentersFromStudy/GetCentersFromStudyResponse.php                                                    0       0  0.00%
GaelO/UseCases/GetCountry/GetCountry.php                                                                             23       2  91.30%   49-50
GaelO/UseCases/GetCountry/GetCountryRequest.php                                                                       0       0  0.00%
GaelO/UseCases/GetCountry/GetCountryResponse.php                                                                      0       0  0.00%
GaelO/UseCases/GetCreatablePatients/GetCreatablePatients.php                                                         30       9  70.00%   47, 52-57, 64, 69
GaelO/UseCases/GetCreatablePatients/GetCreatablePatientsRequest.php                                                   0       0  0.00%
GaelO/UseCases/GetCreatablePatients/GetCreatablePatientsResponse.php                                                  0       0  0.00%
GaelO/UseCases/GetCreatableVisits/GetCreatableVisits.php                                                             29       2  93.10%   57-58
GaelO/UseCases/GetCreatableVisits/GetCreatableVisitsRequest.php                                                       0       0  0.00%
GaelO/UseCases/GetCreatableVisits/GetCreatableVisitsResponse.php                                                      0       0  0.00%
GaelO/UseCases/GetDicomSeriesMetadata/GetDicomSeriesMetadata.php                                                     28       2  92.86%   56-57
GaelO/UseCases/GetDicomSeriesMetadata/GetDicomSeriesMetadataRequest.php                                               0       0  0.00%
GaelO/UseCases/GetDicomSeriesMetadata/GetDicomSeriesMetadataResponse.php                                              0       0  0.00%
GaelO/UseCases/GetDicomSeriesPreview/GetDicomSeriesPreview.php                                                       34       8  76.47%   55-61, 73
GaelO/UseCases/GetDicomSeriesPreview/GetDicomSeriesPreviewRequest.php                                                 0       0  0.00%
GaelO/UseCases/GetDicomSeriesPreview/GetDicomSeriesPreviewResponse.php                                                0       0  0.00%
GaelO/UseCases/GetDicomSeriesTmtvReport/GetDicomSeriesTmtvReport.php                                                 37       2  94.59%   67-68
GaelO/UseCases/GetDicomSeriesTmtvReport/GetDicomSeriesTmtvReportRequest.php                                           0       0  0.00%
GaelO/UseCases/GetDicomSeriesTmtvReport/GetDicomSeriesTmtvReportResponse.php                                          0       0  0.00%
GaelO/UseCases/GetDicomStudyMetadata/GetDicomStudyMetadata.php                                                       28       2  92.86%   54-55
GaelO/UseCases/GetDicomStudyMetadata/GetDicomStudyMetadataRequest.php                                                 0       0  0.00%
GaelO/UseCases/GetDicomStudyMetadata/GetDicomStudyMetadataResponse.php                                                0       0  0.00%
GaelO/UseCases/GetDicoms/GetDicoms.php                                                                               36       2  94.44%   71-72
GaelO/UseCases/GetDicoms/GetDicomsRequest.php                                                                         0       0  0.00%
GaelO/UseCases/GetDicoms/GetDicomsResponse.php                                                                        0       0  0.00%
GaelO/UseCases/GetDicomsFileSupervisor/GetDicomsFileSupervisor.php                                                   37       5  86.49%   48, 97-98, 107-113
GaelO/UseCases/GetDicomsFileSupervisor/GetDicomsFileSupervisorRequest.php                                             0       0  0.00%
GaelO/UseCases/GetDicomsFileSupervisor/GetDicomsFileSupervisorResponse.php                                            0       0  0.00%
GaelO/UseCases/GetDicomsStudiesFromStudy/GetDicomsStudiesFromStudy.php                                               39       3  92.31%   69, 86-87
GaelO/UseCases/GetDicomsStudiesFromStudy/GetDicomsStudiesFromStudyRequest.php                                         0       0  0.00%
GaelO/UseCases/GetDicomsStudiesFromStudy/GetDicomsStudiesFromStudyResponse.php                                        0       0  0.00%
GaelO/UseCases/GetDocumentation/GetDocumentation.php                                                                 26       2  92.31%   54-55
GaelO/UseCases/GetDocumentation/GetDocumentationRequest.php                                                           0       0  0.00%
GaelO/UseCases/GetDocumentation/GetDocumentationResponse.php                                                          0       0  0.00%
GaelO/UseCases/GetDocumentationFile/GetDocumentationFile.php                                                         22       2  90.91%   47-48
GaelO/UseCases/GetDocumentationFile/GetDocumentationFileRequest.php                                                   0       0  0.00%
GaelO/UseCases/GetDocumentationFile/GetDocumentationFileResponse.php                                                  0       0  0.00%
GaelO/UseCases/GetFileOfForm/GetFileOfForm.php                                                                       24       2  91.67%   48-50
GaelO/UseCases/GetFileOfForm/GetFileOfFormRequest.php                                                                 0       0  0.00%
GaelO/UseCases/GetFileOfForm/GetFileOfFormResponse.php                                                                0       0  0.00%
GaelO/UseCases/GetFileOfVisit/GetFileOfVisit.php                                                                     25       3  88.00%   37, 48-49
GaelO/UseCases/GetFileOfVisit/GetFileOfVisitRequest.php                                                               0       0  0.00%
GaelO/UseCases/GetFileOfVisit/GetFileOfVisitResponse.php                                                              0       0  0.00%
GaelO/UseCases/GetFilesMetadataFromVisitType/GetFilesMetadataFromVisitType.php                                       27       4  85.19%   39, 47, 57-58
GaelO/UseCases/GetFilesMetadataFromVisitType/GetFilesMetadataFromVisitTypeRequest.php                                 0       0  0.00%
GaelO/UseCases/GetFilesMetadataFromVisitType/GetFilesMetadataFromVisitTypeResponse.php                                0       0  0.00%
GaelO/UseCases/GetInvestigatorForm/GetInvestigatorForm.php                                                           20       7  65.00%   39-45, 57
GaelO/UseCases/GetInvestigatorForm/GetInvestigatorFormRequest.php                                                     0       0  0.00%
GaelO/UseCases/GetInvestigatorForm/GetInvestigatorFormResponse.php                                                    0       0  0.00%
GaelO/UseCases/GetInvestigatorFormsFromVisitType/GetInvestigatorFormsFromVisitType.php                               34       3  91.18%   49, 78-79
GaelO/UseCases/GetInvestigatorFormsFromVisitType/GetInvestigatorFormsFromVisitTypeRequest.php                         0       0  0.00%
GaelO/UseCases/GetInvestigatorFormsFromVisitType/GetInvestigatorFormsFromVisitTypeResponse.php                        0       0  0.00%
GaelO/UseCases/GetInvestigatorFormsMetadataFromVisitType/GetInvestigatorFormsMetadataFromVisitType.php               27       4  85.19%   39, 48, 58-59
GaelO/UseCases/GetInvestigatorFormsMetadataFromVisitType/GetInvestigatorFormsMetadataFromVisitTypeRequest.php         0       0  0.00%
GaelO/UseCases/GetInvestigatorFormsMetadataFromVisitType/GetInvestigatorFormsMetadataFromVisitTypeResponse.php        0       0  0.00%
GaelO/UseCases/GetKnownOrthancID/GetKnownOrthancID.php                                                               19       2  89.47%   43-44
GaelO/UseCases/GetKnownOrthancID/GetKnownOrthancIDRequest.php                                                         0       0  0.00%
GaelO/UseCases/GetKnownOrthancID/GetKnownOrthancIDResponse.php                                                        0       0  0.00%
GaelO/UseCases/GetNiftiFileSupervisor/GetNiftiFileSupervisor.php                                                     37       3  91.89%   86-87, 102
GaelO/UseCases/GetNiftiFileSupervisor/GetNiftiFileSupervisorRequest.php                                               0       0  0.00%
GaelO/UseCases/GetNiftiFileSupervisor/GetNiftiFileSupervisorResponse.php                                              0       0  0.00%
GaelO/UseCases/GetPatient/GetPatient.php                                                                             25       0  100.00%
GaelO/UseCases/GetPatient/GetPatientRequest.php                                                                       0       0  0.00%
GaelO/UseCases/GetPatient/GetPatientResponse.php                                                                      0       0  0.00%
GaelO/UseCases/GetPatientFromStudy/GetPatientFromStudy.php                                                           27       7  74.07%   57-62, 71
GaelO/UseCases/GetPatientFromStudy/GetPatientFromStudyRequest.php                                                     0       0  0.00%
GaelO/UseCases/GetPatientFromStudy/GetPatientFromStudyResponse.php                                                    0       0  0.00%
GaelO/UseCases/GetPatientVisit/GetPatientVisit.php                                                                   30       2  93.33%   58-60
GaelO/UseCases/GetPatientVisit/GetPatientVisitRequest.php                                                             0       0  0.00%
GaelO/UseCases/GetPatientVisit/GetPatientVisitResponse.php                                                            0       0  0.00%
GaelO/UseCases/GetPatientsInStudyFromCenters/GetPatientsInStudyFromCenters.php                                       27       2  92.59%   63-64
GaelO/UseCases/GetPatientsInStudyFromCenters/GetPatientsInStudyFromCentersRequest.php                                 0       0  0.00%
GaelO/UseCases/GetPatientsInStudyFromCenters/GetPatientsInStudyFromCentersResponse.php                                0       0  0.00%
GaelO/UseCases/GetPatientsVisitsInStudy/GetPatientsVisitsInStudy.php                                                 34       6  82.35%   49, 53-55, 70-71
GaelO/UseCases/GetPatientsVisitsInStudy/GetPatientsVisitsInStudyRequest.php                                           0       0  0.00%
GaelO/UseCases/GetPatientsVisitsInStudy/GetPatientsVisitsInStudyResponse.php                                          0       0  0.00%
GaelO/UseCases/GetPossibleUpload/GetPossibleUpload.php                                                               26       7  73.08%   41-45, 56-58
GaelO/UseCases/GetPossibleUpload/GetPossibleUploadRequest.php                                                         0       0  0.00%
GaelO/UseCases/GetPossibleUpload/GetPossibleUploadResponse.php                                                        0       0  0.00%
GaelO/UseCases/GetReadiness/GetReadiness.php                                                                         17       7  58.82%   29, 41-46
GaelO/UseCases/GetReadiness/GetReadinessRequest.php                                                                   0       0  0.00%
GaelO/UseCases/GetReadiness/GetReadinessResponse.php                                                                  0       0  0.00%
GaelO/UseCases/GetReviewForm/GetReviewForm.php                                                                       18       2  88.89%   44-45
GaelO/UseCases/GetReviewForm/GetReviewFormRequest.php                                                                 0       0  0.00%
GaelO/UseCases/GetReviewForm/GetReviewFormResponse.php                                                                0       0  0.00%
GaelO/UseCases/GetReviewFormFromVisit/GetReviewFormFromVisit.php                                                     32       2  93.75%   62-63
GaelO/UseCases/GetReviewFormFromVisit/GetReviewFormFromVisitRequest.php                                               0       0  0.00%
GaelO/UseCases/GetReviewFormFromVisit/GetReviewFormFromVisitResponse.php                                              0       0  0.00%
GaelO/UseCases/GetReviewsFromVisitType/GetReviewsFromVisitType.php                                                   28       2  92.86%   61-62
GaelO/UseCases/GetReviewsFromVisitType/GetReviewsFromVisitTypeRequest.php                                             0       0  0.00%
GaelO/UseCases/GetReviewsFromVisitType/GetReviewsFromVisitTypeResponse.php                                            0       0  0.00%
GaelO/UseCases/GetReviewsMetadataFromVisitType/GetReviewsMetadataFromVisitType.php                                   26       3  88.46%   49, 60-61
GaelO/UseCases/GetReviewsMetadataFromVisitType/GetReviewsMetadataFromVisitTypeRequest.php                             0       0  0.00%
GaelO/UseCases/GetReviewsMetadataFromVisitType/GetReviewsMetadataFromVisitTypeResponse.php                            0       0  0.00%
GaelO/UseCases/GetRolesInStudyFromUser/GetRolesInStudyFromUser.php                                                   15       2  86.67%   39-40
GaelO/UseCases/GetRolesInStudyFromUser/GetRolesInStudyFromUserRequest.php                                             0       0  0.00%
GaelO/UseCases/GetRolesInStudyFromUser/GetRolesInStudyFromUserResponse.php                                            0       0  0.00%
GaelO/UseCases/GetStudies/GetStudies.php                                                                             19       2  89.47%   44-45
GaelO/UseCases/GetStudies/GetStudiesRequest.php                                                                       0       0  0.00%
GaelO/UseCases/GetStudies/GetStudiesResponse.php                                                                      0       0  0.00%
GaelO/UseCases/GetStudiesFromUser/GetStudiesFromUser.php                                                             16       2  87.50%   40-41
GaelO/UseCases/GetStudiesFromUser/GetStudiesFromUserRequest.php                                                       0       0  0.00%
GaelO/UseCases/GetStudiesFromUser/GetStudiesFromUserResponse.php                                                      0       0  0.00%
GaelO/UseCases/GetStudiesWithDetails/GetStudiesWithDetails.php                                                       31       7  77.42%   63-69, 77
GaelO/UseCases/GetStudiesWithDetails/GetStudiesWithDetailsRequest.php                                                 0       0  0.00%
GaelO/UseCases/GetStudiesWithDetails/GetStudiesWithDetailsResponse.php                                                0       0  0.00%
GaelO/UseCases/GetStudyReviewProgression/GetStudyReviewProgression.php                                               55       3  94.55%   78, 108-109
GaelO/UseCases/GetStudyReviewProgression/GetStudyReviewProgressionRequest.php                                         0       0  0.00%
GaelO/UseCases/GetStudyReviewProgression/GetStudyReviewProgressionResponse.php                                        0       0  0.00%
GaelO/UseCases/GetStudyStatistics/GetStudyStatistics.php                                                             23       2  91.30%   45-46
GaelO/UseCases/GetStudyStatistics/GetStudyStatisticsRequest.php                                                       0       0  0.00%
GaelO/UseCases/GetStudyStatistics/GetStudyStatisticsResponse.php                                                      0       0  0.00%
GaelO/UseCases/GetStudyTrackerByVisit/GetStudyTrackerByVisit.php                                                     23       5  78.26%   36-38, 48-49
GaelO/UseCases/GetStudyTrackerByVisit/GetStudyTrackerByVisitRequest.php                                               0       0  0.00%
GaelO/UseCases/GetStudyTrackerByVisit/GetStudyTrackerByVisitResponse.php                                              0       0  0.00%
GaelO/UseCases/GetStudyTrackerMessage/GetStudyTrackerMessage.php                                                     22       5  77.27%   36-38, 48-49
GaelO/UseCases/GetStudyTrackerMessage/GetStudyTrackerMessageRequest.php                                               0       0  0.00%
GaelO/UseCases/GetStudyTrackerMessage/GetStudyTrackerMessageResponse.php                                              0       0  0.00%
GaelO/UseCases/GetStudyTrackerRoleAction/GetStudyTrackerRoleAction.php                                               27       2  92.59%   55-56
GaelO/UseCases/GetStudyTrackerRoleAction/GetStudyTrackerRoleActionRequest.php                                         0       0  0.00%
GaelO/UseCases/GetStudyTrackerRoleAction/GetStudyTrackerRoleActionResponse.php                                        0       0  0.00%
GaelO/UseCases/GetStudyVisitTypes/GetStudyVisitTypes.php                                                             27       2  92.59%   62-63
GaelO/UseCases/GetStudyVisitTypes/GetStudyVisitTypesRequest.php                                                       0       0  0.00%
GaelO/UseCases/GetStudyVisitTypes/GetStudyVisitTypesResponse.php                                                      0       0  0.00%
GaelO/UseCases/GetSystem/GetSystem.php                                                                               23       2  91.30%   48-49
GaelO/UseCases/GetSystem/GetSystemRequest.php                                                                         0       0  0.00%
GaelO/UseCases/GetSystem/GetSystemResponse.php                                                                        0       0  0.00%
GaelO/UseCases/GetUser/GetUser.php                                                                                   28       0  100.00%
GaelO/UseCases/GetUser/GetUserRequest.php                                                                             0       0  0.00%
GaelO/UseCases/GetUser/GetUserResponse.php                                                                            0       0  0.00%
GaelO/UseCases/GetUserCenters/GetUserCenters.php                                                                     24       2  91.67%   48-49
GaelO/UseCases/GetUserCenters/GetUserCentersRequest.php                                                               0       0  0.00%
GaelO/UseCases/GetUserCenters/GetUserCentersResponse.php                                                              0       0  0.00%
GaelO/UseCases/GetUserNotifications/GetUserNotifications.php                                                         19       2  89.47%   45-46
GaelO/UseCases/GetUserNotifications/GetUserNotificationsRequest.php                                                   0       0  0.00%
GaelO/UseCases/GetUserNotifications/GetUserNotificationsResponse.php                                                  0       0  0.00%
GaelO/UseCases/GetUserRoleByName/GetUserRoleByName.php                                                               24       7  70.83%   44-49, 58
GaelO/UseCases/GetUserRoleByName/GetUserRoleByNameRequest.php                                                         0       0  0.00%
GaelO/UseCases/GetUserRoleByName/GetUserRoleByNameResponse.php                                                        0       0  0.00%
GaelO/UseCases/GetUsersFromStudy/GetUsersFromStudy.php                                                               37       3  91.89%   62-63, 78
GaelO/UseCases/GetUsersFromStudy/GetUsersFromStudyRequest.php                                                         0       0  0.00%
GaelO/UseCases/GetUsersFromStudy/GetUsersFromStudyResponse.php                                                        0       0  0.00%
GaelO/UseCases/GetVisit/GetVisit.php                                                                                 37       2  94.59%   68-69
GaelO/UseCases/GetVisit/GetVisitRequest.php                                                                           0       0  0.00%
GaelO/UseCases/GetVisit/GetVisitResponse.php                                                                          0       0  0.00%
GaelO/UseCases/GetVisitGroup/GetVisitGroup.php                                                                       17       2  88.24%   40-41
GaelO/UseCases/GetVisitGroup/GetVisitGroupRequest.php                                                                 0       0  0.00%
GaelO/UseCases/GetVisitGroup/GetVisitGroupResponse.php                                                                0       0  0.00%
GaelO/UseCases/GetVisitType/GetVisitType.php                                                                         17       2  88.24%   40-41
GaelO/UseCases/GetVisitType/GetVisitTypeRequest.php                                                                   0       0  0.00%
GaelO/UseCases/GetVisitType/GetVisitTypeResponse.php                                                                  0       0  0.00%
GaelO/UseCases/GetVisitsFromStudy/GetVisitsFromStudy.php                                                             34       5  85.29%   44-46, 71-73
GaelO/UseCases/GetVisitsFromStudy/GetVisitsFromStudyRequest.php                                                       0       0  0.00%
GaelO/UseCases/GetVisitsFromStudy/GetVisitsFromStudyResponse.php                                                      0       0  0.00%
GaelO/UseCases/GetVisitsTree/GetVisitsTree.php                                                                       24       2  91.67%   52-53
GaelO/UseCases/GetVisitsTree/GetVisitsTreeRequest.php                                                                 0       0  0.00%
GaelO/UseCases/GetVisitsTree/GetVisitsTreeResponse.php                                                                0       0  0.00%
GaelO/UseCases/ImportPatients/ImportPatients.php                                                                     43       3  93.02%   83-84, 96
GaelO/UseCases/ImportPatients/ImportPatientsRequest.php                                                               0       0  0.00%
GaelO/UseCases/ImportPatients/ImportPatientsResponse.php                                                              0       0  0.00%
GaelO/UseCases/Login/Login.php                                                                                       44       0  100.00%
GaelO/UseCases/Login/LoginRequest.php                                                                                 0       0  0.00%
GaelO/UseCases/Login/LoginResponse.php                                                                                0       0  0.00%
GaelO/UseCases/ModifyCenter/ModifyCenter.php                                                                         29       2  93.10%   69-70
GaelO/UseCases/ModifyCenter/ModifyCenterRequest.php                                                                   0       0  0.00%
GaelO/UseCases/ModifyCenter/ModifyCenterResponse.php                                                                  0       0  0.00%
GaelO/UseCases/ModifyCorrectiveAction/ModifyCorrectiveAction.php                                                     68       3  95.59%   58, 109-110
GaelO/UseCases/ModifyCorrectiveAction/ModifyCorrectiveActionRequest.php                                               0       0  0.00%
GaelO/UseCases/ModifyCorrectiveAction/ModifyCorrectiveActionResponse.php                                              0       0  0.00%
GaelO/UseCases/ModifyDocumentation/ModifyDocumentation.php                                                           48       2  95.83%   88-89
GaelO/UseCases/ModifyDocumentation/ModifyDocumentationRequest.php                                                     0       0  0.00%
GaelO/UseCases/ModifyDocumentation/ModifyDocumentationResponse.php                                                    0       0  0.00%
GaelO/UseCases/ModifyInvestigatorForm/ModifyInvestigatorForm.php                                                     50       1  98.00%   41
GaelO/UseCases/ModifyInvestigatorForm/ModifyInvestigatorFormRequest.php                                               0       0  0.00%
GaelO/UseCases/ModifyInvestigatorForm/ModifyInvestigatorFormResponse.php                                              0       0  0.00%
GaelO/UseCases/ModifyPatient/ModifyPatient.php                                                                       69       4  94.20%   62, 76, 127-128
GaelO/UseCases/ModifyPatient/ModifyPatientRequest.php                                                                 0       0  0.00%
GaelO/UseCases/ModifyPatient/ModifyPatientResponse.php                                                                0       0  0.00%
GaelO/UseCases/ModifyQualityControl/ModifyQualityControl.php                                                         67       5  92.54%   50, 65, 69, 110-111
GaelO/UseCases/ModifyQualityControl/ModifyQualityControlRequest.php                                                   0       0  0.00%
GaelO/UseCases/ModifyQualityControl/ModifyQualityControlResponse.php                                                  0       0  0.00%
GaelO/UseCases/ModifyQualityControlReset/ModifyQualityControlReset.php                                               43       2  95.35%   80-81
GaelO/UseCases/ModifyQualityControlReset/ModifyQualityControlResetRequest.php                                         0       0  0.00%
GaelO/UseCases/ModifyQualityControlReset/ModifyQualityControlResetResponse.php                                        0       0  0.00%
GaelO/UseCases/ModifyReviewForm/ModifyReviewForm.php                                                                 46       2  95.65%   84-85
GaelO/UseCases/ModifyReviewForm/ModifyReviewFormRequest.php                                                           0       0  0.00%
GaelO/UseCases/ModifyReviewForm/ModifyReviewFormResponse.php                                                          0       0  0.00%
GaelO/UseCases/ModifyUser/ModifyUser.php                                                                             46       2  95.65%   93-94
GaelO/UseCases/ModifyUser/ModifyUserRequest.php                                                                       0       0  0.00%
GaelO/UseCases/ModifyUser/ModifyUserResponse.php                                                                      0       0  0.00%
GaelO/UseCases/ModifyUserIdentification/ModifyUserIdentification.php                                                 47       2  95.74%   90-91
GaelO/UseCases/ModifyUserIdentification/ModifyUserIdentificationRequest.php                                           0       0  0.00%
GaelO/UseCases/ModifyUserIdentification/ModifyUserIdentificationResponse.php                                          0       0  0.00%
GaelO/UseCases/ModifyUserNotifications/ModifyUserNotifications.php                                                   15       2  86.67%   36-37
GaelO/UseCases/ModifyUserNotifications/ModifyUserNotificationsRequest.php                                             0       0  0.00%
GaelO/UseCases/ModifyUserNotifications/ModifyUserNotificationsResponse.php                                            0       0  0.00%
GaelO/UseCases/ModifyUserOnboarding/ModifyUserOnboarding.php                                                         38       2  94.74%   71-72
GaelO/UseCases/ModifyUserOnboarding/ModifyUserOnboardingRequest.php                                                   0       0  0.00%
GaelO/UseCases/ModifyUserOnboarding/ModifyUserOnboardingResponse.php                                                  0       0  0.00%
GaelO/UseCases/ModifyValidatedDocumentationForRole/ModifyValidatedDocumentationForRole.php                           26       7  73.08%   49-54, 63
GaelO/UseCases/ModifyValidatedDocumentationForRole/ModifyValidatedDocumentationForRoleRequest.php                     0       0  0.00%
GaelO/UseCases/ModifyValidatedDocumentationForRole/ModifyValidatedDocumentationForRoleResponse.php                    0       0  0.00%
GaelO/UseCases/ModifyVisitDate/ModifyVisitDate.php                                                                   45       2  95.56%   80-81
GaelO/UseCases/ModifyVisitDate/ModifyVisitDateRequest.php                                                             0       0  0.00%
GaelO/UseCases/ModifyVisitDate/ModifyVisitDateResponse.php                                                            0       0  0.00%
GaelO/UseCases/ReactivateDicomSeries/ReactivateDicomSeries.php                                                       52       6  88.46%   50, 85-86, 96, 101, 106
GaelO/UseCases/ReactivateDicomSeries/ReactivateDicomSeriesRequest.php                                                 0       0  0.00%
GaelO/UseCases/ReactivateDicomSeries/ReactivateDicomSeriesResponse.php                                                0       0  0.00%
GaelO/UseCases/ReactivateDicomStudy/ReactivateDicomStudy.php                                                         45       3  93.33%   82-83, 92
GaelO/UseCases/ReactivateDicomStudy/ReactivateDicomStudyRequest.php                                                   0       0  0.00%
GaelO/UseCases/ReactivateDicomStudy/ReactivateDicomStudyResponse.php                                                  0       0  0.00%
GaelO/UseCases/ReactivateDocumentation/ReactivateDocumentation.php                                                   33       2  93.94%   63-64
GaelO/UseCases/ReactivateDocumentation/ReactivateDocumentationRequest.php                                             0       0  0.00%
GaelO/UseCases/ReactivateDocumentation/ReactivateDocumentationResponse.php                                            0       0  0.00%
GaelO/UseCases/ReactivateStudy/ReactivateStudy.php                                                                   25       2  92.00%   54-55
GaelO/UseCases/ReactivateStudy/ReactivateStudyRequest.php                                                             0       0  0.00%
GaelO/UseCases/ReactivateStudy/ReactivateStudyResponse.php                                                            0       0  0.00%
GaelO/UseCases/ReactivateUser/ReactivateUser.php                                                                     41       7  82.93%   72-78, 86
GaelO/UseCases/ReactivateUser/ReactivateUserRequest.php                                                               0       0  0.00%
GaelO/UseCases/ReactivateUser/ReactivateUserResponse.php                                                              0       0  0.00%
GaelO/UseCases/ReactivateVisit/ReactivateVisit.php                                                                   44       2  95.45%   82-83
GaelO/UseCases/ReactivateVisit/ReactivateVisitRequest.php                                                             0       0  0.00%
GaelO/UseCases/ReactivateVisit/ReactivateVisitResponse.php                                                            0       0  0.00%
GaelO/UseCases/Request/RequestRequest.php                                                                             0       0  0.00%
GaelO/UseCases/Request/RequestResponse.php                                                                            0       0  0.00%
GaelO/UseCases/Request/SendRequest.php                                                                               15       0  100.00%
GaelO/UseCases/RequestPatientCreation/RequestPatientCreation.php                                                     33       1  96.97%   71
GaelO/UseCases/RequestPatientCreation/RequestPatientCreationRequest.php                                               0       0  0.00%
GaelO/UseCases/RequestPatientCreation/RequestPatientCreationResponse.php                                              0       0  0.00%
GaelO/UseCases/RequestUnlock/RequestUnlock.php                                                                       63       2  96.83%   97-98
GaelO/UseCases/RequestUnlock/RequestUnlockRequest.php                                                                 0       0  0.00%
GaelO/UseCases/RequestUnlock/RequestUnlockResponse.php                                                                0       0  0.00%
GaelO/UseCases/RequestUnlockQC/RequestUnlockQC.php                                                                   55       2  96.36%   91-92
GaelO/UseCases/RequestUnlockQC/RequestUnlockQCRequest.php                                                             0       0  0.00%
GaelO/UseCases/RequestUnlockQC/RequestUnlockQCResponse.php                                                            0       0  0.00%
GaelO/UseCases/SendMail/SendMail.php                                                                                 86       8  90.70%   85-86, 89-91, 135, 144, 152
GaelO/UseCases/SendMail/SendMailRequest.php                                                                           0       0  0.00%
GaelO/UseCases/SendMail/SendMailResponse.php                                                                          0       0  0.00%
GaelO/UseCases/SendReminder/SendReminder.php                                                                         26       6  76.92%   46-49, 58, 67
GaelO/UseCases/SendReminder/SendReminderRequest.php                                                                   0       0  0.00%
GaelO/UseCases/SendReminder/SendReminderResponse.php                                                                  0       0  0.00%
GaelO/UseCases/UnlockInvestigatorForm/UnlockInvestigatorForm.php                                                     61       2  96.72%   108-109
GaelO/UseCases/UnlockInvestigatorForm/UnlockInvestigatorFormRequest.php                                               0       0  0.00%
GaelO/UseCases/UnlockInvestigatorForm/UnlockInvestigatorFormResponse.php                                              0       0  0.00%
GaelO/UseCases/UnlockReviewForm/UnlockReviewForm.php                                                                 63       3  95.24%   113-114, 121
GaelO/UseCases/UnlockReviewForm/UnlockReviewFormRequest.php                                                           0       0  0.00%
GaelO/UseCases/UnlockReviewForm/UnlockReviewFormResponse.php                                                          0       0  0.00%
GaelO/Util.php                                                                                                       64      48  25.00%   35, 54-116, 122, 134-136, 156-170
Http/Controllers/AskUnlockController.php                                                                             10       0  100.00%
Http/Controllers/AuthController.php                                                                                 165      38  76.97%   85, 91, 102-105, 111-113, 133, 139, 149-151, 162-165, 178-180, 200, 232, 236, 242, 256, 260, 264, 287, 292, 307-318
Http/Controllers/CenterController.php                                                                                30       0  100.00%
Http/Controllers/Controller.php                                                                                       4       0  100.00%
Http/Controllers/CountryController.php                                                                                5       0  100.00%
Http/Controllers/DicomController.php                                                                                111      17  84.68%   46-61, 142-144, 166
Http/Controllers/DocumentationController.php                                                                         48       0  100.00%
Http/Controllers/ExportDBController.php                                                                              11       0  100.00%
Http/Controllers/PatientController.php                                                                               49       0  100.00%
Http/Controllers/RequestController.php                                                                                4       0  100.00%
Http/Controllers/ReviewController.php                                                                               141       6  95.74%   253-261
Http/Controllers/StudyController.php                                                                                178       8  95.51%   259, 262-263, 396-401
Http/Controllers/ToolsController.php                                                                                 30       6  80.00%   85-92
Http/Controllers/TrackerController.php                                                                               25       0  100.00%
Http/Controllers/UserController.php                                                                                 184       2  98.91%   124-125
Http/Controllers/VisitController.php                                                                                133      14  89.47%   107-129
Http/Controllers/VisitGroupController.php                                                                            17       0  100.00%
Http/Controllers/VisitTypeController.php                                                                             25       0  100.00%
Http/Kernel.php                                                                                                       0       0  0.00%
Http/Middleware/CheckForMaintenanceMode.php                                                                           0       0  0.00%
Http/Middleware/EncryptCookies.php                                                                                    0       0  0.00%
Http/Middleware/EnsureUserActivated.php                                                                               8       3  62.50%   22, 24, 26
Http/Middleware/EnsureUserOnboarded.php                                                                               4       1  75.00%   25
Http/Middleware/TrimStrings.php                                                                                       0       0  0.00%
Http/Middleware/TrustProxies.php                                                                                      0       0  0.00%
Http/Middleware/VerifyCsrfToken.php                                                                                   0       0  0.00%
Jobs/JobQcReport.php                                                                                                 57      57  0.00%    41-147
Jobs/QcReport/ImageType.php                                                                                           0       0  0.00%
Jobs/QcReport/InstanceReport.php                                                                                     13      13  0.00%    20-36
Jobs/QcReport/SeriesReport.php                                                                                      103     103  0.00%    45-215
Jobs/QcReport/StudyReport.php                                                                                        10      10  0.00%    18-32
Jobs/QcReport/VisitReport.php                                                                                        25      25  0.00%    19-75
Mail/AdminLoged.php                                                                                                   8       0  100.00%
Mail/BlockedAccount.php                                                                                               8       0  100.00%
Mail/ChangePasswordDeactivated.php                                                                                    8       0  100.00%
Mail/Conclusion.php                                                                                                   8       0  100.00%
Mail/CorrectiveAction.php                                                                                             8       0  100.00%
Mail/DeletedForm.php                                                                                                  8       0  100.00%
Mail/ImportPatient.php                                                                                                8       0  100.00%
Mail/MagicLink.php                                                                                                    8       0  100.00%
Mail/MailUser.php                                                                                                    11       0  100.00%
Mail/QCDecision.php                                                                                                   8       0  100.00%
Mail/Reminder.php                                                                                                     8       0  100.00%
Mail/Request.php                                                                                                      8       0  100.00%
Mail/RequestPatientCreation.php                                                                                      12       0  100.00%
Mail/UnlockQcRequest.php                                                                                              8       0  100.00%
Mail/UnlockRequest.php                                                                                                8       0  100.00%
Mail/UnlockedForm.php                                                                                                 8       0  100.00%
Mail/UpdatedRole.php                                                                                                  8       0  100.00%
Mail/UserCreated.php                                                                                                 12       0  100.00%
Models/Center.php                                                                                                     8       1  87.50%   26
Models/CenterUser.php                                                                                                 4       0  100.00%
Models/Country.php                                                                                                    5       0  100.00%
Models/DicomSeries.php                                                                                               22       0  100.00%
Models/DicomStudy.php                                                                                                21       0  100.00%
Models/Documentation.php                                                                                             13       1  92.31%   31
Models/Patient.php                                                                                                   21       0  100.00%
Models/Review.php                                                                                                    14       0  100.00%
Models/ReviewStatus.php                                                                                              12       0  100.00%
Models/Role.php                                                                                                       8       0  100.00%
Models/Study.php                                                                                                     17       2  88.24%   62-67
Models/Tracker.php                                                                                                   13       1  92.31%   37
Models/User.php                                                                                                      24       0  100.00%
Models/Visit.php                                                                                                     41       4  90.24%   83, 98-108
Models/VisitGroup.php                                                                                                 8       0  100.00%
Models/VisitType.php                                                                                                 16       1  93.75%   32
Notifications/AutoImportPatients.php                                                                                  4       0  100.00%
Notifications/BaseGaelONotification.php                                                                               7       4  42.86%   37-40
Notifications/ResetPasswordNotification.php                                                                          20       3  85.00%   69-71
Notifications/VerifyEmailNotification.php                                                                            14       0  100.00%
Providers/AdapterProvider.php                                                                                        31      15  51.61%   69-76, 80-89
Providers/EmailServiceProvider.php                                                                                    5       0  100.00%
Providers/EventServiceProvider.php                                                                                    1       0  100.00%
Providers/FortifyServiceProvider.php                                                                                  4       1  75.00%   16
Providers/RepositoryProvider.php                                                                                     17       0  100.00%
Providers/RouteServiceProvider.php                                                                                   14       0  100.00%
Rules/BooleanType.php                                                                                                 2       0  100.00%
Rules/NumberType.php                                                                                                  2       0  100.00%
Rules/StringType.php                                                                                                  2       0  100.00%
TOTAL                                                                                                             10571    1806  82.92%

Diff against GaelO2

Filename                                             Stmts    Miss  Cover
-------------------------------------------------  -------  ------  --------
GaelO/Entities/UserEntity.php                           +1       0  +100.00%
GaelO/Services/SpecificStudiesRules/TEST/TEST.php        0       0  -0.00%
GaelO/UseCases/Login/Login.php                          +3       0  +100.00%
Http/Controllers/AuthController.php                   +130     +30  -0.17%
Providers/FortifyServiceProvider.php                    +4      +1  +75.00%
TOTAL                                                 +138     +31  -0.07%

Results for commit: df7548a

Minimum allowed coverage is 70%

♻️ This comment has been updated with latest results

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces server-side 2FA support (via Laravel Fortify primitives + custom API endpoints) and updates the authentication flow/tests to require 2FA for administrators and to support TOTP and recovery codes.

Changes:

  • Add 2FA persistence fields to users and enable Fortify’s 2FA feature set.
  • Implement custom API endpoints for 2FA challenge, setup (QR), confirmation, and recovery code generation.
  • Extend/adjust feature tests and user payload expectations to reflect added 2FA data.

Reviewed changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
GaelO2/app/Http/Controllers/AuthController.php Adds custom 2FA login/challenge/setup/recovery endpoints and modifies login response flow.
GaelO2/app/Providers/FortifyServiceProvider.php Adds Fortify integration hooks and runtime config overrides.
GaelO2/config/fortify.php New Fortify configuration enabling 2FA and setting guard/middleware/limiters.
GaelO2/routes/api.php Exposes new 2FA-related routes.
GaelO2/database/migrations/2025_03_17_200000_add_two_factor_columns_to_users_table.php Adds 2FA secret, recovery codes, and confirmation timestamp columns.
GaelO2/app/Models/User.php Enables Fortify’s TwoFactorAuthenticatable on the User model.
GaelO2/app/GaelO/UseCases/Login/Login.php Detects enabled 2FA at login time and returns userId + 2FA requirement info.
GaelO2/app/GaelO/UseCases/Login/LoginResponse.php Adds use2FA and userId to login response DTO.
GaelO2/app/GaelO/Entities/UserEntity.php Adds twoFactorConfirmedAt mapping from DB response.
GaelO2/tests/Feature/TestUser/LoginTest.php Adds/updates tests for admin 2FA requirement, challenge flow, and recovery code usage.
GaelO2/tests/Feature/TestUser/UserTest.php Updates expected user payload field count.
GaelO2/config/app.php Registers the app’s FortifyServiceProvider.
GaelO2/composer.json / GaelO2/composer.lock Adds Fortify and refreshes dependency lockfile.
.github/workflows/publish.yml Updates publishing workflow branch trigger.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread GaelO2/app/Http/Controllers/AuthController.php Outdated
Comment thread GaelO2/app/Http/Controllers/AuthController.php Outdated
Comment thread GaelO2/routes/api.php Outdated


//Route 2FA
Route::post('/two-factor-challenge', [AuthController::class, 'twoFactorChallenge']);
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/two-factor-challenge is currently defined outside the existing throttle:public-apis group (and without any throttle middleware). This endpoint is security-sensitive and should be rate-limited (e.g. add it to the throttle:public-apis group or apply a dedicated throttle:two-factor middleware) to reduce brute-force risk.

Suggested change
Route::post('/two-factor-challenge', [AuthController::class, 'twoFactorChallenge']);
Route::post('/two-factor-challenge', [AuthController::class, 'twoFactorChallenge'])->middleware('throttle:public-apis');

Copilot uses AI. Check for mistakes.
Comment on lines +263 to +272
public function confirm(Request $request)
{
$confirmed = $request->user()->confirmTwoFactorAuth($request->code);

if (!$confirmed) {
return response()->json(['errors' => ['code' => ['Invalid Two Factor Authentication code.']]], 422);
}

return response()->json();
}
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This confirm() action calls $request->user()->confirmTwoFactorAuth(...), but that method doesn’t exist on the User model (no definition found in the codebase) and there’s no route pointing to this controller method. Please remove this dead code (or implement the method + route if it’s intended) to avoid future runtime fatals.

Suggested change
public function confirm(Request $request)
{
$confirmed = $request->user()->confirmTwoFactorAuth($request->code);
if (!$confirmed) {
return response()->json(['errors' => ['code' => ['Invalid Two Factor Authentication code.']]], 422);
}
return response()->json();
}

Copilot uses AI. Check for mistakes.
Comment thread GaelO2/app/Models/User.php
Comment thread GaelO2/app/Providers/FortifyServiceProvider.php
Comment thread GaelO2/app/Providers/FortifyServiceProvider.php Outdated
Comment on lines +69 to +93
// Login doit retourner twoFA=true et challenge_token
$response = $this->json('POST', '/api/login', [
'email' => 'administrator@gaelo.fr',
'password' => 'administrator'
]);

$content = json_decode($response->content(), true);

$this->assertTrue($content['twoFA']);
$this->assertArrayHasKey('challenge_token', $content);

$challengeToken = $content['challenge_token'];

// Mocker TwoFactorAuthenticationProvider
// pour simuler un code TOTP valide sans vrai secret
$this->mock(TwoFactorAuthenticationProvider::class, function ($mock) {
$mock->shouldReceive('verify')->once()->andReturn(true);
});

// Challenge 2FA avec le challenge_token récupéré
$response = $this->json('POST', '/api/two-factor-challenge', [
'challenge_token' => $challengeToken,
'code' => '000000' // pas important car le provider est mocké
]);

Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These 2FA flow tests don’t assert that the login/challenge endpoints were successful before asserting on the JSON body. Adding ->assertSuccessful() (or explicit expected status codes) will make failures clearer and prevent false positives when an endpoint returns an error JSON shape.

Copilot uses AI. Check for mistakes.
Comment thread GaelO2/config/fortify.php Outdated
Comment on lines +18 to +19
'guard' => 'sanctum',

Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fortify.guard is set to sanctum, but this repository’s config/auth.php does not define a sanctum guard (only web and api). Since Fortify expects this to be a valid guard name from auth.guards, either add a sanctum guard definition in auth.php or update this setting to a guard that actually exists to prevent runtime misconfiguration.

Copilot uses AI. Check for mistakes.
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Routing\UrlGenerator;
use Laravel\Fortify\Contracts\TwoFactorAuthenticationProvider;
use Laravel\Fortify\Actions\GenerateNewRecoveryCodes;
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GenerateNewRecoveryCodes is imported but not used in this controller. Please remove the unused import to avoid dead dependencies/confusion about which Fortify code path is used.

Suggested change
use Laravel\Fortify\Actions\GenerateNewRecoveryCodes;

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator Author

@salimkanoun salimkanoun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cf commentaire


return response()->json([
'onboarded' => $loginResponse->onboarded,
'twoFA' => true,
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mettre needs2FA pour harmoniser avec le cas ou c'est administrator

$challengeToken = $request->input('challenge_token');

if (!$challengeToken) {
return response()->json(['message' => 'Session expirée.'], 422);
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

en anglais

$userId = Cache::pull('2fa_challenge_' . $challengeToken);

if (!$userId) {
return response()->json(['message' => 'Session expirée ou déjà utilisée.'], 422);
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

en anglais


if (!$valid) {
return response()->json([
'errors' => ['code' => ['Code invalide.']]
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

en anglais

Comment thread GaelO2/app/Http/Controllers/AuthController.php Outdated
* Must be in the auth:sanctum group but NOT in the onboarded group
* (admin may not be onboarded yet when setting up 2FA).
*/
public function getSetup2FA(Request $request, TwoFactorAuthenticationProvider $provider): JsonResponse
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pourquoi get ? setup2FA non ?
Si on crée c'est un POST pas un get

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ou alors getSetup2FAQrCode

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je mettrai plutot en post pour l'API et le nom de cette fonction setup2FA

Comment thread GaelO2/app/Http/Controllers/AuthController.php
Comment thread GaelO2/routes/api.php Outdated

//Route initialization 2FA
Route::middleware(['auth:sanctum', 'verified', 'activated'])->group(function () {
Route::get('user/two-factor-setup', [AuthController::class, 'getSetup2FA']);
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

POST plutot

$this->assertEquals('Bearer', $content['token_type']);
}

public function testLoginAdministratorWith2FARecoveryCode()
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

et tu devrait ajouter un test qui fail si tu donne pas le bon recovery code, pour check que le code securise bien la validité du recovery code

@Xeno-linux Xeno-linux self-requested a review March 24, 2026 15:51
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 16 changed files in this pull request and generated 10 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/publish.yml
Comment on lines +151 to +199
public function setup2FA(Request $request, TwoFactorAuthenticationProvider $provider): JsonResponse
{
$user = $request->user();

// Generate secret if not already set
if (empty($user->two_factor_secret)) {
$user->forceFill([
'two_factor_secret' => encrypt($provider->generateSecretKey()),
'two_factor_recovery_codes' => encrypt(json_encode(
collect(range(1, 8))->map(fn() => Str::random(10) . '-' . Str::random(10))->all()
))
])->save();
}

$appName = urlencode(config('app.name'));
$email = urlencode($user->email);
$secret = decrypt($user->two_factor_secret);
$otpauthUrl = "otpauth://totp/{$appName}:{$email}?secret={$secret}&issuer={$appName}";

$renderer = new \BaconQrCode\Renderer\ImageRenderer(
new \BaconQrCode\Renderer\RendererStyle\RendererStyle(192),
new \BaconQrCode\Renderer\Image\SvgImageBackEnd()
);
$svg = (new \BaconQrCode\Writer($renderer))->writeString($otpauthUrl);

return response()->json(['svg' => $svg]);
}

/**
* Confirm 2FA setup by verifying the TOTP code for the authenticated user.
*/
public function confirmSetup2FA(Request $request, TwoFactorAuthenticationProvider $provider): JsonResponse
{
$user = $request->user();

if (empty($user->two_factor_secret)) {
return response()->json(['message' => '2FA not initialized'], 422);
}

$valid = $provider->verify(decrypt($user->two_factor_secret), $request->input('code'));

if (!$valid) {
return response()->json(['errors' => ['code' => ['invalid code']]], 422);
}

$user->forceFill(['two_factor_confirmed_at' => now()])->save();

return response()->json(['message' => '2FA activated']);
}
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New 2FA setup endpoints (setup2FA / confirmSetup2FA) introduce significant auth behavior but don’t appear to have feature tests yet (current tests cover login + challenge + recovery code generation only). Adding tests for setup (returns SVG / persists secret) and confirm (sets two_factor_confirmed_at, rejects invalid codes) would help prevent regressions.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Xeno-linux il a peut etre raison, on des tests la dessus ?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je suis pas sur. il me semble que y'a pas de test actuellement sur le setup et sur la validation des recovery codes (à rajouter du coup même si faudra que je trouve comment décrypter un qrcode svg pour en extraire le code dans les testes)

Comment thread GaelO2/app/GaelO/Entities/UserEntity.php
Comment on lines +57 to +62
return response()->json([
'id' => $user->id,
//'onboarded' => $loginResponse->onboarded,
'needs2FA' => true

]);
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In login(), when the user is an administrator and 2FA is not yet enabled ($isAdmin && !$use2FA), the API returns needs2FA: true but does not return either an access token or a challenge_token. Since the 2FA setup endpoints are behind auth:sanctum, this leaves administrators with no way to initialize 2FA and complete login. Consider either (a) issuing a temporary challenge_token that can be used to call the 2FA setup/confirm endpoints without a Sanctum token, or (b) allowing password-only login until 2FA has been initialized/confirmed, then requiring the 2FA challenge on subsequent logins.

Suggested change
return response()->json([
'id' => $user->id,
//'onboarded' => $loginResponse->onboarded,
'needs2FA' => true
]);
$tokenResult = $user->createToken('GaelO');
return response()->json([
'id' => $user->id,
'onboarded' => $loginResponse->onboarded,
'access_token' => $tokenResult->plainTextToken,
'token_type' => 'Bearer',
'needs2FA' => true,
], 200);

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Xeno-linux il a raison ?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je crois c'est ça qui bloquer mon front (vue que j'avais un 401)

Comment thread GaelO2/app/Http/Controllers/AuthController.php Outdated
Comment thread GaelO2/app/GaelO/Repositories/UserRepository.php Outdated
$this->assertEquals(5, sizeof($responseArray));
//Each User has full details
$this->assertEquals(17, sizeof( array_keys($responseArray[0]) ));
$this->assertEquals(18, sizeof( array_keys($responseArray[0]) ));
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test asserts the number of keys in the user payload (sizeof(array_keys(...))). With the addition of 2FA-related fields, this is likely to keep breaking as the API evolves and doesn’t verify the actual field(s) that matter. Consider asserting the presence/absence of specific expected keys instead (e.g., assert that two_factor_confirmed_at is present for the administrator view).

Copilot uses AI. Check for mistakes.
Comment thread GaelO2/app/Http/Controllers/AuthController.php Outdated
Comment on lines +96 to +101
// pull = get + delete in one operaion (single use)
$userId = Cache::pull('2fa_challenge_' . $challengeToken);

if (!$userId) {
return response()->json(['message' => 'Session expired or already use.'], 422);
}
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

twoFactorChallenge() uses Cache::pull() to fetch the userId, which deletes the challenge token immediately. This means a user only gets one attempt: any invalid code (or even a missing code/recovery_code) consumes the challenge and forces a full re-login to get a new token. Consider using Cache::get() for validation attempts and only deleting the cache entry after a successful 2FA validation (or tracking remaining attempts separately).

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Xeno-linux il a raison

Comment thread GaelO2/app/Http/Controllers/AuthController.php Outdated
@salimkanoun salimkanoun requested a review from Copilot April 3, 2026 09:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 27 out of 32 changed files in this pull request and generated 14 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

$user = $request->user();

if($user->id !== $userId){
throw new Exception("Can't activate 2FA for a thrid party account");
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setup2FA() denies access by throwing a generic Exception when the authenticated user ID doesn’t match the route {id}. Unhandled generic exceptions will surface as 500s; this should return a controlled 403 (e.g., abort(403, ...) or throw AuthorizationException). Also fix the typo in the message (“third”).

Suggested change
throw new Exception("Can't activate 2FA for a thrid party account");
abort(403, "Can't activate 2FA for a third party account");

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +204 to +206
if($user->id !== $userId){
throw new Exception("Can't activate 2FA for a thrid party account");
}
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

confirmSetup2FA() uses the same generic Exception for authorization failures, which will likely produce a 500 response. Return/throw a proper 403 (e.g., abort(403, ...) or AuthorizationException) so clients get a consistent auth error.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$user = $request->user();

if($user->id !== $userId){
throw new Exception("Can't generate recovery codes for a thrid party account");
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generateRecoveryCodes2FA() throws a generic Exception when {id} doesn’t match the authenticated user. This should be a 403 response, not a 500; use abort(403, ...) / AuthorizationException like delete2FA() does.

Suggested change
throw new Exception("Can't generate recovery codes for a thrid party account");
abort(403, "Can't generate recovery codes for a thrid party account");

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread GaelO2/app/Http/Controllers/AuthController.php Outdated
Comment thread GaelO2/app/Http/Controllers/AuthController.php Outdated
Comment thread GaelO2/app/GaelO/Repositories/UserRepository.php Outdated
Comment thread GaelO2/app/GaelO/Repositories/UserRepository.php Outdated
Comment thread GaelO2/storage/fonts/installed-fonts.json Outdated
Comment thread GaelO2/composer.json
Comment thread GaelO2/app/GaelO/Adapters/AzureCacheAdapter.php
$userEntity->emailVerifiedAt = $array['email_verified_at'];
$userEntity->lastConnection = $array['last_connection'];
$userEntity->onboardingVersion = $array['onboarding_version'];
$userEntity->twoFactorConfirmedAt = $array['two_factor_confirmed_at'] ?? null;
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Xeno-linux Passer en boolean is2FaEnabled

Comment on lines +39 to +40
'two_factor_confirmed_at'
])->toArray();
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enelver les hidder pour eviter l'appel a makeVisible

Comment on lines +148 to +151
return $user->makeVisible([
'two_factor_secret',
'two_factor_recovery_codes',
'two_factor_confirmed_at'
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enelver les hidder pour eviter l'appel a makeVisible

Comment thread GaelO2/app/Http/Controllers/AuthController.php
Comment on lines +177 to +179
'two_factor_recovery_codes' => encrypt(json_encode(
collect(range(1, 8))->map(fn() => Str::random(10) . '-' . Str::random(10))->all()
))
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Xeno-linux généré mais non output, ne pas générer ici les recovery code

Comment on lines +272 to +274
$user->forceFill(['two_factor_secret' => Null])->save();
$user->forceFill(['two_factor_recovery_codes' => Null])->save();
$user->forceFill(['two_factor_confirmed_at' => Null])->save();
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

null minuscule

Comment thread GaelO2/app/Models/User.php Outdated
Comment on lines 36 to 41
protected $hidden = [
'remember_token'
'remember_token',
'two_factor_secret',
'two_factor_recovery_codes',
'two_factor_confirmed_at',
];
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enlever le hidden on gere la visibilité vers le front dans notre code

Comment thread GaelO2/routes/api.php Outdated


//Route 2FA
Route::post('/two-factor-challenge', [AuthController::class, 'twoFactorChallenge'])->middleware('throttle:public-apis');
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Séparer en deux routes
/two-factor-challenge/totp
/two-factor-challenge/recovery-code

salimkanoun and others added 2 commits April 3, 2026 12:12
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 27 out of 32 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread GaelO2/app/Http/Controllers/AuthController.php
Comment on lines +158 to +165
/**
* Generate 2FA secret + QR code SVG for the authenticated user.
* Route protected by auth:sanctum — the Bearer token from login
* is sent explicitly by the front before being stored in Redux.
*/
public function setup2FA(Request $request, TwoFactorAuthenticationProvider $provider, int $userId): JsonResponse
{
$user = $request->user();
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docblock for setup2FA() says this route “Must be in the auth:sanctum group but NOT in the onboarded group”, but the route is currently registered inside the ['auth:sanctum', 'verified', 'activated', 'onboarded'] group in routes/api.php. Either update the documentation or move the route so behavior and docs match.

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +7
{
"ubuntu": {
"300": "ubuntu_300_c45603aff308508f7844bb0eb50312a5",
"normal": "ubuntu_normal_586fc05279d08db69a17eeb5f9ccbb6d",
"500": "ubuntu_500_59133bb6d75a9ff112a46f540911904c",
"bold": "ubuntu_bold_c41075d7a21980b166df8847c9303a6e"
}
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file hard-codes absolute, environment-specific paths like /var/www/storage/fonts/..., which will be incorrect in CI and non-container deployments and makes the repository non-portable. Consider generating this file at runtime, storing relative paths, or omitting it from version control if it is an artifact (dompdf font cache).

Copilot uses AI. Check for mistakes.
Comment thread GaelO2/composer.json
Comment on lines 16 to 40
"directorytree/imapengine-laravel": "^1.1",
"giggsey/libphonenumber-for-php": "^9.0",
"guzzlehttp/guzzle": "^7.9",
"laravel/framework": "^12.0",
"laravel/fortify": "^1.36",
"laravel/framework": "^13.0",
"laravel/sanctum": "^4.0",
"laravel/tinker": "^2.10",
"laravel/tinker": "^3.0",
"league/flysystem-ftp": "^3.29",
"league/flysystem-sftp-v3": "^3.0",
"league/mime-type-detection": "^1.16",
"maennchen/zipstream-php": "^3.1",
"phpoffice/phpspreadsheet": "^5.0",
"sentry/sentry-laravel": "^4.13",
"spatie/db-dumper": "^3.8",
"spatie/db-dumper": "^4.0",
"staudenmeir/eloquent-has-many-deep": "^1.21"
},
"require-dev": {
"fakerphp/faker": "^1.24",
"laravel/telescope": "^5.5",
"mockery/mockery": "^1.6",
"nunomaduro/collision": "^8.6",
"pestphp/pest": "^3.0",
"pestphp/pest": "^4.0",
"phpstan/phpstan": "^2.1",
"phpunit/phpunit": "^11.0",
"phpunit/phpunit": "^12.0",
"spatie/laravel-ignition": "^2.9"
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

composer.json changes dependency constraints (Laravel framework/tinker/pest/phpunit/spatie db-dumper) but this PR doesn’t include an updated composer.lock. For reproducible builds (and to keep CI consistent), regenerate and commit composer.lock along with these version bumps.

Copilot uses AI. Check for mistakes.
Comment on lines +70 to +80
// Mocke TwoFactorAuthenticationProvider
// to simulate TOTP code validation without secret
$this->mock(TwoFactorAuthenticationProvider::class, function ($mock) {
$mock->shouldReceive('verify')->once()->andReturn(true);
});

// Challenge 2FA
$response = $this->json('POST', '/api/two-factor-challenge', [
'challenge_token' => $challengeToken,
'code' => '000000' // not important because the provider is mocke
]);
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor typos in comments: “Mocke” / “mocke” should be “Mock” / “mocked” (or similar). Keeping test comments clean helps readability when these tests fail in CI.

Copilot uses AI. Check for mistakes.
$user = $request->user();

if($user->id !== $userId){
throw new Exception("Can't activate 2FA for a thrid party account");
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in error message: “thrid party account” should be “third party account”. Also consider returning a 403/authorization error rather than throwing a generic exception.

Suggested change
throw new Exception("Can't activate 2FA for a thrid party account");
abort(403, "Can't activate 2FA for a third party account");

Copilot uses AI. Check for mistakes.
@salimkanoun salimkanoun changed the base branch from GaelO2 to GaelO2-dev April 10, 2026 08:01
@salimkanoun salimkanoun merged commit 400dff2 into GaelO2-dev Apr 10, 2026
6 checks passed
@salimkanoun salimkanoun deleted the 2FA branch April 10, 2026 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants