Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- data UserSubsystem m a where
- GetUserProfiles :: Local UserId -> [Qualified UserId] -> UserSubsystem m [UserProfile]
- GetUserProfilesWithErrors :: Local UserId -> [Qualified UserId] -> UserSubsystem m ([(Qualified UserId, FederationError)], [UserProfile])
- GetLocalUserProfiles :: Local [UserId] -> UserSubsystem m [UserProfile]
- GetAccountsBy :: Local GetBy -> UserSubsystem m [User]
- GetAccountsByEmailNoFilter :: Local [EmailAddress] -> UserSubsystem m [User]
- GetAccountNoFilter :: Local UserId -> UserSubsystem m (Maybe User)
- GetSelfProfile :: Local UserId -> UserSubsystem m (Maybe SelfProfile)
- UpdateUserProfile :: Local UserId -> Maybe ConnId -> UpdateOriginType -> UserProfileUpdate -> UserSubsystem m ()
- CheckHandle :: Text -> UserSubsystem m CheckHandleResp
- CheckHandles :: [Handle] -> Word -> UserSubsystem m [Handle]
- UpdateHandle :: Local UserId -> Maybe ConnId -> UpdateOriginType -> Text -> UserSubsystem m ()
- LookupLocaleWithDefault :: Local UserId -> UserSubsystem m (Maybe Locale)
- IsBlocked :: EmailAddress -> UserSubsystem m Bool
- BlockListDelete :: EmailAddress -> UserSubsystem m ()
- BlockListInsert :: EmailAddress -> UserSubsystem m ()
- UpdateTeamSearchVisibilityInbound :: TeamStatus SearchVisibilityInboundConfig -> UserSubsystem m ()
- SearchUsers :: Local UserId -> Text -> Maybe Domain -> Maybe (Range 1 500 Int32) -> UserSubsystem m (SearchResult Contact)
- BrowseTeam :: UserId -> BrowseTeamFilters -> Maybe (Range 1 500 Int) -> Maybe PagingState -> UserSubsystem m (SearchResult TeamContact)
- AcceptTeamInvitation :: Local UserId -> PlainTextPassword6 -> InvitationCode -> UserSubsystem m ()
- InternalUpdateSearchIndex :: UserId -> UserSubsystem m ()
- InternalFindTeamInvitation :: Maybe EmailKey -> InvitationCode -> UserSubsystem m StoredInvitation
- GetUserExportData :: UserId -> UserSubsystem m (Maybe TeamExportUser)
- data UserProfileUpdate = MkUserProfileUpdate {}
- data UpdateOriginType
- data GetBy = MkGetBy {}
- data CheckHandleResp
- getLocalAccountBy :: Member UserSubsystem r => HavePendingInvitations -> Local UserId -> Sem r (Maybe User)
- getLocalUserAccountByUserKey :: Member UserSubsystem r => Local EmailKey -> Sem r (Maybe User)
- getSelfProfile :: forall r. Member UserSubsystem r => Local UserId -> Sem r (Maybe SelfProfile)
- isBlocked :: forall r. Member UserSubsystem r => EmailAddress -> Sem r Bool
- updateTeamSearchVisibilityInbound :: forall r. Member UserSubsystem r => TeamStatus SearchVisibilityInboundConfig -> Sem r ()
- searchUsers :: forall r. Member UserSubsystem r => Local UserId -> Text -> Maybe Domain -> Maybe (Range 1 500 Int32) -> Sem r (SearchResult Contact)
- updateHandle :: forall r. Member UserSubsystem r => Local UserId -> Maybe ConnId -> UpdateOriginType -> Text -> Sem r ()
- getUserProfile :: Member UserSubsystem r => Local UserId -> Qualified UserId -> Sem r (Maybe UserProfile)
- getUserProfiles :: forall r. Member UserSubsystem r => Local UserId -> [Qualified UserId] -> Sem r [UserProfile]
- getLocalUserProfile :: Member UserSubsystem r => Local UserId -> Sem r (Maybe UserProfile)
- getLocalUserProfiles :: forall r. Member UserSubsystem r => Local [UserId] -> Sem r [UserProfile]
- getAccountsBy :: forall r. Member UserSubsystem r => Local GetBy -> Sem r [User]
- getAccountsByEmailNoFilter :: forall r. Member UserSubsystem r => Local [EmailAddress] -> Sem r [User]
- ensurePermissions :: (IsPerm perm, Member GalleyAPIAccess r, Member (Error UserSubsystemError) r) => UserId -> TeamId -> [perm] -> Sem r ()
- getUserProfilesWithErrors :: forall r. Member UserSubsystem r => Local UserId -> [Qualified UserId] -> Sem r ([(Qualified UserId, FederationError)], [UserProfile])
- getAccountNoFilter :: forall r. Member UserSubsystem r => Local UserId -> Sem r (Maybe User)
- updateUserProfile :: forall r. Member UserSubsystem r => Local UserId -> Maybe ConnId -> UpdateOriginType -> UserProfileUpdate -> Sem r ()
- checkHandle :: forall r. Member UserSubsystem r => Text -> Sem r CheckHandleResp
- checkHandles :: forall r. Member UserSubsystem r => [Handle] -> Word -> Sem r [Handle]
- lookupLocaleWithDefault :: forall r. Member UserSubsystem r => Local UserId -> Sem r (Maybe Locale)
- blockListDelete :: forall r. Member UserSubsystem r => EmailAddress -> Sem r ()
- blockListInsert :: forall r. Member UserSubsystem r => EmailAddress -> Sem r ()
- browseTeam :: forall r. Member UserSubsystem r => UserId -> BrowseTeamFilters -> Maybe (Range 1 500 Int) -> Maybe PagingState -> Sem r (SearchResult TeamContact)
- acceptTeamInvitation :: forall r. Member UserSubsystem r => Local UserId -> PlainTextPassword6 -> InvitationCode -> Sem r ()
- internalUpdateSearchIndex :: forall r. Member UserSubsystem r => UserId -> Sem r ()
- internalFindTeamInvitation :: forall r. Member UserSubsystem r => Maybe EmailKey -> InvitationCode -> Sem r StoredInvitation
- getUserExportData :: forall r. Member UserSubsystem r => UserId -> Sem r (Maybe TeamExportUser)
- module Data.HavePendingInvitations
Documentation
data UserSubsystem m a where Source #
GetUserProfiles :: Local UserId -> [Qualified UserId] -> UserSubsystem m [UserProfile] | First arg is for authorization only. |
GetUserProfilesWithErrors :: Local UserId -> [Qualified UserId] -> UserSubsystem m ([(Qualified UserId, FederationError)], [UserProfile]) | These give us partial success and hide concurrency in the interpreter. (Nit-pick: a better return type for this might be `([Qualified ([UserId], FederationError)], [UserProfile])`, and then we'd probably need a function of type `([Qualified ([UserId], FederationError)], [UserProfile]) -> ([(Qualified UserId, FederationError)], [UserProfile])` to maintain API compatibility.) |
GetLocalUserProfiles :: Local [UserId] -> UserSubsystem m [UserProfile] | Sometimes we don't have any identity of a requesting user, and local profiles are public. |
GetAccountsBy :: Local GetBy -> UserSubsystem m [User] | Get the union of all user accounts matching the |
GetAccountsByEmailNoFilter :: Local [EmailAddress] -> UserSubsystem m [User] | Get user accounts matching the `[EmailAddress]` argument (accounts with missing identity and accounts with status /= active included). |
GetAccountNoFilter :: Local UserId -> UserSubsystem m (Maybe User) | Get user account by local user id (accounts with missing identity and accounts with status /= active included). |
GetSelfProfile :: Local UserId -> UserSubsystem m (Maybe SelfProfile) | Get |
UpdateUserProfile :: Local UserId -> Maybe ConnId -> UpdateOriginType -> UserProfileUpdate -> UserSubsystem m () | Simple updates (as opposed to, eg., handle, where we need to manage locks). Empty fields are ignored (not deleted). |
CheckHandle :: Text -> UserSubsystem m CheckHandleResp | Parse and lookup a handle. |
CheckHandles :: [Handle] -> Word -> UserSubsystem m [Handle] | Check a number of |
UpdateHandle :: Local UserId -> Maybe ConnId -> UpdateOriginType -> Text -> UserSubsystem m () | Parse and update a handle. Parsing may fail so this is effectful. |
LookupLocaleWithDefault :: Local UserId -> UserSubsystem m (Maybe Locale) | Return the user's locale (or the default locale if the users exists and has none). |
IsBlocked :: EmailAddress -> UserSubsystem m Bool | Check if an email is blocked. |
BlockListDelete :: EmailAddress -> UserSubsystem m () | Remove an email from the block list. |
BlockListInsert :: EmailAddress -> UserSubsystem m () | Add an email to the block list. |
UpdateTeamSearchVisibilityInbound :: TeamStatus SearchVisibilityInboundConfig -> UserSubsystem m () | |
SearchUsers :: Local UserId -> Text -> Maybe Domain -> Maybe (Range 1 500 Int32) -> UserSubsystem m (SearchResult Contact) | |
BrowseTeam :: UserId -> BrowseTeamFilters -> Maybe (Range 1 500 Int) -> Maybe PagingState -> UserSubsystem m (SearchResult TeamContact) | |
AcceptTeamInvitation :: Local UserId -> PlainTextPassword6 -> InvitationCode -> UserSubsystem m () | (... or does |
InternalUpdateSearchIndex :: UserId -> UserSubsystem m () | The following "internal" functions exists to support migration in this susbystem, after the migration this would just be an internal detail of the subsystem |
InternalFindTeamInvitation :: Maybe EmailKey -> InvitationCode -> UserSubsystem m StoredInvitation | |
GetUserExportData :: UserId -> UserSubsystem m (Maybe TeamExportUser) |
data UserProfileUpdate Source #
Simple updates (as opposed to, eg., handle, where we need to manage locks).
This is isomorphic to StoredUserUpdate
, but we keep the two types separate because they
belong to different abstraction levels (UserSubsystem vs. UserStore), and they may
change independently in the future (UserStoreUpdate
may grow more fields for other
operations).
Instances
data UpdateOriginType Source #
Who is performing this update operation / who is allowed to? (Single source of truth: users managed by SCIM can't be updated by clients and vice versa.)
UpdateOriginScim | Call originates from the SCIM api in spar. |
UpdateOriginWireClient | Call originates from wire client (mobile, web, or team-management). |
Instances
Parameters for getExternalAccountsBy
operation below.
MkGetBy | |
|
Instances
Arbitrary GetBy Source # | |
Generic GetBy Source # | |
Show GetBy Source # | |
Default GetBy Source # | |
Defined in Wire.UserSubsystem | |
Eq GetBy Source # | |
Ord GetBy Source # | |
type Rep GetBy Source # | |
Defined in Wire.UserSubsystem type Rep GetBy = D1 ('MetaData "GetBy" "Wire.UserSubsystem" "wire-subsystems-0.1.0-8kLXA8DL8T7Joz69IIRPwJ" 'False) (C1 ('MetaCons "MkGetBy" 'PrefixI 'True) (S1 ('MetaSel ('Just "includePendingInvitations") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 HavePendingInvitations) :*: (S1 ('MetaSel ('Just "getByUserId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [UserId]) :*: S1 ('MetaSel ('Just "getByHandle") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [Handle])))) |
data CheckHandleResp Source #
the return type of CheckHandle
Instances
Show CheckHandleResp Source # | |
Defined in Wire.UserSubsystem showsPrec :: Int -> CheckHandleResp -> ShowS # show :: CheckHandleResp -> String # showList :: [CheckHandleResp] -> ShowS # | |
Eq CheckHandleResp Source # | |
Defined in Wire.UserSubsystem (==) :: CheckHandleResp -> CheckHandleResp -> Bool # (/=) :: CheckHandleResp -> CheckHandleResp -> Bool # | |
Ord CheckHandleResp Source # | |
Defined in Wire.UserSubsystem compare :: CheckHandleResp -> CheckHandleResp -> Ordering # (<) :: CheckHandleResp -> CheckHandleResp -> Bool # (<=) :: CheckHandleResp -> CheckHandleResp -> Bool # (>) :: CheckHandleResp -> CheckHandleResp -> Bool # (>=) :: CheckHandleResp -> CheckHandleResp -> Bool # max :: CheckHandleResp -> CheckHandleResp -> CheckHandleResp # min :: CheckHandleResp -> CheckHandleResp -> CheckHandleResp # |
getLocalAccountBy :: Member UserSubsystem r => HavePendingInvitations -> Local UserId -> Sem r (Maybe User) Source #
getLocalUserAccountByUserKey :: Member UserSubsystem r => Local EmailKey -> Sem r (Maybe User) Source #
getSelfProfile :: forall r. Member UserSubsystem r => Local UserId -> Sem r (Maybe SelfProfile) Source #
Get SelfProfile
(it contains things not present in UserProfile
).
isBlocked :: forall r. Member UserSubsystem r => EmailAddress -> Sem r Bool Source #
Check if an email is blocked.
updateTeamSearchVisibilityInbound :: forall r. Member UserSubsystem r => TeamStatus SearchVisibilityInboundConfig -> Sem r () Source #
searchUsers :: forall r. Member UserSubsystem r => Local UserId -> Text -> Maybe Domain -> Maybe (Range 1 500 Int32) -> Sem r (SearchResult Contact) Source #
updateHandle :: forall r. Member UserSubsystem r => Local UserId -> Maybe ConnId -> UpdateOriginType -> Text -> Sem r () Source #
Parse and update a handle. Parsing may fail so this is effectful.
getUserProfile :: Member UserSubsystem r => Local UserId -> Qualified UserId -> Sem r (Maybe UserProfile) Source #
getUserProfiles :: forall r. Member UserSubsystem r => Local UserId -> [Qualified UserId] -> Sem r [UserProfile] Source #
First arg is for authorization only.
getLocalUserProfile :: Member UserSubsystem r => Local UserId -> Sem r (Maybe UserProfile) Source #
getLocalUserProfiles :: forall r. Member UserSubsystem r => Local [UserId] -> Sem r [UserProfile] Source #
Sometimes we don't have any identity of a requesting user, and local profiles are public.
getAccountsBy :: forall r. Member UserSubsystem r => Local GetBy -> Sem r [User] Source #
Get the union of all user accounts matching the GetBy
argument *and* having a non-empty UserIdentity.
getAccountsByEmailNoFilter :: forall r. Member UserSubsystem r => Local [EmailAddress] -> Sem r [User] Source #
Get user accounts matching the `[EmailAddress]` argument (accounts with missing identity and accounts with status /= active included).
ensurePermissions :: (IsPerm perm, Member GalleyAPIAccess r, Member (Error UserSubsystemError) r) => UserId -> TeamId -> [perm] -> Sem r () Source #
getUserProfilesWithErrors :: forall r. Member UserSubsystem r => Local UserId -> [Qualified UserId] -> Sem r ([(Qualified UserId, FederationError)], [UserProfile]) Source #
These give us partial success and hide concurrency in the interpreter. (Nit-pick: a better return type for this might be `([Qualified ([UserId], FederationError)], [UserProfile])`, and then we'd probably need a function of type `([Qualified ([UserId], FederationError)], [UserProfile]) -> ([(Qualified UserId, FederationError)], [UserProfile])` to maintain API compatibility.)
getAccountNoFilter :: forall r. Member UserSubsystem r => Local UserId -> Sem r (Maybe User) Source #
Get user account by local user id (accounts with missing identity and accounts with status /= active included).
updateUserProfile :: forall r. Member UserSubsystem r => Local UserId -> Maybe ConnId -> UpdateOriginType -> UserProfileUpdate -> Sem r () Source #
Simple updates (as opposed to, eg., handle, where we need to manage locks). Empty fields are ignored (not deleted).
checkHandle :: forall r. Member UserSubsystem r => Text -> Sem r CheckHandleResp Source #
Parse and lookup a handle.
checkHandles :: forall r. Member UserSubsystem r => [Handle] -> Word -> Sem r [Handle] Source #
lookupLocaleWithDefault :: forall r. Member UserSubsystem r => Local UserId -> Sem r (Maybe Locale) Source #
Return the user's locale (or the default locale if the users exists and has none).
blockListDelete :: forall r. Member UserSubsystem r => EmailAddress -> Sem r () Source #
Remove an email from the block list.
blockListInsert :: forall r. Member UserSubsystem r => EmailAddress -> Sem r () Source #
Add an email to the block list.
browseTeam :: forall r. Member UserSubsystem r => UserId -> BrowseTeamFilters -> Maybe (Range 1 500 Int) -> Maybe PagingState -> Sem r (SearchResult TeamContact) Source #
acceptTeamInvitation :: forall r. Member UserSubsystem r => Local UserId -> PlainTextPassword6 -> InvitationCode -> Sem r () Source #
(... or does AcceptTeamInvitation
belong into TeamInvitationSubsystems
?)
internalUpdateSearchIndex :: forall r. Member UserSubsystem r => UserId -> Sem r () Source #
The following "internal" functions exists to support migration in this susbystem, after the migration this would just be an internal detail of the subsystem
internalFindTeamInvitation :: forall r. Member UserSubsystem r => Maybe EmailKey -> InvitationCode -> Sem r StoredInvitation Source #
getUserExportData :: forall r. Member UserSubsystem r => UserId -> Sem r (Maybe TeamExportUser) Source #
module Data.HavePendingInvitations