Skip to content

Commit 5165e4d

Browse files
committed
Updated simulation
1 parent a3db784 commit 5165e4d

File tree

3 files changed

+404
-110
lines changed

3 files changed

+404
-110
lines changed

src/main/java/com/uid2/admin/salt/SaltRotation.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
public class SaltRotation {
2020
private static final long THIRTY_DAYS_IN_MS = Duration.ofDays(30).toMillis();
2121
private static final double MAX_SALT_PERCENTAGE = 0.8;
22-
private final boolean enableV4RawUid;
22+
private boolean enableV4RawUid;
2323

2424
private final IKeyGenerator keyGenerator;
2525

@@ -30,6 +30,10 @@ public SaltRotation(IKeyGenerator keyGenerator, JsonObject config) {
3030
this.enableV4RawUid = config.getBoolean(AdminConst.ENABLE_V4_RAW_UID, false);
3131
}
3232

33+
public void setEnableV4RawUid(boolean enableV4RawUid) {
34+
this.enableV4RawUid = enableV4RawUid;
35+
}
36+
3337
public Result rotateSalts(
3438
SaltSnapshot lastSnapshot,
3539
Duration[] minAges,
@@ -167,7 +171,7 @@ private SaltEntry.KeyMaterial calculateCurrentKeySalt(SaltEntry bucket, boolean
167171
if (enableV4RawUid) {
168172
return new SaltEntry.KeyMaterial(
169173
keyIdGenerator.getNextKeyId(),
170-
this.keyGenerator.generateRandomKeyString(24),
174+
this.keyGenerator.generateRandomKeyString(24), // TODO: FIX
171175
this.keyGenerator.generateRandomKeyString(32)
172176
);
173177
} else {

0 commit comments

Comments
 (0)