diff --git a/src/main/java/org/olat/course/certificate/restapi/CertificationWebService.java b/src/main/java/org/olat/course/certificate/restapi/CertificationWebService.java index 1d068e49b3c96c4b385f106db16a448d8bb36f2b..5af11135091506191f0f5e1f6ec53f3d4c949dd1 100644 --- a/src/main/java/org/olat/course/certificate/restapi/CertificationWebService.java +++ b/src/main/java/org/olat/course/certificate/restapi/CertificationWebService.java @@ -65,6 +65,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; import io.swagger.v3.oas.annotations.tags.Tag; @@ -227,8 +228,8 @@ public class CertificationWebService { @ApiResponse(responseCode = "404", description = "The identity or the resource cannot be found"), @ApiResponse(responseCode = "500", description = "An unexpected error happened during the creation of the certificate")}) public Response putCertificate(@PathParam("identityKey") Long identityKey, @PathParam("resourceKey") Long resourceKey, - @QueryParam("score") Float score, @QueryParam("passed") Boolean passed, - @QueryParam("creationDate") String creationDate, + @QueryParam("score")@Parameter(description = "The score which appears in the certificate") Float score, @QueryParam("passed") @Parameter(description = "The passed/failed which appears in the certificate (true/false)") Boolean passed, + @QueryParam("creationDate") @Parameter(description = "The date of the certification") String creationDate, @Context HttpServletRequest request) { Identity assessedIdentity = securityManager.loadIdentityByKey(identityKey); if(assessedIdentity == null) { diff --git a/src/main/java/org/olat/course/db/restapi/CourseDbWebService.java b/src/main/java/org/olat/course/db/restapi/CourseDbWebService.java index 2a9dfeed1c3cec6018a1b87ac7f8bcbebfe597b1..5832637d1701d484c6c7ed3f69fecaaab98366f8 100644 --- a/src/main/java/org/olat/course/db/restapi/CourseDbWebService.java +++ b/src/main/java/org/olat/course/db/restapi/CourseDbWebService.java @@ -22,7 +22,6 @@ package org.olat.course.db.restapi; import java.util.List; - import javax.servlet.http.HttpServletRequest; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; @@ -38,6 +37,7 @@ import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.Status; + import org.olat.core.CoreSpringFactory; import org.olat.core.gui.UserRequest; import org.olat.core.id.Identity; @@ -55,9 +55,10 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; import io.swagger.v3.oas.annotations.media.Content; import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.ArraySchema; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; import io.swagger.v3.oas.annotations.tags.Tag; @@ -302,7 +303,7 @@ public class CourseDbWebService { } ) public Response putValue(@PathParam("courseId") Long courseId, @PathParam("category") String category, @PathParam("name") String name, - @QueryParam("value") String value, @Context HttpServletRequest request) { + @QueryParam("value") @Parameter(description = "The value of the key value pair") String value, @Context HttpServletRequest request) { return internPutValue(courseId, category, name, value, request); } diff --git a/src/main/java/org/olat/course/nodes/co/COWebService.java b/src/main/java/org/olat/course/nodes/co/COWebService.java index 900e4d11dbc49d0f522d9335aa32c10fa7ffbfe5..393cc62553d2b1e22b309c547649b68cefc452b1 100755 --- a/src/main/java/org/olat/course/nodes/co/COWebService.java +++ b/src/main/java/org/olat/course/nodes/co/COWebService.java @@ -134,7 +134,7 @@ public class COWebService extends AbstractCourseNodeWebService { ) @Consumes(MediaType.APPLICATION_FORM_URLENCODED) @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - public Response attachContact(@PathParam("courseId") Long courseId, @QueryParam("parentNodeId") String parentNodeId, + public Response attachContact(@PathParam("courseId") Long courseId, @QueryParam("parentNodeId") @Parameter(description = "The node's id which will be the parent of this structure")String parentNodeId, @QueryParam("position") @Parameter(description = "The node's position relative to its sibling nodes (optional)") Integer position, @QueryParam("shortTitle") @Parameter(description = "The node short title") @DefaultValue("undefined") String shortTitle, @QueryParam("longTitle") @Parameter(description = "The node long title") @DefaultValue("undefined") String longTitle, @QueryParam("objectives") @Parameter(description = "The node learning objectives") @DefaultValue("undefined") String objectives, @QueryParam("visibilityExpertRules") @Parameter(description = "The rules to view the node (optional)") String visibilityExpertRules, @QueryParam("accessExpertRules") @Parameter(description = "The rules to access the node (optional)") String accessExpertRules, diff --git a/src/main/java/org/olat/login/auth/OLATAuthManager.java b/src/main/java/org/olat/login/auth/OLATAuthManager.java index 1b019807cb2869e1a2a69bcf0c070ed4ac998103..c9cb3eca64da588228d96f87cf90f350317b4dbb 100644 --- a/src/main/java/org/olat/login/auth/OLATAuthManager.java +++ b/src/main/java/org/olat/login/auth/OLATAuthManager.java @@ -205,7 +205,7 @@ public class OLATAuthManager implements AuthenticationSPI { } public SyntaxValidator createUsernameSytaxValidator() { - return new SyntaxValidator(usernameRulesFactory.createRules(), false); + return new SyntaxValidator(usernameRulesFactory.createRules(true), false); } diff --git a/src/main/java/org/olat/login/validation/UsernameValidationRulesFactory.java b/src/main/java/org/olat/login/validation/UsernameValidationRulesFactory.java index 78727db8a95d38e1ab4e3660e1beee29096e0313..4710043d036914025653c8dfff26dd9fd38afbf9 100644 --- a/src/main/java/org/olat/login/validation/UsernameValidationRulesFactory.java +++ b/src/main/java/org/olat/login/validation/UsernameValidationRulesFactory.java @@ -39,11 +39,13 @@ public class UsernameValidationRulesFactory { @Autowired private LoginModule loginModule; - public ValidationRulesProvider createRules() { + public ValidationRulesProvider createRules(boolean checkUsernameExists) { ValidationRulesProviderBuilder providerBuilder = new ValidationRulesProviderBuilder(); providerBuilder.add(createUsernameSyntaxRule()); providerBuilder.add(createBlackListRule()); - providerBuilder.add(createUsernameExistsRule()); + if (checkUsernameExists) { + providerBuilder.add(createUsernameExistsRule()); + } return providerBuilder.create(); } diff --git a/src/main/java/org/olat/modules/curriculum/restapi/CurriculumElementsWebService.java b/src/main/java/org/olat/modules/curriculum/restapi/CurriculumElementsWebService.java index 81cbe28eba5a756d33f1c5b73154228dbfc22ee4..dea61b1a7f0c49c504062b4fe2ae471cd763764f 100644 --- a/src/main/java/org/olat/modules/curriculum/restapi/CurriculumElementsWebService.java +++ b/src/main/java/org/olat/modules/curriculum/restapi/CurriculumElementsWebService.java @@ -20,7 +20,6 @@ package org.olat.modules.curriculum.restapi; import java.util.ArrayList; - import java.util.List; import javax.servlet.http.HttpServletRequest; @@ -70,12 +69,14 @@ import org.olat.user.restapi.UserVOFactory; import org.springframework.beans.factory.annotation.Autowired; import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.ArraySchema; import io.swagger.v3.oas.annotations.media.Content; import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.media.ArraySchema; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; + /** * The security checks are done by the CurriculumsWebService. * @@ -693,7 +694,7 @@ public class CurriculumElementsWebService { @ApiResponse(responseCode = "401", description = "The roles of the authenticated user are not sufficient"), @ApiResponse(responseCode = "401", description = "The course not found")} ) - public Response getUsers(@PathParam("curriculumElementKey") Long curriculumElementKey, @QueryParam("role") String role) { + public Response getUsers(@PathParam("curriculumElementKey") Long curriculumElementKey, @QueryParam("role") @Parameter(description = "Filter by specific role") String role) { CurriculumElement curriculumElement = curriculumService.getCurriculumElement(new CurriculumElementRefImpl(curriculumElementKey)); if(curriculumElement == null) { return Response.serverError().status(Status.NOT_FOUND).build(); diff --git a/src/main/java/org/olat/modules/fo/restapi/ForumCourseNodeWebService.java b/src/main/java/org/olat/modules/fo/restapi/ForumCourseNodeWebService.java index 438f8d16db15ac993d98c3e2e50d3ee45f24fe19..80cac42cf6fd6a02c7105ac5ff3f610313f00942 100644 --- a/src/main/java/org/olat/modules/fo/restapi/ForumCourseNodeWebService.java +++ b/src/main/java/org/olat/modules/fo/restapi/ForumCourseNodeWebService.java @@ -78,6 +78,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.media.Content; import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.responses.ApiResponse; @@ -251,12 +252,12 @@ public class ForumCourseNodeWebService extends AbstractCourseNodeWebService { @ApiResponse(responseCode = "404", description = "The course or parentNode not found")} ) @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - public Response attachForum(@PathParam("courseId") Long courseId, @QueryParam("parentNodeId") String parentNodeId, - @QueryParam("position") Integer position, @QueryParam("shortTitle") @DefaultValue("undefined") String shortTitle, - @QueryParam("longTitle") @DefaultValue("undefined") String longTitle, @QueryParam("objectives") @DefaultValue("undefined") String objectives, - @QueryParam("visibilityExpertRules") String visibilityExpertRules, @QueryParam("accessExpertRules") String accessExpertRules, - @QueryParam("moderatorExpertRules") String moderatorExpertRules, @QueryParam("posterExpertRules") String posterExpertRules, - @QueryParam("readerExpertRules") String readerExpertRules, @Context HttpServletRequest request) { + public Response attachForum(@PathParam("courseId") Long courseId, @QueryParam("parentNodeId") @Parameter(description = "The node's id which will be the parent of this single page") String parentNodeId, + @QueryParam("position") @Parameter(description = "The node's position relative to its sibling nodes (optional)") Integer position, @QueryParam("shortTitle") @Parameter(description = "The node short title") @DefaultValue("undefined") String shortTitle, + @QueryParam("longTitle") @Parameter(description = "The node long title") @DefaultValue("undefined") String longTitle, @QueryParam("objectives") @Parameter(description = "The node learning objectives") @DefaultValue("undefined") String objectives, + @QueryParam("visibilityExpertRules") @Parameter(description = "The rules to view the node (optional)") String visibilityExpertRules, @QueryParam("accessExpertRules") @Parameter(description = "The rules to access the node (optional)") String accessExpertRules, + @QueryParam("moderatorExpertRules") @Parameter(description = "The rules to moderate the node (optional)") String moderatorExpertRules, @QueryParam("posterExpertRules") @Parameter(description = "The rules to post the node (optional)") String posterExpertRules, + @QueryParam("readerExpertRules") @Parameter(description = "The rules to read the node (optional)") String readerExpertRules, @Context HttpServletRequest request) { ForumCustomConfig config = new ForumCustomConfig(moderatorExpertRules, posterExpertRules, readerExpertRules); return attach(courseId, parentNodeId, "fo", position, shortTitle, longTitle, objectives, visibilityExpertRules, accessExpertRules, config, request); } @@ -369,6 +370,7 @@ public class ForumCourseNodeWebService extends AbstractCourseNodeWebService { * * @deprecated use the {nodeId}/forum/threads instead */ + @Deprecated @PUT @Path("{nodeId}/thread") @Operation(summary = "Create a new thread in the forum of the course node", @@ -384,8 +386,8 @@ public class ForumCourseNodeWebService extends AbstractCourseNodeWebService { @ApiResponse(responseCode = "404", description = "The course or parentNode not found")} ) @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - public Response newThreadToForum(@PathParam("courseId") Long courseId, @PathParam("nodeId") String nodeId, @QueryParam("title") String title, - @QueryParam("body") String body, @QueryParam("identityName") String identityName, @QueryParam("sticky") Boolean isSticky, + public Response newThreadToForum(@PathParam("courseId") Long courseId, @PathParam("nodeId") String nodeId, @QueryParam("title")@Parameter(description = "The title for the first post in the thread") String title, + @QueryParam("body") @Parameter(description = "The body for the first post in the thread") String body, @QueryParam("identityName") @Parameter(description = "The author identity name (optional)")String identityName, @QueryParam("sticky")@Parameter(description = "Creates sticky thread.") Boolean isSticky, @Context HttpServletRequest request) { return addMessage(courseId, nodeId, null, title, body, identityName, isSticky, request); @@ -410,6 +412,7 @@ public class ForumCourseNodeWebService extends AbstractCourseNodeWebService { * * @deprecated use the {nodeId}/forum/messages instead */ + @Deprecated @PUT @Path("{nodeId}/message") @Operation(summary = "Creates a new forum message", @@ -425,8 +428,8 @@ public class ForumCourseNodeWebService extends AbstractCourseNodeWebService { @ApiResponse(responseCode = "404", description = "The author, forum or message not found")} ) @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - public Response newMessageToForum(@PathParam("courseId") Long courseId, @PathParam("nodeId") String nodeId, @QueryParam("parentMessageId") Long parentMessageId, @QueryParam("title") String title, - @QueryParam("body") String body, @QueryParam("identityName") String identityName, @Context HttpServletRequest request) { + public Response newMessageToForum(@PathParam("courseId") Long courseId, @PathParam("nodeId") String nodeId, @QueryParam("parentMessageId") @Parameter(description = "The id of the parent message") Long parentMessageId, @QueryParam("title") @Parameter(description = "The title for the first post in the thread") String title, + @QueryParam("body") @Parameter(description = "The body for the first post in the thread") String body, @QueryParam("identityName") @Parameter(description = "The author identity name (optional)") String identityName, @Context HttpServletRequest request) { if(parentMessageId == null || parentMessageId == 0L) { return Response.serverError().status(Status.NOT_FOUND).build(); diff --git a/src/main/java/org/olat/modules/fo/restapi/ForumWebService.java b/src/main/java/org/olat/modules/fo/restapi/ForumWebService.java index d25d9ff290597aff15920a8d79aa64d0e98cf4a6..ac22c57c6aa939d418f4e4ad8b7850c451e7afb9 100644 --- a/src/main/java/org/olat/modules/fo/restapi/ForumWebService.java +++ b/src/main/java/org/olat/modules/fo/restapi/ForumWebService.java @@ -22,7 +22,6 @@ package org.olat.modules.fo.restapi; import static org.olat.restapi.security.RestSecurityHelper.getIdentity; - import java.io.ByteArrayInputStream; import java.io.File; import java.io.FileInputStream; @@ -282,8 +281,8 @@ public class ForumWebService { ) @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - public Response newThreadToForum(@QueryParam("title") String title, - @QueryParam("body") String body, @QueryParam("authorKey") Long authorKey, + public Response newThreadToForum(@QueryParam("title") @Parameter(description = "The title for the first post in the thread") String title, + @QueryParam("body") String body, @QueryParam("authorKey") @Parameter(description = "The author user key (optional)") Long authorKey, @Context HttpServletRequest httpRequest) { Identity author = getMessageAuthor(authorKey, httpRequest); @@ -330,7 +329,7 @@ public class ForumWebService { @ApiResponse(responseCode = "401", description = "The roles of the authenticated user are not sufficient."), @ApiResponse(responseCode = "404", description = "The author, forum or message not found.")} ) - public Response getMessages( @PathParam("threadKey") Long threadKey, @QueryParam("start") @Parameter(description = "Set the date for the earliest thread.") @DefaultValue("0") Integer start, + public Response getMessages( @PathParam("threadKey") Long threadKey, @QueryParam("start") @Parameter(description = "Set the date for the earliest thread") @DefaultValue("0") Integer start, @QueryParam("limit")@Parameter(description = "Limit the amount of threads to be returned.") @DefaultValue("25") Integer limit, @QueryParam("orderBy")@Parameter(description = "orderBy (value name,creationDate)") @DefaultValue("creationDate") String orderBy, @QueryParam("asc") @Parameter(description = "Determine the type of order.") @DefaultValue("true") Boolean asc, @Context HttpServletRequest httpRequest, @Context UriInfo uriInfo, @Context Request request) { @@ -426,8 +425,8 @@ public class ForumWebService { ) @Consumes(MediaType.APPLICATION_FORM_URLENCODED) @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - public Response replyToPost(@PathParam("messageKey") Long messageKey, @QueryParam("title") String title, - @QueryParam("body") String body, @QueryParam("authorKey") Long authorKey, + public Response replyToPost(@PathParam("messageKey") Long messageKey, @QueryParam("title") @Parameter(description = "The title for the first post in the thread") String title, + @QueryParam("body") @Parameter(description = "The body for the first post in the thread") String body, @QueryParam("authorKey") @Parameter(description = "The author user key (optional)") Long authorKey, @Context HttpServletRequest httpRequest, @Context UriInfo uriInfo) { ServletUtil.printOutRequestHeaders(httpRequest); return replyToPost(messageKey, new ReplyVO(title, body), authorKey, httpRequest, uriInfo); diff --git a/src/main/java/org/olat/registration/restapi/RegistrationWebService.java b/src/main/java/org/olat/registration/restapi/RegistrationWebService.java index f4e603948f90e07cc041ebd5d4782c28a5393e63..ef8d0c6b8513a00112f7f130aef767e64a28d0c6 100644 --- a/src/main/java/org/olat/registration/restapi/RegistrationWebService.java +++ b/src/main/java/org/olat/registration/restapi/RegistrationWebService.java @@ -58,6 +58,7 @@ import org.olat.user.UserModule; import org.springframework.stereotype.Component; import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; @@ -111,7 +112,7 @@ public class RegistrationWebService { @ApiResponses({ @ApiResponse(responseCode = "200", description = "Registration successful"), @ApiResponse(responseCode = "304", description = "Already registered, HTTP-Header location set to redirect") }) - public Response register(@QueryParam("email") String email, @Context HttpServletRequest request) { + public Response register(@QueryParam("email") @Parameter(description = "The email address") String email, @Context HttpServletRequest request) { if (!CoreSpringFactory.getImpl(RegistrationModule.class).isSelfRegistrationEnabled()) { return Response.serverError().status(Status.NOT_FOUND).build(); } diff --git a/src/main/java/org/olat/restapi/group/LearningGroupWebService.java b/src/main/java/org/olat/restapi/group/LearningGroupWebService.java index c56ff624ae6566f0d53127f8ef76651afd69ba10..838d59372580bd40fa843b8d7f2c7345e34749ad 100644 --- a/src/main/java/org/olat/restapi/group/LearningGroupWebService.java +++ b/src/main/java/org/olat/restapi/group/LearningGroupWebService.java @@ -86,6 +86,7 @@ import org.olat.user.restapi.UserVOFactory; import org.springframework.stereotype.Component; import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.media.ArraySchema; import io.swagger.v3.oas.annotations.media.Content; import io.swagger.v3.oas.annotations.media.Schema; @@ -93,7 +94,6 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; import io.swagger.v3.oas.annotations.tags.Tag; - /** * Description:<br> * This handles the learning groups. @@ -153,7 +153,7 @@ public class LearningGroupWebService { @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = GroupVO.class))), @Content(mediaType = "application/xml", array = @ArraySchema(schema = @Schema(implementation = GroupVO.class))) })}) @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - public Response getGroupList(@QueryParam("externalId") String externalId, @QueryParam("managed") Boolean managed, + public Response getGroupList(@QueryParam("externalId") @Parameter(description = "Search with an external ID") String externalId, @QueryParam("managed") @Parameter(description = "(true / false) Search only managed / not managed groups") Boolean managed, @Context HttpServletRequest request) { BusinessGroupService bgs = CoreSpringFactory.getImpl(BusinessGroupService.class); List<BusinessGroup> groups; diff --git a/src/main/java/org/olat/restapi/group/MyGroupWebService.java b/src/main/java/org/olat/restapi/group/MyGroupWebService.java index 806fbf221e856fb64646aeb50f754572fe918bc0..9b94c3abe372e550f17509e49b8bec64833be655 100644 --- a/src/main/java/org/olat/restapi/group/MyGroupWebService.java +++ b/src/main/java/org/olat/restapi/group/MyGroupWebService.java @@ -53,6 +53,7 @@ import org.olat.restapi.support.vo.GroupVOes; import org.springframework.beans.factory.annotation.Autowired; import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.media.ArraySchema; import io.swagger.v3.oas.annotations.media.Content; import io.swagger.v3.oas.annotations.media.Schema; @@ -104,8 +105,8 @@ public class MyGroupWebService { @Content(mediaType = "application/xml", array = @ArraySchema(schema = @Schema(implementation = GroupVO.class))) }), @ApiResponse(responseCode = "404", description = "The identity not found") }) @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - public Response getUserGroupList(@QueryParam("start") @DefaultValue("0") Integer start, @QueryParam("limit") @DefaultValue("25") Integer limit, - @QueryParam("externalId") String externalId, @QueryParam("managed") Boolean managed, + public Response getUserGroupList(@QueryParam("start") @Parameter(description = "The first result") @DefaultValue("0") Integer start, @QueryParam("limit") @Parameter(description = "The maximum results") @DefaultValue("25") Integer limit, + @QueryParam("externalId") @Parameter(description = "Search with an external ID") String externalId, @QueryParam("managed") @Parameter(description = "(true / false) Search only managed / not managed groups") Boolean managed, @Context HttpServletRequest httpRequest, @Context Request request) { return getGroupList(start, limit, externalId, managed, true, true, httpRequest, request); @@ -135,8 +136,8 @@ public class MyGroupWebService { @Content(mediaType = "application/xml", array = @ArraySchema(schema = @Schema(implementation = GroupVO.class))) }), @ApiResponse(responseCode = "404", description = "The identity not found") }) @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) - public Response getOwnedGroupList(@QueryParam("start") @DefaultValue("0") Integer start, @QueryParam("limit") @DefaultValue("25") Integer limit, - @QueryParam("externalId") String externalId, @QueryParam("managed") Boolean managed, + public Response getOwnedGroupList(@QueryParam("start") @Parameter(description = "The first result") @DefaultValue("0") Integer start, @QueryParam("limit") @Parameter(description = "The maximum results") @DefaultValue("25") Integer limit, + @QueryParam("externalId") @Parameter(description = "Search with an external ID") String externalId, @QueryParam("managed") @Parameter(description = "(true / false) Search only managed / not managed groups") Boolean managed, @Context HttpServletRequest httpRequest, @Context Request request) { return getGroupList(start, limit, externalId, managed, true, false, httpRequest, request); } diff --git a/src/main/java/org/olat/shibboleth/ShibbolethRegistrationForm.java b/src/main/java/org/olat/shibboleth/ShibbolethRegistrationForm.java index 626f6138bfd6b2ad170dc0b85955459f93029392..43e44caebbf35372ce9a06d118400fa1dae9328d 100644 --- a/src/main/java/org/olat/shibboleth/ShibbolethRegistrationForm.java +++ b/src/main/java/org/olat/shibboleth/ShibbolethRegistrationForm.java @@ -35,8 +35,8 @@ import org.olat.core.gui.control.Event; import org.olat.core.gui.control.WindowControl; import org.olat.core.util.StringHelper; import org.olat.core.util.Util; -import org.olat.login.auth.OLATAuthManager; import org.olat.login.validation.SyntaxValidator; +import org.olat.login.validation.UsernameValidationRulesFactory; import org.olat.login.validation.ValidationResult; import org.olat.user.ChangePasswordForm; import org.springframework.beans.factory.annotation.Autowired; @@ -58,13 +58,13 @@ public class ShibbolethRegistrationForm extends FormBasicController { private final SyntaxValidator usernameSyntaxValidator; @Autowired - private OLATAuthManager olatAuthManager; + private UsernameValidationRulesFactory usernameRulesFactory; public ShibbolethRegistrationForm(UserRequest ureq, WindowControl wControl, String proposedUsername) { super(ureq, wControl); setTranslator(Util.createPackageTranslator(ChangePasswordForm.class, ureq.getLocale(), getTranslator())); this.proposedUsername = proposedUsername; - this.usernameSyntaxValidator = olatAuthManager.createUsernameSytaxValidator(); + this.usernameSyntaxValidator = new SyntaxValidator(usernameRulesFactory.createRules(false), false); initForm(ureq); }