Skip to content

Commit 1c83444

Browse files
authored
Merge pull request #1601 from parallaxinc/pr-101tomaster
PR Branch 0.101 to Master
2 parents 558fd1b + fba05d5 commit 1c83444

File tree

7 files changed

+38
-5
lines changed

7 files changed

+38
-5
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,5 +538,5 @@
538538
<version>4.12</version>
539539
<scope>test</scope>
540540
</dependency>
541-
</dependencies>
541+
</dependencies>
542542
</project>

src/main/java/com/parallax/server/blocklyprop/rest/RestProfile.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import com.parallax.client.cloudsession.exceptions.ServerException;
2222
import com.parallax.client.cloudsession.exceptions.UnknownUserIdException;
2323
import com.parallax.client.cloudsession.exceptions.WrongAuthenticationSourceException;
24+
import com.parallax.client.cloudsession.exceptions.EmailNotConfirmedException;
2425
import com.parallax.client.cloudsession.objects.User;
2526
import javax.ws.rs.FormParam;
2627
import javax.ws.rs.POST;

src/main/java/com/parallax/server/blocklyprop/rest/RestSharedProject.java

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ public Response get(
8181

8282
Boolean parametersValid = false;
8383

84-
// Check the incoming data
85-
if (sort != null){
84+
// Sort flag evaluation
85+
if (sort != null) {
8686
for (TableSort t : TableSort.values()) {
8787
LOG.debug("REST:/shared/project/list/ Sort test for '{}'", t);
8888

@@ -98,9 +98,9 @@ public Response get(
9898
}
9999
}
100100

101+
// Sort order evaluation
101102
if (order != null) {
102103
parametersValid = false;
103-
104104
LOG.debug("REST:/shared/project/list/ Checking order");
105105

106106
for (TableOrder t : TableOrder.values()) {
@@ -115,8 +115,35 @@ public Response get(
115115
}
116116
}
117117

118+
LOG.info("REST:/shared/project/list/ Checking limit");
119+
120+
// Limit result set value
121+
if ( (limit == null) || (limit > 50)) {
122+
LOG.info("REST:/shared/project/list/ Limit throttle to 50 entries");
123+
limit = 50;
124+
}
125+
126+
LOG.info("REST:/shared/project/list/ Checking offset");
127+
128+
// Check ofset from the beginning of the record set
129+
if ((offset == null) || (offset < 0)) {
130+
offset = 0;
131+
}
132+
133+
for (TableOrder t : TableOrder.values()) {
134+
if (order == t) {
135+
parametersValid = true;
136+
break;
137+
}
138+
}
139+
140+
if (parametersValid == false) {
141+
return Response.status(Response.Status.NOT_ACCEPTABLE).build();
142+
}
143+
118144
LOG.debug("REST:/shared/project/list/ Checking limit");
119145

146+
// Set sane limits
120147
if ( (limit == null) || (limit > 50)) {
121148
LOG.warn("REST:/shared/project/list/ Limit throttle to 50 entries");
122149
limit = 50;

src/main/java/com/parallax/server/blocklyprop/services/impl/SecurityServiceImpl.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,9 @@ public User authenticateLocalUser(String email, String password) throws
375375
LOG.info("User authenticated");
376376
return user;
377377

378+
} catch (UnknownUserException uue) {
379+
LOG.error("User account is unknown.");
380+
throw uue;
378381
} catch (UserBlockedException ube) {
379382
LOG.error("User account is blocked.");
380383
throw ube;

src/main/java/com/parallax/server/blocklyprop/servlets/ConfirmServlet.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ public void confirmToken(HttpServletRequest req, HttpServletResponse resp)
9090
.forward(req, resp);
9191
} else {
9292
try {
93+
LOG.info("Trying to confirm: {}, {}", email, token);
9394
// Validate the email and token with the Cloud Session server
9495
if (cloudSessionLocalUserService.doConfirm(email, token)) {
9596

src/main/java/com/parallax/server/blocklyprop/servlets/PasswordResetServlet.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
import com.google.inject.Inject;
1010
import com.google.inject.Singleton;
1111
import com.parallax.client.cloudsession.CloudSessionLocalUserService;
12-
import com.parallax.client.cloudsession.exceptions.EmailNotConfirmedException;
1312
import com.parallax.client.cloudsession.exceptions.PasswordComplexityException;
1413
import com.parallax.client.cloudsession.exceptions.PasswordVerifyException;
1514
import com.parallax.client.cloudsession.exceptions.ServerException;
1615
import com.parallax.client.cloudsession.exceptions.UnknownUserException;
1716
import com.parallax.client.cloudsession.exceptions.WrongAuthenticationSourceException;
17+
import com.parallax.client.cloudsession.exceptions.EmailNotConfirmedException;
1818
import com.parallax.server.blocklyprop.enums.PasswordResetPage;
1919
import com.parallax.server.blocklyprop.utils.ServletUtils;
2020
import com.parallax.server.blocklyprop.utils.TextileReader;

src/main/java/com/parallax/server/blocklyprop/servlets/PublicProfileServlet.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import com.parallax.client.cloudsession.exceptions.EmailNotConfirmedException;
1313
import com.parallax.client.cloudsession.exceptions.ServerException;
1414
import com.parallax.client.cloudsession.exceptions.UnknownUserIdException;
15+
import com.parallax.client.cloudsession.exceptions.EmailNotConfirmedException;
1516
import com.parallax.server.blocklyprop.db.generated.tables.pojos.User;
1617
import com.parallax.server.blocklyprop.services.UserService;
1718
import com.parallax.server.blocklyprop.services.impl.SecurityServiceImpl;

0 commit comments

Comments
 (0)