diff --git a/src/main/java/de/tum/cit/aet/artemis/programming/service/ProgrammingExerciseParticipationService.java b/src/main/java/de/tum/cit/aet/artemis/programming/service/ProgrammingExerciseParticipationService.java index a09602907baa..c6fc7c1c5c3f 100644 --- a/src/main/java/de/tum/cit/aet/artemis/programming/service/ProgrammingExerciseParticipationService.java +++ b/src/main/java/de/tum/cit/aet/artemis/programming/service/ProgrammingExerciseParticipationService.java @@ -376,6 +376,7 @@ public void resetRepository(VcsRepositoryUri targetURL, VcsRepositoryUri sourceU * * @param repositoryTypeOrUserName the name of the user or the type of the repository * @param repositoryURI the participation's repository URL + * @param exercise the exercise the participation belongs to * @return the participation belonging to the provided repositoryURI and repository type or username */ public ProgrammingExerciseParticipation fetchParticipationWithSubmissionsByRepository(String repositoryTypeOrUserName, String repositoryURI, ProgrammingExercise exercise) { @@ -400,6 +401,7 @@ public ProgrammingExerciseParticipation retrieveSolutionParticipation(Exercise e * * @param repositoryTypeOrUserName the name of the user or the type of the repository * @param repositoryURI the participation's repository URL + * @param exercise the exercise the participation belongs to * @return the participation belonging to the provided repositoryURI and repository type or username */ public ProgrammingExerciseParticipation fetchParticipationByRepository(String repositoryTypeOrUserName, String repositoryURI, ProgrammingExercise exercise) { diff --git a/src/main/java/de/tum/cit/aet/artemis/programming/service/RepositoryService.java b/src/main/java/de/tum/cit/aet/artemis/programming/service/RepositoryService.java index 2e7627d7e22c..9c09f451a390 100644 --- a/src/main/java/de/tum/cit/aet/artemis/programming/service/RepositoryService.java +++ b/src/main/java/de/tum/cit/aet/artemis/programming/service/RepositoryService.java @@ -453,6 +453,7 @@ public void pullChanges(Repository repository) { * @param repository for which to execute the commit. * @param user the user who has committed the changes in the online editor * @param domainId the id of the domain Object (participation) owning the repository + * @return an Optional of a preliminary VcsAccessLog * @throws GitAPIException if the staging/committing process fails. */ public Optional commitChanges(Repository repository, User user, Long domainId) throws GitAPIException { diff --git a/src/main/java/de/tum/cit/aet/artemis/programming/service/localvc/LocalVCServletService.java b/src/main/java/de/tum/cit/aet/artemis/programming/service/localvc/LocalVCServletService.java index 30eeb87da1d1..235d841cf045 100644 --- a/src/main/java/de/tum/cit/aet/artemis/programming/service/localvc/LocalVCServletService.java +++ b/src/main/java/de/tum/cit/aet/artemis/programming/service/localvc/LocalVCServletService.java @@ -472,6 +472,8 @@ private UsernameAndPassword extractUsernameAndPassword(String authorizationHeade * @param exercise The exercise the repository belongs to. * @param repositoryActionType The type of the action the user wants to perform. * @param localVCRepositoryUri The URI of the local repository. + * @param usingSSH The flag specifying whether the method is called from the SSH or HTTPs context + * @return the ProgrammingParticipation Optional, containing the participation fetched during authorization * @throws LocalVCForbiddenException If the user is not allowed to access the repository. */ public Optional authorizeUser(String repositoryTypeOrUserName, User user, ProgrammingExercise exercise, @@ -525,10 +527,10 @@ private void checkAccessForRepository(ProgrammingExerciseParticipation participa * Checks if the provided repository is an auxiliary or test repository. * Only load auxiliary repositories if a user is at least teaching assistant; students are not allowed to access them * - * @param exercise - * @param repositoryTypeOrUserName - * @param repositoryActionType - * @param user + * @param exercise the exercise, where the repository belongs to + * @param repositoryTypeOrUserName the type or username of the repository + * @param repositoryActionType the action that should be performed on of the repository + * @param user the user who tries to access the repository * @return true if user is TA and * @throws LocalVCForbiddenException */ @@ -567,6 +569,7 @@ private boolean checkIfRepositoryIsAuxiliaryOrTestRepository(ProgrammingExercise * @param authenticationMechanism the mechanism used for authentication (e.g., token, basic auth) * @param ipAddress the IP address of the user accessing the repository * @param localVCRepositoryUri the URI of the localVC repository + * @param serverSession the SSH serverSession, where the data gets stored */ public void cacheAttributesInSshSession(User user, Optional optionalParticipation, RepositoryActionType repositoryActionType, AuthenticationMechanism authenticationMechanism, String ipAddress, LocalVCRepositoryUri localVCRepositoryUri, ServerSession serverSession) { diff --git a/src/main/java/de/tum/cit/aet/artemis/programming/service/localvc/VcsAccessLogService.java b/src/main/java/de/tum/cit/aet/artemis/programming/service/localvc/VcsAccessLogService.java index 1700c7be4d41..47530cbac1fb 100644 --- a/src/main/java/de/tum/cit/aet/artemis/programming/service/localvc/VcsAccessLogService.java +++ b/src/main/java/de/tum/cit/aet/artemis/programming/service/localvc/VcsAccessLogService.java @@ -99,11 +99,12 @@ public void saveVcsAccesslog(VcsAccessLog vcsAccessLog) { } /** - * Stores the log for a push from the code editor. + * Creates a preliminary access log for a push from the code editor, and returns it * * @param repo The repository to which the push is executed * @param user The user submitting the change * @param participationId The id of the participation belonging to the repository + * @return an Optional containing the preliminary VcsAccessLog, if one was created * @throws GitAPIException if an error occurs while retrieving the git log */ public Optional createPreliminaryCodeEditorAccessLog(Repository repo, User user, Long participationId) throws GitAPIException {