allow hyphen in username (#731)

* allow hyphen in username

* remove extra escaping

---------

Co-authored-by: Enrice <erich.mauerboeck@ergo-versicherung.at>
This commit is contained in:
Erich Mauerböck
2023-11-03 15:36:02 +01:00
committed by GitHub
parent 13762eb67f
commit 428e898a7a
4 changed files with 7 additions and 7 deletions
@@ -313,7 +313,7 @@ public class GroupResource extends BaseResource {
* @return Response
*/
@DELETE
@Path("{groupName: [a-zA-Z0-9_]+}/{username: [a-zA-Z0-9_@\\.]+}")
@Path("{groupName: [a-zA-Z0-9_]+}/{username: [a-zA-Z0-9_@.-]+}")
public Response removeMember(@PathParam("groupName") String groupName,
@PathParam("username") String username) {
if (!authenticate()) {
@@ -195,7 +195,7 @@ public class UserResource extends BaseResource {
* @return Response
*/
@POST
@Path("{username: [a-zA-Z0-9_@\\.]+}")
@Path("{username: [a-zA-Z0-9_@.-]+}")
public Response update(
@PathParam("username") String username,
@FormParam("password") String password,
@@ -497,7 +497,7 @@ public class UserResource extends BaseResource {
* @return Response
*/
@DELETE
@Path("{username: [a-zA-Z0-9_@\\.]+}")
@Path("{username: [a-zA-Z0-9_@.-]+}")
public Response delete(@PathParam("username") String username) {
if (!authenticate()) {
throw new ForbiddenClientException();
@@ -563,7 +563,7 @@ public class UserResource extends BaseResource {
* @return Response
*/
@POST
@Path("{username: [a-zA-Z0-9_@\\.]+}/disable_totp")
@Path("{username: [a-zA-Z0-9_@.-]+}/disable_totp")
public Response disableTotpUsername(@PathParam("username") String username) {
if (!authenticate()) {
throw new ForbiddenClientException();
@@ -685,7 +685,7 @@ public class UserResource extends BaseResource {
* @return Response
*/
@GET
@Path("{username: [a-zA-Z0-9_@\\.]+}")
@Path("{username: [a-zA-Z0-9_@.-]+}")
@Produces(MediaType.APPLICATION_JSON)
public Response view(@PathParam("username") String username) {
if (!authenticate()) {