Skip to content

Commit

Permalink
fix server style
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonEntholzer committed Nov 19, 2024
1 parent 59d437f commit 5bdfea2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<VcsAccessLog> commitChanges(Repository repository, User user, Long domainId) throws GitAPIException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<ProgrammingExerciseParticipation> authorizeUser(String repositoryTypeOrUserName, User user, ProgrammingExercise exercise,
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -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<ProgrammingExerciseParticipation> optionalParticipation, RepositoryActionType repositoryActionType,
AuthenticationMechanism authenticationMechanism, String ipAddress, LocalVCRepositoryUri localVCRepositoryUri, ServerSession serverSession) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<VcsAccessLog> createPreliminaryCodeEditorAccessLog(Repository repo, User user, Long participationId) throws GitAPIException {
Expand Down

0 comments on commit 5bdfea2

Please sign in to comment.