Skip to content

Commit 9d7b133

Browse files
committed
Drop many-to-many uniqueIds
1 parent 5cc7e8a commit 9d7b133

File tree

2 files changed

+15
-29
lines changed

2 files changed

+15
-29
lines changed

src/inttest/java/com/faforever/api/data/PlayerElideTest.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ public void restrictedResultWithoutScope() throws Exception {
4848
.andExpect(jsonPath("$.data[1].attributes", not(hasKey("lastLogin"))))
4949
.andExpect(jsonPath("$.data[2].attributes", not(hasKey("lastLogin"))))
5050
.andExpect(jsonPath("$.data[3].attributes", not(hasKey("lastLogin"))))
51-
.andExpect(jsonPath("$.data[0].relationships", not(hasKey("uniqueIds"))))
52-
.andExpect(jsonPath("$.data[1].relationships", not(hasKey("uniqueIds"))))
53-
.andExpect(jsonPath("$.data[2].relationships", not(hasKey("uniqueIds"))))
54-
.andExpect(jsonPath("$.data[3].relationships", not(hasKey("uniqueIds"))))
51+
.andExpect(jsonPath("$.data[0].relationships", not(hasKey("uniqueIdAssignments"))))
52+
.andExpect(jsonPath("$.data[1].relationships", not(hasKey("uniqueIdAssignments"))))
53+
.andExpect(jsonPath("$.data[2].relationships", not(hasKey("uniqueIdAssignments"))))
54+
.andExpect(jsonPath("$.data[3].relationships", not(hasKey("uniqueIdAssignments"))))
5555
.andExpect(jsonPath("$.data[0].relationships", not(hasKey("accountLinks"))))
5656
.andExpect(jsonPath("$.data[1].relationships", not(hasKey("accountLinks"))))
5757
.andExpect(jsonPath("$.data[2].relationships", not(hasKey("accountLinks"))))
@@ -64,7 +64,7 @@ public void restrictedResultWithoutScope() throws Exception {
6464
.andExpect(jsonPath("$.data[4].relationships", hasKey("userGroups")))
6565
.andExpect(jsonPath("$.data[4].relationships", hasKey("accountLinks")))
6666
// you cannot see your uuid
67-
.andExpect(jsonPath("$.data[4].relationships", not(hasKey("uniqueIds"))))
67+
.andExpect(jsonPath("$.data[4].relationships", not(hasKey("uniqueIdAssignments"))))
6868
// nobody can see passwords!
6969
.andExpect(jsonPath("$.data[0].attributes", not(hasKey("password"))))
7070
.andExpect(jsonPath("$.data[1].attributes", not(hasKey("password"))))
@@ -107,10 +107,10 @@ public void restrictedResultWithoutRole() throws Exception {
107107
.andExpect(jsonPath("$.data[1].attributes", not(hasKey("lastLogin"))))
108108
.andExpect(jsonPath("$.data[2].attributes", not(hasKey("lastLogin"))))
109109
.andExpect(jsonPath("$.data[3].attributes", not(hasKey("lastLogin"))))
110-
.andExpect(jsonPath("$.data[0].relationships", not(hasKey("uniqueIds"))))
111-
.andExpect(jsonPath("$.data[1].relationships", not(hasKey("uniqueIds"))))
112-
.andExpect(jsonPath("$.data[2].relationships", not(hasKey("uniqueIds"))))
113-
.andExpect(jsonPath("$.data[3].relationships", not(hasKey("uniqueIds"))))
110+
.andExpect(jsonPath("$.data[0].relationships", not(hasKey("uniqueIdAssignments"))))
111+
.andExpect(jsonPath("$.data[1].relationships", not(hasKey("uniqueIdAssignments"))))
112+
.andExpect(jsonPath("$.data[2].relationships", not(hasKey("uniqueIdAssignments"))))
113+
.andExpect(jsonPath("$.data[3].relationships", not(hasKey("uniqueIdAssignments"))))
114114
.andExpect(jsonPath("$.data[0].relationships", not(hasKey("accountLinks"))))
115115
.andExpect(jsonPath("$.data[1].relationships", not(hasKey("accountLinks"))))
116116
.andExpect(jsonPath("$.data[2].relationships", not(hasKey("accountLinks"))))
@@ -123,7 +123,7 @@ public void restrictedResultWithoutRole() throws Exception {
123123
.andExpect(jsonPath("$.data[4].relationships", hasKey("userGroups")))
124124
.andExpect(jsonPath("$.data[4].relationships", hasKey("accountLinks")))
125125
// you cannot see your uuid
126-
.andExpect(jsonPath("$.data[4].relationships", not(hasKey("uniqueIds"))))
126+
.andExpect(jsonPath("$.data[4].relationships", not(hasKey("uniqueIdAssignments"))))
127127
// nobody can see passwords!
128128
.andExpect(jsonPath("$.data[0].attributes", not(hasKey("password"))))
129129
.andExpect(jsonPath("$.data[1].attributes", not(hasKey("password"))))
@@ -169,11 +169,11 @@ public void canSeePrivateDetailsWithScopeAndRole() throws Exception {
169169
.andExpect(jsonPath("$.data[2].attributes", hasKey("lastLogin")))
170170
.andExpect(jsonPath("$.data[3].attributes", hasKey("lastLogin")))
171171
.andExpect(jsonPath("$.data[4].attributes", hasKey("lastLogin")))
172-
.andExpect(jsonPath("$.data[0].relationships", hasKey("uniqueIds")))
173-
.andExpect(jsonPath("$.data[1].relationships", hasKey("uniqueIds")))
174-
.andExpect(jsonPath("$.data[2].relationships", hasKey("uniqueIds")))
175-
.andExpect(jsonPath("$.data[3].relationships", hasKey("uniqueIds")))
176-
.andExpect(jsonPath("$.data[4].relationships", hasKey("uniqueIds")))
172+
.andExpect(jsonPath("$.data[0].relationships", hasKey("uniqueIdAssignments")))
173+
.andExpect(jsonPath("$.data[1].relationships", hasKey("uniqueIdAssignments")))
174+
.andExpect(jsonPath("$.data[2].relationships", hasKey("uniqueIdAssignments")))
175+
.andExpect(jsonPath("$.data[3].relationships", hasKey("uniqueIdAssignments")))
176+
.andExpect(jsonPath("$.data[4].relationships", hasKey("uniqueIdAssignments")))
177177
.andExpect(jsonPath("$.data[0].relationships", hasKey("accountLinks")))
178178
.andExpect(jsonPath("$.data[1].relationships", hasKey("accountLinks")))
179179
.andExpect(jsonPath("$.data[2].relationships", hasKey("accountLinks")))

src/main/java/com/faforever/api/data/domain/Login.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414

1515
import jakarta.persistence.Column;
1616
import jakarta.persistence.FetchType;
17-
import jakarta.persistence.JoinColumn;
18-
import jakarta.persistence.JoinTable;
1917
import jakarta.persistence.ManyToMany;
2018
import jakarta.persistence.MappedSuperclass;
2119
import jakarta.persistence.OneToMany;
@@ -39,7 +37,6 @@ public abstract class Login extends AbstractEntity<Login> implements OwnableEnti
3937
private Set<UserGroup> userGroups;
4038
private String recentIpAddress;
4139
private OffsetDateTime lastLogin;
42-
private Set<UniqueId> uniqueIds;
4340
private Set<UniqueIdAssignment> uniqueIdAssignments;
4441

4542

@@ -123,17 +120,6 @@ public Set<UserGroup> getUserGroups() {
123120
return userGroups;
124121
}
125122

126-
@Deprecated(forRemoval = true)
127-
@OneToMany
128-
@JoinTable(name = "unique_id_users",
129-
joinColumns = @JoinColumn(name = "user_id"),
130-
inverseJoinColumns = @JoinColumn(name = "uniqueid_hash", referencedColumnName = "hash")
131-
)
132-
@ReadPermission(expression = ReadAccountPrivateDetailsCheck.EXPRESSION)
133-
public Set<UniqueId> getUniqueIds() {
134-
return uniqueIds;
135-
}
136-
137123
@OneToMany(mappedBy = "user")
138124
@ReadPermission(expression = ReadAccountPrivateDetailsCheck.EXPRESSION)
139125
public Set<UniqueIdAssignment> getUniqueIdAssignments() {

0 commit comments

Comments
 (0)