Skip to content

Commit 1df6772

Browse files
sklein94cesmarvin
authored andcommitted
Merge branch 'release/v1.8.1-1'
2 parents b4ebcd6 + 782735c commit 1df6772

File tree

7 files changed

+39
-52
lines changed

7 files changed

+39
-52
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## [Unreleased]
88

9+
## [v1.8.1-1] - 2022-10-20
10+
### Fixed
11+
- in User Managment an empty Password will not suffice for lowercase and minimum lenght of 9 or less (#67)
12+
913
## [v1.8.0-1] - 2022-09-28
1014
### Changed
1115
- Prevent system groups (admin/cesManager) from being deleted (#65)

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ RUN set -x \
88
FROM registry.cloudogu.com/official/java:8u302-3
99

1010
LABEL NAME="official/usermgt" \
11-
VERSION="1.8.0-1" \
11+
VERSION="1.8.1-1" \
1212
maintainer="[email protected]"
1313

1414
# mark as webapp for nginx

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Set these to the desired values
22
ARTIFACT_ID=usermgt
3-
VERSION=1.8.0-1
3+
VERSION=1.8.1-1
44
# overwrite ADDITIONAL_LDFLAGS to disable static compilation
55
# this should fix https://github.com/golang/go/issues/13470
66
ADDITIONAL_LDFLAGS=""

app/src/main/java/de/triology/universeadm/group/GroupResource.java

+26-46
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
/*
1+
/*
22
* Copyright (c) 2013 - 2014, TRIOLOGY GmbH
33
* All rights reserved.
4-
*
4+
*
55
* Redistribution and use in source and binary forms, with or without
66
* modification, are permitted provided that the following conditions are met:
7-
*
7+
*
88
* 1. Redistributions of source code must retain the above copyright notice,
99
* this list of conditions and the following disclaimer.
1010
* 2. Redistributions in binary form must reproduce the above copyright notice,
1111
* this list of conditions and the following disclaimer in the documentation
1212
* and/or other materials provided with the distribution.
13-
*
13+
*
1414
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
1515
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1616
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@@ -21,7 +21,7 @@
2121
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2222
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
2323
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24-
*
24+
*
2525
* http://www.scm-manager.com
2626
*/
2727

@@ -31,107 +31,87 @@
3131
import de.triology.universeadm.AbstractManagerResource;
3232
import de.triology.universeadm.user.User;
3333
import de.triology.universeadm.user.UserManager;
34-
import org.json.simple.JSONArray;
3534
import org.slf4j.Logger;
3635
import org.slf4j.LoggerFactory;
3736

3837
import javax.ws.rs.*;
3938
import javax.ws.rs.core.MediaType;
4039
import javax.ws.rs.core.Response;
41-
import java.util.ArrayList;
4240
import java.util.List;
4341

4442
/**
45-
*
4643
* @author Sebastian Sdorra <[email protected]>
4744
*/
4845
@Path("groups")
49-
public class GroupResource extends AbstractManagerResource<Group>
50-
{
46+
public class GroupResource extends AbstractManagerResource<Group> {
5147

5248
private static final Logger logger = LoggerFactory.getLogger(GroupResource.class);
5349

5450
private final GroupManager groupManager;
5551
private final UserManager userManager;
56-
52+
5753
@Inject
58-
public GroupResource(GroupManager groupManager, UserManager userManager)
59-
{
54+
public GroupResource(GroupManager groupManager, UserManager userManager) {
6055
super(groupManager);
6156
this.groupManager = groupManager;
6257
this.userManager = userManager;
6358
}
6459

6560
@Override
66-
protected String getId(Group group)
67-
{
61+
protected String getId(Group group) {
6862
return group.getName();
6963
}
7064

7165
@Override
72-
protected void prepareForModify(String id, Group group)
73-
{
66+
protected void prepareForModify(String id, Group group) {
7467
group.setName(id);
7568
}
76-
69+
7770
@POST
7871
@Path("{name}/members/{member}")
79-
public Response addMember(@PathParam("name") String name, @PathParam("member") String member)
80-
{
72+
public Response addMember(@PathParam("name") String name, @PathParam("member") String member) {
8173
Response.ResponseBuilder builder;
82-
74+
8375
Group group = groupManager.get(name);
8476
User user = userManager.get(member);
85-
if ( group == null )
86-
{
77+
if (group == null) {
8778
builder = Response.status(Response.Status.NOT_FOUND);
88-
}
89-
else if (user == null){
79+
} else if (user == null) {
9080
builder = Response.status(Response.Status.BAD_REQUEST);
91-
}
92-
else if ( group.getMembers().contains(member) )
93-
{
81+
} else if (group.getMembers().contains(member)) {
9482
builder = Response.status(Response.Status.CONFLICT);
95-
}
96-
else
97-
{
83+
} else {
9884
group.getMembers().add(member);
9985
groupManager.modify(group);
10086
builder = Response.noContent();
10187
}
102-
88+
10389
return builder.build();
10490
}
105-
91+
10692
@DELETE
10793
@Path("{name}/members/{member}")
108-
public Response removeMember(@PathParam("name") String name, @PathParam("member") String member)
109-
{
94+
public Response removeMember(@PathParam("name") String name, @PathParam("member") String member) {
11095
Response.ResponseBuilder builder;
111-
96+
11297
Group group = groupManager.get(name);
113-
if ( group == null )
114-
{
98+
if (group == null) {
11599
builder = Response.status(Response.Status.NOT_FOUND);
116-
}
117-
else if ( ! group.getMembers().contains(member) )
118-
{
100+
} else if (!group.getMembers().contains(member)) {
119101
builder = Response.status(Response.Status.CONFLICT);
120-
}
121-
else
122-
{
102+
} else {
123103
group.getMembers().remove(member);
124104
groupManager.modify(group);
125105
builder = Response.noContent();
126106
}
127-
107+
128108
return builder.build();
129109
}
130110

131111
@GET
132112
@Path("undeletable")
133113
@Produces(MediaType.APPLICATION_JSON)
134-
public Response getUndeletable(){
114+
public Response getUndeletable() {
135115
Response.ResponseBuilder builder;
136116
try {
137117
List<String> groups = UndeletableGroupManager.getNonDeleteClassList();

app/src/main/webapp/scripts/passwordpolicy/services.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,15 @@ angular.module('universeadm.passwordpolicy.services', ['restangular'])
3535
var rules = policy.Rules;
3636
var violations = [];
3737
var invalidRules = [];
38+
var password = $scope.user.password;
39+
if (password === undefined){
40+
password = '';
41+
}
3842
try {
3943
rules.forEach(function (rule) {
4044
try {
4145
var regEx = new RegExp(rule.Rule);
42-
if (!regEx.test($scope.user.password)) {
46+
if (!regEx.test(password)) {
4347
violations.push(rule);
4448
}
4549
} catch (e) {

dogu.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"Name": "official/usermgt",
3-
"Version": "1.8.0-1",
3+
"Version": "1.8.1-1",
44
"DisplayName": "User Management",
55
"Description": "User and Group Management.",
66
"Category": "Administration Apps",

integrationTests/cypress/support/step_definitions/then.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ Then("the password entry is marked as valid", function () {
4747
});
4848

4949
Then("all password rules are marked as not fullfilled", function () {
50-
// Actually, there should be 5 unfulfilled rules. But unfortunately there is a bug: with an empty password, a rule is still marked as valid.
51-
cy.get('p[data-testid="password-policy-rules"]').children('span[ng-repeat="violation in passwordPolicy.violations"]').should('have.length', 4)
50+
cy.get('p[data-testid="password-policy-rules"]').children('span[ng-repeat="violation in passwordPolicy.violations"]').should('have.length', 5)
5251
});
5352

5453
Then("all password rules are marked as fullfilled", function () {

0 commit comments

Comments
 (0)