Commit Graph

1135 Commits

Author SHA1 Message Date
Chris Eager eb86986cf4 Add /v2/directory/auth endpoint 2021-11-08 14:30:52 -07:00
Ehren Kret 1053a47e42 Add an exception mapper for CompletionExceptions 2021-11-04 19:12:31 -05:00
Ehren Kret 99b1f48e0e Copy badges from existing account on re-reg 2021-11-04 18:00:47 -05:00
Jon Chambers 6dddf54222 Consolidate rate-limit counters 2021-11-01 14:33:05 -04:00
Jon Chambers c931103712 Remove unused utility classes 2021-11-01 10:51:47 -04:00
Jon Chambers ad1aeea74b Add an abusive message filter interface and submodule 2021-11-01 10:51:47 -04:00
Ehren Kret ae7f8af03e Mark boost and subscription configuration as not null 2021-10-28 16:12:23 -07:00
Ehren Kret a52c91a665 Add names to subscription levels 2021-10-28 14:48:44 -07:00
Ehren Kret 94bf3a3902 Extract logic for created header controlled resource bundles 2021-10-28 14:26:53 -07:00
Ehren Kret f5a539e128 Add subscriptions resource bundle 2021-10-28 14:15:20 -07:00
Ehren Kret 24480b2090 Add endpoint to fetch information on boost badges 2021-10-26 14:05:59 -07:00
Ehren Kret a124b3abe9 Fix encoding of boost amounts 2021-10-26 08:08:09 -07:00
Ehren Kret 090d722b61 Add method to retrieve receipt credentials for a boost payment 2021-10-25 14:54:40 -07:00
Ehren Kret d27ec6fe8d Create boost create endpoint 2021-10-25 12:58:32 -07:00
Jon Chambers 8d34f3447b Drop an unused registration meter 2021-10-25 14:52:21 -04:00
Ehren Kret 72b52965b9 Expand definition of badge SVGs 2021-10-25 10:28:02 -07:00
Jon Chambers ae7077c643
Refresh accounts from storage when checking for device state changes after requests 2021-10-22 14:02:28 -04:00
Jon Chambers 11598e855f Count non-normalized or impossible numbers 2021-10-22 14:01:54 -04:00
Jon Chambers 534c577f59 Enforce phone number normalization when creating accounts or changing numbers 2021-10-22 14:01:54 -04:00
Jon Chambers 7762afc497 Add a method for verifying that numbers are normalized in addition to being dialable 2021-10-22 14:01:54 -04:00
Jon Chambers a3fe4b9980 Update/parameterize ValidNumberTest 2021-10-22 14:01:54 -04:00
Jon Chambers 598599cd14 Use a default `reportMessage` configuration if not specified 2021-10-21 15:34:57 -05:00
Ehren Kret 07cd69ab34 Add endpoint for fetching boost amounts 2021-10-21 13:56:35 -05:00
Jon Chambers 3b764bed7a Make `DynamicConfigurationManager` generic 2021-10-19 11:52:29 -04:00
Jon Chambers c91d5c2fdb Count reported messages per sender 2021-10-19 11:47:54 -04:00
Jon Chambers 40f7e6e994 Remove unused imports 2021-10-19 11:47:54 -04:00
Ehren Kret ee9aa9ce12 Round up by days on receipt expiration 2021-10-18 12:11:27 -05:00
Ehren Kret 08304bf375 Validate GetReceiptCredentialsRequest 2021-10-18 11:57:18 -05:00
Ehren Kret 8b8c6237be Use last subscription created at time as a subscription generation number 2021-10-14 12:06:19 -05:00
Ehren Kret c0837104cd Bring badge configuration into levels information 2021-10-14 11:35:18 -05:00
Jon Chambers fe21d014f7 Remove legacy rate-limiting tools 2021-10-14 11:43:18 -04:00
Ehren Kret 75c5032cd3 Add method to set default payment method 2021-10-14 10:37:12 -05:00
Jon Chambers f84e7aebd0 Count numbers that can't be normalized because another account has the normalized form of the number 2021-10-14 11:10:12 -04:00
Jon Chambers c379a3d297 Remove deprecated counters 2021-10-14 10:52:20 -04:00
Jon Chambers eedeaaecee Update rate-limiting for requests matching specific criteria 2021-10-14 10:42:16 -04:00
Ehren Kret 64eeb1e361 Move to using collections for sprites and svgs for badges 2021-10-13 23:25:39 -05:00
Ehren Kret e07597eba7 Add initial text for donation badges 2021-10-13 23:08:02 -05:00
Ehren Kret 5f2656710c Update badge configuration to new style 2021-10-13 22:58:57 -05:00
Ehren Kret 1af53f2612 Simplify getLevels API 2021-10-13 13:28:31 -05:00
Ehren Kret c89cfa4927 Move property setting above servlet construction 2021-10-13 13:17:07 -05:00
Ehren Kret bbde93a3c7 Enable unwrapping of CompletionStage 2021-10-13 11:46:20 -05:00
Ehren Kret b01b76d78f
First pass at subscriptions API
This is an incomplete first pass at building the subscriptions API. More API endpoints are still to be added along with controller tests.
2021-10-12 21:23:20 -05:00
Ehren Kret 75c22038eb Create empty Badges_en.properties file 2021-10-11 22:27:30 -05:00
Jon Chambers 3c1705994d Count accounts with non-normalized phone numbers 2021-10-11 10:13:08 -04:00
Chris Eager d2bc3c7360 Add dynamic configuration to disable directory reconciler 2021-10-04 14:38:47 -07:00
Jon Chambers 9734433f00 Use the default `SecureRandom` algorithm for tests 2021-10-04 11:37:32 -04:00
Ehren Kret 5bd08800bb Remove public modifier from test class 2021-10-01 14:27:07 -05:00
Ehren Kret 3032415141
Add receipt redemption API to chat server 2021-10-01 12:44:47 -05:00
Jon Chambers ba58a95a0f Add support for changing phone numbers 2021-10-01 10:15:33 -04:00
Jon Chambers aa4bd92fee Lazy-load scripts; fall back to `eval` if `evalsha` returns `NOSCRIPT` 2021-09-29 16:08:17 -04:00
Jon Chambers f37c76dab1 Drop `LuaScript` 2021-09-29 16:08:17 -04:00
Jon Chambers 863969c77c Resolve ClusterLuaScript warnings/suggestions 2021-09-29 16:08:17 -04:00
Jon Chambers 2383aaaa3d Update ClusterLuaScript formatting 2021-09-29 16:08:17 -04:00
Jon Chambers 715d1157ad Reject Redis commands when disconnected 2021-09-29 16:07:26 -04:00
Jon Chambers 4aaae3f445 Use a single configuration URI for Redis clusters 2021-09-29 14:46:09 -04:00
Jon Chambers 8359ef73f4 Cycle all connected websockets on any device or account enabled state change 2021-09-29 14:18:35 -04:00
Jon Chambers c6bb649adb Simplify map-building logic 2021-09-29 14:18:35 -04:00
Jon Chambers e333cbd94d Close websockets on account deletion 2021-09-29 14:11:16 -04:00
Chris Eager 5189cbe5c7 apply editorconfig formatting 2021-09-29 10:31:39 -07:00
Chris Eager d1d6e5c652 Filter stale ephemeral messages from cache 2021-09-29 10:31:39 -07:00
Chris Eager 3e5087e60b Remove obsolete ephemeral queue handling 2021-09-29 10:31:39 -07:00
Chris Eager 93c3cea912 Clean up old "ephemeral" metrics 2021-09-29 10:31:39 -07:00
Chris Eager e824b861d4 Drop `accounts` table 2021-09-29 10:31:20 -07:00
Chris Eager e8dd1e0bf2 Fixup formatting 2021-09-29 10:31:20 -07:00
Ehren Kret 559026933d Add low and high detail svgs to badges 2021-09-27 17:00:09 -05:00
Ehren Kret 7864405efd Remove single URL in favor of density based sprite sheets 2021-09-27 16:50:18 -05:00
Jon Chambers a5575902de Pause if we bump into an exception while trying to persist messages 2021-09-27 13:38:17 -04:00
Ehren Kret 041aed2d72 Remove zkgroup enabled flag
The last remnants of a time before zkgroup have been swept away.
2021-09-23 09:24:06 -05:00
Jon Chambers 02a296e500 Use a MIME Base64 decoder for provisioning messages 2021-09-22 16:30:44 -04:00
Jon Chambers 98e41f9a37
Improve Redis exception handling 2021-09-22 10:31:39 -04:00
Chris Eager 6a71d369e2
More Accounts cleanup
* Remove `AccountStore`
* Clean up `AccountsDynamoDb#delete`
* Rename `AccountsDynamoDb` → `Accounts`
* Remove unused configuration
* Move Accounts scan page size to static configuration
* Remove disabled tests and related methods
2021-09-21 15:25:16 -07:00
Ehren Kret 75661fa800 Add JavaTimeModule 2021-09-20 16:42:38 -05:00
Ehren Kret df5498e1c0 Add test for self badge fetching 2021-09-20 16:42:38 -05:00
Ehren Kret c0af911197 Show invisible badges to query for self 2021-09-20 16:42:38 -05:00
Ehren Kret 44bc90e5ab Return a badge with additional properties when fetching your own profile 2021-09-20 16:42:38 -05:00
Ehren Kret 5c1cde1b28 Add visibility modifying helper method in AccountBadge 2021-09-20 16:41:09 -05:00
Ehren Kret 3172b571c6 Move "testing" string into BadgeConfiguration 2021-09-20 16:41:09 -05:00
Ehren Kret 17e8b77e88 Add unit test for setting badges 2021-09-20 16:41:09 -05:00
Ehren Kret 8011935a3b Fix compilation issues created by constructor changes 2021-09-20 16:41:09 -05:00
Ehren Kret 3f3052c23c Remove isZkEnabled 2021-09-20 16:41:09 -05:00
Ehren Kret 8f17f45339 Reorder creating of testing badges
Need their expiration time to always get refreshed on set so reorder
how they're created to ensure that's the case.
2021-09-20 16:41:09 -05:00
Ehren Kret 009e2eeb97 Enable editing of badges on profiles 2021-09-20 16:41:09 -05:00
Ehren Kret c70fa48835 Fix indentation of ProfileController#setProfile 2021-09-20 16:41:09 -05:00
Ehren Kret bd5f5c407b Add method to merge badge ids list into a profile 2021-09-20 16:41:09 -05:00
Ehren Kret 2bc573a53d Add additional test badges for translation 2021-09-20 16:41:09 -05:00
Ehren Kret 537d61d5bd Add badges to CreateProfileRequest
This will permit users to set the order and visibility of badges on
their profile.
2021-09-20 16:41:09 -05:00
Jon Chambers 09519ae942 Only retry websocket sending if the client is still connected 2021-09-20 14:24:07 -04:00
Chris Eager 2a67b2e610
Remove Accounts Postgres 2021-09-20 11:10:24 -07:00
Chris Eager 8161f55a82 Add dynamic configuration for setting Dynamo as primary 2021-09-17 13:28:45 -07:00
Chris Eager ecee189ad8 Add `AccountDatabaseCrawler.dedicatedDynamoMigrationCrawler` 2021-09-17 11:27:20 -07:00
Fedor Indutny 383d744bd8
Log the error message when retrying queue send 2021-09-16 18:03:42 -04:00
Jon Chambers c2ba8ab562 Identify receipt destinations by UUID instead of e164 2021-09-16 10:47:03 -04:00
Chris Eager cd49ea43c0 Use `queryPaginator` when loading messages 2021-09-16 10:46:37 -04:00
Chris Eager 53aa45a2bb Use `queryPaginator` when deleting messages 2021-09-16 10:46:37 -04:00
Chris Eager 83e0a19561 Migrate `MessagesDynamoDbRule` to `MessagesDynamoDbExtension` 2021-09-16 10:46:37 -04:00
Jon Chambers 6a5d475198 Add a "refresh websocket on number change" provider 2021-09-16 10:37:34 -04:00
Jon Chambers 49ccbba2e3 Generalize the "watch for websockets that need to be refreshed" listener 2021-09-16 10:37:34 -04:00
Fedor Indutnyy 41735ed40e Introduce queueDrainRetry counter metric 2021-09-16 10:30:19 -04:00
Ehren Kret 2d11a433c9 Wrap all calls to getAcceptableLanguages
ContainerRequestContext#getAcceptableLanguages throws a
ProcessingException if the header has invalid values in it. Rather than
error out of the request entirely with the exception handler for that
exception, we just treat it as though no Accept-Languages header was
specified.
2021-09-16 09:28:21 -05:00
Ehren Kret e79ab2521f Rename field in ConfiguredProfileBadgeConverter 2021-09-16 09:28:21 -05:00
Ehren Kret fb1f99da87 Add a method to enable a badge for all accounts 2021-09-16 09:28:21 -05:00
Ehren Kret 08c6a8c2e5 Add category to badges 2021-09-16 09:28:21 -05:00
Ehren Kret ce3835e176 Rename id to name in the configuration 2021-09-16 09:28:21 -05:00
Ehren Kret 39f6eadbb9 Add test for add and remove badges 2021-09-16 09:28:21 -05:00
Ehren Kret 16dba09b61 Handle merging badges when adding to account 2021-09-16 09:28:21 -05:00
Ehren Kret d5ebf2f2ed Rename name to id in Account#removeBadge 2021-09-16 09:28:21 -05:00
Ehren Kret 8a8e6e7b49 Rename name to id in the stored badge information and expose id in the profile endpoint 2021-09-16 09:28:21 -05:00
Ehren Kret 34e21b9f7b Change name to id on AccountBadge
This makes it distinct from the localized name field on the Badge
entity that is returned.
2021-09-16 09:28:21 -05:00
Ehren Kret 98a31d1474 Switch ProfileController to the actual badge converter 2021-09-16 09:28:21 -05:00
Chris Eager 72a0c1be0f Tune mismatch logging 2021-09-15 16:46:10 -07:00
Ehren Kret 5b25e38e41 Ensure badges are in ordered collections 2021-09-15 16:20:15 -05:00
Chris Eager 2fb400280b Remove unused parameter from `deleteMessageByDestinationAndGuid` 2021-09-15 10:14:08 -07:00
Ehren Kret 79ad09524e
Implement the ProfileBadgeConverter interface 2021-09-15 10:32:20 -05:00
Chris Eager 5f8accb492 Add acceptable languages from request to variable 2021-09-14 17:43:39 -07:00
Chris Eager 6fcadc2297 Handle exception reading `Accept-Language` header 2021-09-13 18:07:16 -07:00
Chris Eager 3f4e1522eb Only put accounts that exhaust optimistic lock retries in migration retry table 2021-09-13 15:00:01 -07:00
Graeme Connell 6304c84cdb Add ContactDiscoveryWriterTest based on mock. 2021-09-13 15:20:21 -06:00
Chris Eager 894297efa9 Add dynamic configuration for doing a mismatch post-check 2021-09-13 13:54:19 -07:00
Chris Eager a51a7a0901 Add `MigrationMismatchedAccounts` to `AccountsManager` 2021-09-13 13:54:19 -07:00
Chris Eager 372e131e25 Update `PaymentsControllerTest` 2021-09-13 09:58:42 -07:00
Sophiah Ho cd66a1ceb7
fix merge issue after 2021 Aug 15 commit d1735c7e57 (#137) 2021-09-13 09:39:11 -07:00
Sophiah Ho feb59deb28
Use BigDecimal instead of Double for currency rate calculations (#134)
use BigDecimal instead of double for accuracy
2021-09-10 16:15:57 -05:00
Nicolas Remond 489519a982 Use Map.of() for statically defined map 2021-09-10 14:27:18 -05:00
Chris Eager 6a6555e2d5 Add metrics for AuthEnablementRequestEventListener displacements 2021-09-10 12:01:05 -07:00
Chris Eager 49489a6021 Re-check mismatched accounts after a delay, to avoid false positives from concurrent requests 2021-09-10 11:31:44 -07:00
Chris Eager 8cd93d68e4 Add MetricsUtil 2021-09-10 11:31:44 -07:00
Chris Eager f3b9a8d97f Add account to migration retry table on transient dynamo failure 2021-09-10 11:30:49 -07:00
Chris Eager b91a69d8b3 Add asynchronous chunk pre-read to `AccountDatabaseCrawler` 2021-09-10 11:14:11 -07:00
Chris Eager 624e40e3b7 Add separate `AccountsDatabaseCrawler` for DynamoDB migration 2021-09-10 11:14:11 -07:00
Chris Eager 23a076a204 Update `Account#getNextDeviceId` to not reuse disable device’s IDs 2021-09-10 10:48:48 -07:00
Chris Eager 016141a05d Add `DevicesHelper` 2021-09-10 10:48:48 -07:00
Graeme Connell a064b25a14 Fix CDS writer to use AccountsManager. 2021-09-10 11:36:06 -06:00
Ehren Kret bd40e32f3b Send acceptable languages instead of request into the profile badge converter 2021-09-10 10:53:04 -05:00
Ehren Kret 81a21c0d5f Use @NotNull since @NotEmpty doesn't support URL 2021-09-10 10:49:31 -05:00
Ehren Kret 6478210330 Update configuration for badges to use URL instead of String 2021-09-10 10:49:31 -05:00
Ehren Kret aa1c37fe26 Create configuration for badges 2021-09-10 10:14:16 -05:00
Ehren Kret 6ee23b0186 Create resource bundle for badges 2021-09-10 10:11:56 -05:00
Jon Chambers 40eb445592 Add a command to set a user's discoverability in CDS 2021-09-10 10:34:20 -04:00
Jon Chambers ce7d687205 Add a shutdown monitor that publishes shutdown state as a metric 2021-09-08 16:37:05 -04:00
Chris Eager 758900b7a8 Register AuthEnablementApplicationEventListener 2021-09-08 13:11:09 -07:00
Chris Eager 539b62a829 Add request event listener that handles device.isEnabled changes 2021-09-08 13:11:09 -07:00
Jon Chambers 2866f1b213 Include e164 in account creation (whoami) responses 2021-09-07 16:52:32 -04:00
Ehren Kret fc1465c05d Wire up stored account badges to the profile endpoints 2021-09-07 15:51:29 -05:00
Ehren Kret bc887ec6fa Add visibility flag to badge storage 2021-09-07 15:50:29 -05:00
Ehren Kret 84b3d324bb Creates a storage object for badges 2021-09-07 15:49:41 -05:00
Ehren Kret fc10108788 Make fields final in Badge entity 2021-09-07 15:39:48 -05:00
Ehren Kret fbbc1bec58 Add badge entity to profile 2021-09-07 15:39:48 -05:00
Graeme Connell 2059bb5ef8 Update test to handle read-then-write in ContactDiscoveryWriter. 2021-09-07 13:41:47 -06:00
gram-signal b080a5db4d Get-and-set accounts, since other updates may have made them stale.
Co-authored-by: Chris Eager <79161849+eager-signal@users.noreply.github.com>
2021-09-07 13:41:47 -06:00
Graeme Connell b4aabd799b Canonical discoverability writing. 2021-09-07 13:41:47 -06:00