-
Notifications
You must be signed in to change notification settings - Fork 332
[WPB-8887] wire-subsystems: implement the GetBy* account queries, includes InvitationCodeStore. #4218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
[WPB-8887] wire-subsystems: implement the GetBy* account queries, includes InvitationCodeStore. #4218
Changes from all commits
Commits
Show all changes
102 commits
Select commit
Hold shift + click to select a range
20e4f5e
[wip] initial impl for GetBy* account queries as Effect and interpreter
elland 59f1995
[feat] implement mock interpreters
MangoIV 1bf730e
[chore] format
MangoIV 87ffbb6
[wip] wrap up the invitationcodestore
elland 136418a
Typo
elland 2027fed
Fixed overcorrection.
elland 28f5665
Cleaning.
elland 81eb543
Clean getFields.
elland 0eb772e
Moved invitation info to Store
elland fdad7ac
In-memory store for invitation info.
elland 96c0b01
Account for inviteeUrl visibility.
elland 64660b3
Cleaned extensions.
elland 4020568
Fix ad-hoc deletion logic for invited users.
elland 243ad32
Updated wire-subsystem nix.
elland 08e15ac
[chore] remove some unnecessary types
MangoIV 1fd3321
[chore] move count invitations to InvitationCodeStore
MangoIV c56f7c7
[wip] move lookupInvitations paginaged to InvitationCodeStore
MangoIV 13eddee
Moved InsertInvitation to InvitationCodeStore, moved Timeout.
elland 4591c39
[fix] missing SELECT in cql.
elland 47e7ea1
Improved comment.
elland c9333f0
Added deletion to InvitationCodeStore.
elland 58c3078
Regen nix derivations.
elland e510fd4
Added changelog.
elland 27b572e
Removed indices from cql.
elland 61ec10e
Update libs/wire-api/src/Wire/API/Team/Invitation.hs
fisx c32143b
Update libs/wire-subsystems/src/Wire/InvitationCodeStore/Cassandra.hs
fisx fa97637
Update libs/wire-subsystems/src/Wire/InvitationCodeStore.hs
elland ab1a1ed
Cleaned up + review feedback.
elland e948768
Renamed effect function.
elland 301c39d
Moved Timeout.
elland 86a9641
Update changelog.d/5-internal/wpb-8887
elland 34061ea
Renamed lookupAccounts to getUsers.
elland bfb00e1
Added comments to similarly named functions.
elland 27f859f
Restore behaviour for getInvitation.
elland fbd48cb
Make route names unique.
fisx 5a5d9ee
weeder.
fisx a581e6c
one more helper function in UserSubsystem.
fisx 954394d
Get local domain from api in some more places. [WIP]
fisx 90ad39c
Cleaned up.
elland f6c0f9b
Lint
elland ac6e48d
WIP: Remove extra Timeout type
elland 28398db
Tweak changelog.
fisx 3d3ee05
Simplify UserSubsystem operations set (resolves TODO).
fisx b28e04a
Fix user activation, add include pending activation to GetBy.
elland f26be09
nix
elland 61a1e82
Apply suggestions from code review
elland 7451319
Fix getBy usage.
elland 90d95e0
Fix password tests.
elland 9787b42
Fixed bugs and added GetBy tests.
elland 4aaf25e
Removed unnecessary filter.
elland 629b882
Fixed another logic error in invitation pending.
elland dc74199
Removed Wwarns, added a type to document the insert effect.
elland 02ed2fa
Merge remote-tracking branch 'origin/develop' into mangoiv/wpb-8887
fisx c2ee5df
wip (fix errors from merge)
fisx c6afad5
Update libs/wire-subsystems/src/Wire/PasswordResetCodeStore/Cassandra.hs
fisx 561a361
Make it compile again
f7f76cd
Fix a Cassandra query for StoredUser
5c500d4
Hi ci
elland 29fcb2e
Apply feedback / cleanup.
elland db1491a
Removed export from Cassandra interpreter, use Effect.
elland 163fc18
[chore] Improved order of checks for PR sanitising.
elland 4578fe4
Fixed bug in filtering users.
elland ee0a946
Merge branch 'develop' into mangoiv/wpb-8887
elland d5b704d
Fix user lookup by passing include pending invitations
elland 78b8660
Revert "WIP: Remove extra Timeout type"
elland 7b93beb
[fix] adhere to the old behaviour of the getby query
MangoIV 3254a77
Polish getBy query (not changing behavior).
fisx eb068f3
hi ci
elland 66c9548
Attempt to fix tests.
elland 33473b2
[fix] revert to old behaviour in Brig/API/User
MangoIV 526d16d
Fixed invinite loop when deleting users.
elland 4215146
Fixed semantics, expand for detail ->
elland bb4ca46
Fix self/delete.
elland 3798401
Merge remote-tracking branch 'origin/develop' into mangoiv/wpb-8887
elland 5f93ba7
Added property tests for getBy semantics.
elland cebf28c
Extracted by emails from GetBy, more tests!
elland 8b3393b
rm overly ambitious TODO.
fisx b720716
rm trailing whitespace.
fisx 872329f
rm self-evident FIXME.
fisx ebebba8
Give better names to two UserSubsystem operations.
fisx a18ffd6
nit-pick.
fisx cf7ec8b
resolve FUTUREWORK.
fisx f9e829b
Fix / polish haddock in UserSubsystem.
fisx 16858c6
Tweak legacy integration test.
fisx 962203c
Mark (occasionally) failing test case.
fisx b8cf6bc
Make function pure.
elland c3639ad
Replaced coerce with unsafe perform IO.
elland 012ee66
Revert accidental change to log levels.
elland e79db04
Simplify UserStore.
fisx 948fd9b
Remove spurious FUTUREWORK.
fisx d73f38d
No!
fisx 342ece2
Extend prop test coverage.
fisx 7f7eaa9
rm bogus FUTUREWORK.
fisx 3eb60ca
Haddocks.
fisx fa76f75
Weed out the weeed
elland 7188ee5
Merge remote-tracking branch 'refs/remotes/origin/mangoiv/wpb-8887' i…
elland f7034e6
Regen nix.
elland c0aef87
rm some highly dubious weed.
fisx d1dd8e9
Merge remote-tracking branch 'refs/remotes/origin/mangoiv/wpb-8887' i…
fisx 2879694
Fix compiler warnings.
fisx 1e61e31
Merge remote-tracking branch 'origin/develop' into mangoiv/wpb-8887
fisx 6b5637c
hi ci
fisx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| New user subsystem operation `getAccountsBy` for complex account lookups. |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -91,3 +91,4 @@ import Cassandra.Exec as C | |
| x1, | ||
| x5, | ||
| ) | ||
| import Cassandra.QQ as C (sql) | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| {-# LANGUAGE TemplateHaskellQuotes #-} | ||
|
|
||
| module Cassandra.QQ (sql) where | ||
|
|
||
| import Imports | ||
| import Language.Haskell.TH | ||
| import Language.Haskell.TH.Quote (QuasiQuoter (..)) | ||
|
|
||
| -- | a simple quasi quoter to allow for tree-sitter syntax highlight injection. | ||
| -- This uses the name sql because that is known to tree-sitter, unlike cql | ||
| sql :: QuasiQuoter | ||
| sql = | ||
| QuasiQuoter | ||
| { quotePat = error "Cassandra.QQ: sql quasiquoter cannot be used as pattern", | ||
| quoteType = error "Cassandra.QQ: sql quasiquoter cannot be used as type", | ||
| quoteDec = error "Cassandra.QQ: sql quasiquoter cannot be used as declaration", | ||
| quoteExp = appE [|fromString|] . stringE | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| module Data.HavePendingInvitations where | ||
|
|
||
| import Imports | ||
| import Wire.Arbitrary | ||
|
|
||
| data HavePendingInvitations | ||
| = WithPendingInvitations | ||
| | NoPendingInvitations | ||
| deriving (Eq, Show, Ord, Generic) | ||
| deriving (Arbitrary) via GenericUniform HavePendingInvitations | ||
|
|
||
| fromBool :: Bool -> HavePendingInvitations | ||
| fromBool True = WithPendingInvitations | ||
| fromBool False = NoPendingInvitations |
This file contains hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| module Util.Timeout | ||
| ( Timeout (..), | ||
| module Data.Time.Clock, | ||
| ) | ||
| where | ||
|
|
||
| import Data.Aeson | ||
| import Data.Aeson.Types | ||
| import Data.Scientific | ||
| import Data.Time.Clock | ||
| import Imports | ||
|
|
||
| newtype Timeout = Timeout | ||
elland marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| { timeoutDiff :: NominalDiffTime | ||
| } | ||
| deriving newtype (Eq, Enum, Ord, Num, Real, Fractional, RealFrac, Show) | ||
|
|
||
| instance Read Timeout where | ||
| readsPrec i s = | ||
| case readsPrec i s of | ||
| [(x :: Int, s')] -> [(Timeout (fromIntegral x), s')] | ||
| _ -> [] | ||
|
|
||
| instance FromJSON Timeout where | ||
| parseJSON (Number n) = | ||
| let defaultV = 3600 | ||
| bounded = toBoundedInteger n :: Maybe Int64 | ||
| in pure $ | ||
| Timeout $ | ||
| fromIntegral @Int $ | ||
| maybe defaultV fromIntegral bounded | ||
| parseJSON v = typeMismatch "activationTimeout" v | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.