-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2. In InputUtil, renamed Identity* member variable/methods to Dii* to indicate it's Dii 3. Change TokenUtils class getIdentityHash to getDiiHash and same for getDiiHashString
- Loading branch information
Showing
20 changed files
with
293 additions
and
298 deletions.
There are no files selected for viewing
8 changes: 4 additions & 4 deletions
8
...com/uid2/operator/model/IdentityType.java → ...d2/operator/model/identities/DiiType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 2 additions & 5 deletions
7
src/main/java/com/uid2/operator/model/identities/FirstLevelHash.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,19 @@ | ||
package com.uid2.operator.model.identities; | ||
|
||
import com.uid2.operator.model.IdentityScope; | ||
import com.uid2.operator.model.IdentityType; | ||
|
||
import java.time.Instant; | ||
import java.util.Arrays; | ||
|
||
/** | ||
* Contains a first level salted hash computed from Hashed DII (email/phone number) | ||
* @param establishedAt for brand new token generation, it should be the time it is generated if the first level hash is from token/refresh call, it will be when the raw UID was originally created in the earliest token generation | ||
*/ | ||
public record FirstLevelHash(IdentityScope identityScope, IdentityType identityType, byte[] firstLevelHash, | ||
public record FirstLevelHash(IdentityScope identityScope, DiiType diiType, byte[] firstLevelHash, | ||
Instant establishedAt) { | ||
|
||
// explicitly not checking establishedAt - this is only for making sure the first level hash matches a new input | ||
public boolean matches(FirstLevelHash that) { | ||
return this.identityScope.equals(that.identityScope) && | ||
this.identityType.equals(that.identityType) && | ||
this.diiType.equals(that.diiType) && | ||
Arrays.equals(this.firstLevelHash, that.firstLevelHash); | ||
} | ||
} |
8 changes: 3 additions & 5 deletions
8
src/main/java/com/uid2/operator/model/identities/HashedDii.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
package com.uid2.operator.model.identities; | ||
|
||
import com.uid2.operator.model.IdentityScope; | ||
import com.uid2.operator.model.IdentityType; | ||
|
||
// Contains a hash DII, | ||
// Contains a hash Directly Identifying Information (DII) (email or phone) see https://unifiedid.com/docs/ref-info/glossary-uid#gl-dii | ||
// This hash can either be computed from a raw email/phone number DII input or provided by the UID Participant directly | ||
public record HashedDii(IdentityScope identityScope, IdentityType identityType, byte[] hashedDii) { | ||
// | ||
public record HashedDii(IdentityScope identityScope, DiiType diiType, byte[] hashedDii) { | ||
} |
2 changes: 1 addition & 1 deletion
2
...java/com/uid2/operator/IdentityConst.java → ...rator/model/identities/IdentityConst.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...om/uid2/operator/model/IdentityScope.java → ...rator/model/identities/IdentityScope.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,13 @@ | ||
package com.uid2.operator.model.identities; | ||
|
||
import com.uid2.operator.model.IdentityScope; | ||
import com.uid2.operator.model.IdentityType; | ||
|
||
import java.util.Arrays; | ||
|
||
// A raw UID is stored inside | ||
public record RawUid(IdentityScope identityScope, IdentityType identityType, byte[] rawUid) { | ||
public record RawUid(IdentityScope identityScope, DiiType diiType, byte[] rawUid) { | ||
|
||
public boolean matches(RawUid that) { | ||
return this.identityScope.equals(that.identityScope) && | ||
this.identityType.equals(that.identityType) && | ||
this.diiType.equals(that.diiType) && | ||
Arrays.equals(this.rawUid, that.rawUid); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.