mirror of
https://github.com/signalapp/Signal-Server.git
synced 2026-12-02 11:56:53 +00:00
Add UAK validator to AccountAttributes
This commit is contained in:
1 parent
b551e0cb34
commit
149de6c464
3 files changed
+54
-6
No files matched your search
+13
@@ -139,9 +139,22 @@ public class AccountAttributes {
|
||||
return this;
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
public AccountAttributes withUnrestrictedUnidentifiedAccess(final boolean unrestrictedUnidentifiedAccess) {
|
||||
this.unrestrictedUnidentifiedAccess = unrestrictedUnidentifiedAccess;
|
||||
return this;
|
||||
}
|
||||
|
||||
@AssertTrue
|
||||
@Schema(hidden = true)
|
||||
public boolean isEachRegistrationIdValid() {
|
||||
return validRegistrationId(registrationId) && validRegistrationId(phoneNumberIdentityRegistrationId);
|
||||
}
|
||||
|
||||
@AssertTrue
|
||||
@Schema(hidden = true)
|
||||
public boolean isUakValid() {
|
||||
return (unrestrictedUnidentifiedAccess && (unidentifiedAccessKey == null || unidentifiedAccessKey.length == 0))
|
||||
|| (!unrestrictedUnidentifiedAccess && (unidentifiedAccessKey != null && unidentifiedAccessKey.length == 16));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user