Skip to content

Commit

Permalink
Revert "Save if a Registration uses the new ID OpenConext/OpenConext-…
Browse files Browse the repository at this point in the history
…myconext#552"

This reverts commit d437d37.
  • Loading branch information
oharsta committed Dec 9, 2024
1 parent d437d37 commit 37caa31
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 19 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@ jobs:
mongodb-version: ${{ matrix.mongodb-version }}
mongodb-replica-set: test-rs

- uses: actions/setup-java@v4
- uses: actions/setup-java@v1
with:
java-version: 21
distribution: 'temurin'
java-version: 11
cache: 'maven'

- name: Build with Maven
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up JDK 21
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 21
distribution: 'temurin'
java-version: 11
cache: 'maven'
server-id: openconext-releases
server-username: MAVEN_USERNAME
Expand Down
14 changes: 7 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>21</java.version>
<java.version>11</java.version>
</properties>

<groupId>org.openconext</groupId>
<artifactId>tiqr-java-connector</artifactId>
<version>2.0.0</version>
<version>1.1.4-SNAPSHOT</version>
<name>tiqr-java-connector</name>

<dependencies>
Expand All @@ -33,13 +33,13 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>5.3.39</version>
<version>5.3.37</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>5.3.39</version>
<version>5.3.37</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -118,13 +118,13 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<configuration>
<release>21</release>
<release>11</release>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.0</version>
<version>3.2.5</version>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down Expand Up @@ -168,7 +168,7 @@
<version>3.8.4</version>
</requireMavenVersion>
<requireJavaVersion>
<version>21</version>
<version>11</version>
</requireJavaVersion>
</rules>
</configuration>
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/tiqr/org/DefaultTiqrService.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public MetaData getMetaData(String enrollmentKey) throws TiqrException {

LOG.debug("Get metadata for enrollment for user " + enrollment.getUserID());

enrollment = enrollmentRepository.save(enrollment);
enrollmentRepository.save(enrollment);
return new MetaData(Service.addEnrollmentSecret(this.service, enrollmentSecret), new Identity(enrollment));
}

Expand All @@ -104,7 +104,6 @@ public Registration enrollData(Registration registration) throws TiqrException {
Instant now = Instant.now();
registration.setCreated(now);
registration.setUpdated(now);
registration.setUseDocumentIdentifier(true);

Registration savedRegistration = registrationRepository.save(registration);

Expand Down Expand Up @@ -146,7 +145,7 @@ public Authentication startAuthentication(String userId, String userDisplayName,
String challenge = Challenge.generateQH10Challenge();
String authenticationUrl = String.format("%s/tiqrauth/?u=%s&s=%s&q=%s&i=%s&v=%s",
eduIdAppBaseUrl,
encode(registration.isUseDocumentIdentifier() ? registration.getId() : userId),
encode(userId),
encode(sessionKey),
encode(challenge),
encode(this.service.getIdentifier()),
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/tiqr/org/model/Identity.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class Identity {
private String displayName;

public Identity(Enrollment enrollment) {
this.identifier = enrollment.getId();
this.identifier = enrollment.getUserID();
this.displayName = enrollment.getUserDisplayName();
}
}
1 change: 0 additions & 1 deletion src/main/java/tiqr/org/model/Registration.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public class Registration implements Serializable {
private RegistrationStatus status;
private Instant created;
private Instant updated;
private boolean useDocumentIdentifier;

public void validateForInitialEnrollment() {
validateForPushNotification();
Expand Down
1 change: 0 additions & 1 deletion src/test/java/tiqr/org/TiqrServiceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ void enrollmentScenarioExistingInitializedRegistration() throws TiqrException {

private Registration getRegistration(String enrollmentSecret) {
Registration registration = new Registration();
registration.setId(UUID.randomUUID().toString());
registration.setUserId("user-id");
registration.setSecret(sharedSecret);
registration.setEnrollmentSecret(enrollmentSecret);
Expand Down

0 comments on commit 37caa31

Please sign in to comment.