Skip to content

Commit d6f644e

Browse files
Merge pull request #53 from qbicsoftware/development
Prepare Release 0.4.0
2 parents 0b92b76 + 49ba2ba commit d6f644e

File tree

105 files changed

+1980
-710
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+1980
-710
lines changed

.github/workflows/create-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
run: mvn versions:set -DnewVersion=${{ github.event.inputs.versionTag }}
3434

3535
- name: Build with Maven
36-
run: mvn -B package --file pom.xml
36+
run: mvn -B package -Pproduction --file pom.xml
3737

3838
- name: Create Release Notes
3939
if: ${{ !startsWith(github.ref, 'refs/tags/')

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,5 @@ drivers/
2525
# Error screenshots generated by TestBench for failed integration tests
2626
error-screenshots/
2727
webapp/webpack.generated.js
28+
/webapp/frontend/generated/theme.d.ts
29+
/target/

core/pom.xml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<parent>
6+
<artifactId>datamanager</artifactId>
7+
<groupId>life.qbic</groupId>
8+
<version>0.3.0</version>
9+
</parent>
10+
<modelVersion>4.0.0</modelVersion>
11+
12+
<artifactId>datamanagement-core</artifactId>
13+
<name>Data Manager Core</name>
14+
15+
<dependencyManagement>
16+
<dependencies>
17+
<dependency>
18+
<groupId>javax.persistence</groupId>
19+
<artifactId>javax.persistence-api</artifactId>
20+
<version>2.2</version>
21+
</dependency>
22+
</dependencies>
23+
</dependencyManagement>
24+
<dependencies>
25+
<!-- https://mvnrepository.com/artifact/javax.persistence/javax.persistence-api -->
26+
<dependency>
27+
<groupId>javax.persistence</groupId>
28+
<artifactId>javax.persistence-api</artifactId>
29+
</dependency>
30+
<dependency>
31+
<groupId>org.spockframework</groupId>
32+
<artifactId>spock-core</artifactId>
33+
<scope>test</scope>
34+
</dependency>
35+
<dependency>
36+
<groupId>org.slf4j</groupId>
37+
<artifactId>slf4j-api</artifactId>
38+
</dependency>
39+
<dependency>
40+
<groupId>ch.qos.logback</groupId>
41+
<artifactId>logback-classic</artifactId>
42+
</dependency>
43+
</dependencies>
44+
</project>

domain/src/main/java/life/qbic/apps/datamanager/ApplicationException.java renamed to core/src/main/java/life/qbic/identityaccess/application/ApplicationException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package life.qbic.apps.datamanager;
1+
package life.qbic.identityaccess.application;
22

33
/**
44
* <b><class short description - 1 Line!></b>

domain/src/main/java/life/qbic/apps/datamanager/services/ServiceException.java renamed to core/src/main/java/life/qbic/identityaccess/application/ServiceException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package life.qbic.apps.datamanager.services;
1+
package life.qbic.identityaccess.application;
22

33
/**
44
* <b><class short description - 1 Line!></b>

domain/src/main/java/life/qbic/domain/usermanagement/registration/ConfirmEmailInput.java renamed to core/src/main/java/life/qbic/identityaccess/application/user/ConfirmEmailInput.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package life.qbic.domain.usermanagement.registration;
1+
package life.qbic.identityaccess.application.user;
22

33
/**
44
* <b>Confirm Email use case input</b>

domain/src/main/java/life/qbic/domain/usermanagement/registration/ConfirmEmailOutput.java renamed to core/src/main/java/life/qbic/identityaccess/application/user/ConfirmEmailOutput.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package life.qbic.domain.usermanagement.registration;
1+
package life.qbic.identityaccess.application.user;
22

33
/**
44
* <b>Confirm Email use case output</b>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
package life.qbic.domain.usermanagement.registration;
1+
package life.qbic.identityaccess.application.user;
22

33
import java.util.Objects;
4-
import life.qbic.apps.datamanager.services.UserRegistrationService;
4+
import life.qbic.identityaccess.domain.user.UserNotFoundException;
55

66
/**
77
* <b>Email Address Confirmation use case</b>
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
package life.qbic.identityaccess.application.user;
2+
3+
import life.qbic.identityaccess.domain.user.EncryptedPassword.PasswordValidationException;
4+
import life.qbic.shared.application.ApplicationResponse;
5+
6+
/**
7+
* <b>New password use case</b>
8+
* <p>
9+
* Set's a new password for a user.
10+
*
11+
* @since 1.0.0
12+
*/
13+
public class NewPassword implements NewPasswordInput {
14+
15+
private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(NewPassword.class);
16+
private final UserRegistrationService userRegistrationService;
17+
private NewPasswordOutput useCaseOutput;
18+
19+
public NewPassword(UserRegistrationService userRegistrationService) {
20+
super();
21+
this.userRegistrationService = userRegistrationService;
22+
}
23+
24+
public void setUseCaseOutput(NewPasswordOutput useCaseOutput) {
25+
this.useCaseOutput = useCaseOutput;
26+
}
27+
28+
@Override
29+
public void setNewUserPassword(String userId, char[] newRawPassword) {
30+
if (useCaseOutput == null) {
31+
log.error("No use case output was set");
32+
return;
33+
}
34+
35+
ApplicationResponse response = userRegistrationService.newUserPassword(userId, newRawPassword);
36+
37+
response.ifSuccessOrElse(ignored -> {
38+
log.info(String.format("Successful password reset for user %s", userId));
39+
useCaseOutput.onSuccessfulNewPassword();
40+
},
41+
it -> it.failures().stream().filter(e -> e instanceof PasswordValidationException).findAny()
42+
.ifPresentOrElse(ignored -> {
43+
log.error(String.format("Could not set new password for user: %s", userId));
44+
useCaseOutput.onPasswordValidationFailure();
45+
},
46+
() -> {
47+
log.error(String.format("Unexpected failure on password reset for user: %s", userId));
48+
useCaseOutput.onUnexpectedFailure();
49+
}));
50+
51+
}
52+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package life.qbic.identityaccess.application.user;
2+
3+
/**
4+
* New Password use case input
5+
*
6+
* @since 1.0.0
7+
*/
8+
public interface NewPasswordInput {
9+
10+
/**
11+
* Sets a new password for a given user.
12+
*
13+
* @param userId the user's id
14+
* @param newRawPassword the new raw password
15+
* @since 1.0.0
16+
*/
17+
void setNewUserPassword(String userId, char[] newRawPassword);
18+
19+
}

0 commit comments

Comments
 (0)