mirror of
https://github.com/signalapp/Signal-Server.git
synced 2026-12-01 06:26:47 +00:00
Add gRPC size annotations; allow non-empty UAK for unrestricted
This commit is contained in:
1 parent
c70674ed26
commit
f7b928f1a8
3 files changed
+4
-5
No files matched your search
+2
-3
@@ -139,9 +139,8 @@ public class AccountAttributes {
|
||||
@Schema(hidden = true)
|
||||
public boolean isUnrestrictedUakValid() {
|
||||
|
||||
final boolean valid =
|
||||
(unrestrictedUnidentifiedAccess && (unidentifiedAccessKey == null || unidentifiedAccessKey.length == 0))
|
||||
|| (!unrestrictedUnidentifiedAccess && (unidentifiedAccessKey != null
|
||||
final boolean valid = unrestrictedUnidentifiedAccess ||
|
||||
(!unrestrictedUnidentifiedAccess && (unidentifiedAccessKey != null
|
||||
&& unidentifiedAccessKey.length == 16));
|
||||
|
||||
Metrics.counter(UAK_VALIDATION_COUNTER_NAME,
|
||||
|
||||
@@ -197,7 +197,7 @@ message ConfigureUnidentifiedAccessRequest {
|
||||
// anonymously (i.e. to retrieve keys or profiles or to send messages) unless
|
||||
// unrestricted unidentified access is permitted. Must be present if
|
||||
// unrestricted unidentified access is not allowed.
|
||||
bytes unidentified_access_key = 1;
|
||||
bytes unidentified_access_key = 1 [(require.exactlySize) = 0, (require.exactlySize) = 16];
|
||||
|
||||
// If `true`, any user may interact with this account anonymously without
|
||||
// providing an unidentified access key. Otherwise, users must provide the
|
||||
|
||||
+1
-1
@@ -802,7 +802,7 @@ class AccountControllerTest {
|
||||
Arguments.argumentSet("restricted, non-empty UAK", false, new byte[16], 204),
|
||||
Arguments.argumentSet("unrestricted, empty UAK", true, new byte[0], 204),
|
||||
Arguments.argumentSet("restricted, empty UAK", false, new byte[0], 422),
|
||||
Arguments.argumentSet("unrestricted, non-empty UAK", true, new byte[16], 422)
|
||||
Arguments.argumentSet("unrestricted, non-empty UAK", true, new byte[16], 204)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user