| Copyright | (c) simplex.chat |
|---|---|
| License | AGPL-3 |
| Maintainer | chat@simplex.chat |
| Stability | experimental |
| Portability | non-portable |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Simplex.Messaging.Agent.Protocol
Description
Types, parsers, serializers and functions to send and receive SMP agent protocol commands and responses.
See https://github.com/simplex-chat/simplexmq/blob/master/protocol/agent-protocol.md
Synopsis
- type VersionSMPA = Version SMPAgentVersion
- type VersionRangeSMPA = VersionRange SMPAgentVersion
- pattern VersionSMPA :: Word16 -> VersionSMPA
- duplexHandshakeSMPAgentVersion :: VersionSMPA
- ratchetSyncSMPAgentVersion :: VersionSMPA
- deliveryRcptsSMPAgentVersion :: VersionSMPA
- pqdrSMPAgentVersion :: VersionSMPA
- sndAuthKeySMPAgentVersion :: VersionSMPA
- ratchetOnConfSMPAgentVersion :: VersionSMPA
- currentSMPAgentVersion :: VersionSMPA
- supportedSMPAgentVRange :: VersionRangeSMPA
- e2eEncConnInfoLength :: VersionSMPA -> PQSupport -> Int
- e2eEncAgentMsgLength :: VersionSMPA -> PQSupport -> Int
- type ConnInfo = ByteString
- type SndQueueSecured = Bool
- type AEntityId = ByteString
- data ACommand
- = NEW Bool AConnectionMode InitialKeys SubscriptionMode
- | LSET (UserConnLinkData 'CMContact) (Maybe CRClientData)
- | LGET (ConnShortLink 'CMContact)
- | JOIN Bool AConnectionRequestUri PQSupport SubscriptionMode ConnInfo
- | LET ConfirmationId ConnInfo
- | ACK AgentMsgId (Maybe MsgReceiptInfo)
- | SWCH
- | DEL
- data AEvent (e :: AEntity) where
- INV :: AConnectionRequestUri -> Maybe ClientServiceId -> AEvent AEConn
- LINK :: ConnShortLink 'CMContact -> UserConnLinkData 'CMContact -> AEvent AEConn
- LDATA :: FixedLinkData 'CMContact -> ConnLinkData 'CMContact -> AEvent AEConn
- CONF :: ConfirmationId -> PQSupport -> [SMPServer] -> ConnInfo -> AEvent AEConn
- REQ :: InvitationId -> PQSupport -> NonEmpty SMPServer -> ConnInfo -> AEvent AEConn
- INFO :: PQSupport -> ConnInfo -> AEvent AEConn
- CON :: PQEncryption -> AEvent AEConn
- END :: AEvent AEConn
- DELD :: AEvent AEConn
- CONNECT :: AProtocolType -> TransportHost -> AEvent AENone
- DISCONNECT :: AProtocolType -> TransportHost -> AEvent AENone
- DOWN :: SMPServer -> [ConnId] -> AEvent AENone
- UP :: SMPServer -> [ConnId] -> AEvent AENone
- SWITCH :: QueueDirection -> SwitchPhase -> ConnectionStats -> AEvent AEConn
- RSYNC :: RatchetSyncState -> Maybe AgentCryptoError -> ConnectionStats -> AEvent AEConn
- SENT :: AgentMsgId -> Maybe SMPServer -> AEvent AEConn
- MWARN :: AgentMsgId -> AgentErrorType -> AEvent AEConn
- MERR :: AgentMsgId -> AgentErrorType -> AEvent AEConn
- MERRS :: NonEmpty AgentMsgId -> AgentErrorType -> AEvent AEConn
- MSG :: MsgMeta -> MsgFlags -> MsgBody -> AEvent AEConn
- MSGNTF :: MsgId -> Maybe UTCTime -> AEvent AEConn
- RCVD :: MsgMeta -> NonEmpty MsgReceipt -> AEvent AEConn
- QCONT :: AEvent AEConn
- DEL_RCVQS :: NonEmpty (ConnId, SMPServer, RecipientId, Maybe AgentErrorType) -> AEvent AEConn
- DEL_CONNS :: NonEmpty ConnId -> AEvent AEConn
- DEL_USER :: Int64 -> AEvent AENone
- STAT :: ConnectionStats -> AEvent AEConn
- OK :: AEvent AEConn
- JOINED :: SndQueueSecured -> Maybe ClientServiceId -> AEvent AEConn
- ERR :: AgentErrorType -> AEvent AEConn
- ERRS :: NonEmpty (ConnId, AgentErrorType) -> AEvent AENone
- SUSPENDED :: AEvent AENone
- RFPROG :: Int64 -> Int64 -> AEvent AERcvFile
- RFDONE :: FilePath -> AEvent AERcvFile
- RFERR :: AgentErrorType -> AEvent AERcvFile
- RFWARN :: AgentErrorType -> AEvent AERcvFile
- SFPROG :: Int64 -> Int64 -> AEvent AESndFile
- SFDONE :: ValidFileDescription 'FSender -> [ValidFileDescription 'FRecipient] -> AEvent AESndFile
- SFERR :: AgentErrorType -> AEvent AESndFile
- SFWARN :: AgentErrorType -> AEvent AESndFile
- data AEvt = forall e.AEntityI e => AEvt (SAEntity e) (AEvent e)
- data ACommandTag
- data AEventTag (e :: AEntity) where
- INV_ :: AEventTag AEConn
- LINK_ :: AEventTag AEConn
- LDATA_ :: AEventTag AEConn
- CONF_ :: AEventTag AEConn
- REQ_ :: AEventTag AEConn
- INFO_ :: AEventTag AEConn
- CON_ :: AEventTag AEConn
- END_ :: AEventTag AEConn
- DELD_ :: AEventTag AEConn
- CONNECT_ :: AEventTag AENone
- DISCONNECT_ :: AEventTag AENone
- DOWN_ :: AEventTag AENone
- UP_ :: AEventTag AENone
- SWITCH_ :: AEventTag AEConn
- RSYNC_ :: AEventTag AEConn
- SENT_ :: AEventTag AEConn
- MWARN_ :: AEventTag AEConn
- MERR_ :: AEventTag AEConn
- MERRS_ :: AEventTag AEConn
- MSG_ :: AEventTag AEConn
- MSGNTF_ :: AEventTag AEConn
- RCVD_ :: AEventTag AEConn
- QCONT_ :: AEventTag AEConn
- DEL_RCVQS_ :: AEventTag AEConn
- DEL_CONNS_ :: AEventTag AEConn
- DEL_USER_ :: AEventTag AENone
- STAT_ :: AEventTag AEConn
- OK_ :: AEventTag AEConn
- JOINED_ :: AEventTag AEConn
- ERR_ :: AEventTag AEConn
- ERRS_ :: AEventTag AENone
- SUSPENDED_ :: AEventTag AENone
- RFDONE_ :: AEventTag AERcvFile
- RFPROG_ :: AEventTag AERcvFile
- RFERR_ :: AEventTag AERcvFile
- RFWARN_ :: AEventTag AERcvFile
- SFPROG_ :: AEventTag AESndFile
- SFDONE_ :: AEventTag AESndFile
- SFERR_ :: AEventTag AESndFile
- SFWARN_ :: AEventTag AESndFile
- data AEvtTag = forall e.AEntityI e => AEvtTag (SAEntity e) (AEventTag e)
- aCommandTag :: ACommand -> ACommandTag
- aEventTag :: AEvent e -> AEventTag e
- data AEntity
- data SAEntity :: AEntity -> Type where
- class AEntityI (e :: AEntity) where
- type MsgHash = ByteString
- data MsgMeta = MsgMeta {
- integrity :: MsgIntegrity
- recipient :: (AgentMsgId, UTCTime)
- broker :: (MsgId, UTCTime)
- sndMsgId :: AgentMsgId
- pqEncryption :: PQEncryption
- data RcvQueueInfo = RcvQueueInfo {
- rcvServer :: SMPServer
- status :: QueueStatus
- rcvSwitchStatus :: Maybe RcvSwitchStatus
- canAbortSwitch :: Bool
- subStatus :: SubscriptionStatus
- data SndQueueInfo = SndQueueInfo {
- sndServer :: SMPServer
- status :: QueueStatus
- sndSwitchStatus :: Maybe SndSwitchStatus
- data SubscriptionStatus
- data ConnectionStats = ConnectionStats {}
- data SwitchPhase
- data RcvSwitchStatus
- data SndSwitchStatus
- data QueueDirection
- data RatchetSyncState
- = RSOk
- | RSAllowed
- | RSRequired
- | RSStarted
- | RSAgreed
- data SMPConfirmation = SMPConfirmation {}
- data AgentMsgEnvelope
- = AgentConfirmation {
- agentVersion :: VersionSMPA
- e2eEncryption_ :: Maybe (SndE2ERatchetParams 'X448)
- encConnInfo :: ByteString
- | AgentMsgEnvelope {
- agentVersion :: VersionSMPA
- encAgentMessage :: ByteString
- | AgentInvitation {
- agentVersion :: VersionSMPA
- connReq :: ConnectionRequestUri 'CMInvitation
- connInfo :: ByteString
- | AgentRatchetKey {
- agentVersion :: VersionSMPA
- e2eEncryption :: RcvE2ERatchetParams 'X448
- info :: ByteString
- = AgentConfirmation {
- data AgentMessage
- = AgentConnInfo ConnInfo
- | AgentConnInfoReply (NonEmpty SMPQueueInfo) ConnInfo
- | AgentRatchetInfo ByteString
- | AgentMessage APrivHeader AMessage
- data AgentMessageType
- data APrivHeader = APrivHeader {}
- data AMessage
- = HELLO
- | A_MSG MsgBody
- | A_RCVD (NonEmpty AMessageReceipt)
- | A_QCONT SndQAddr
- | QADD (NonEmpty (SMPQueueUri, Maybe SndQAddr))
- | QKEY (NonEmpty (SMPQueueInfo, SndPublicAuthKey))
- | QUSE (NonEmpty (SndQAddr, Bool))
- | QTEST (NonEmpty SndQAddr)
- | EREADY AgentMsgId
- data AMessageReceipt = AMessageReceipt {}
- data MsgReceipt = MsgReceipt {}
- type MsgReceiptInfo = ByteString
- data MsgReceiptStatus
- = MROk
- | MRBadMsgHash
- type SndQAddr = (SMPServer, SenderId)
- type SMPServer = ProtocolServer 'PSMP
- pattern SMPServer :: NonEmpty TransportHost -> ServiceName -> KeyHash -> ProtocolServer 'PSMP
- pattern ProtoServerWithAuth :: ProtocolServer p -> Maybe BasicAuth -> ProtoServerWithAuth p
- type SMPServerWithAuth = ProtoServerWithAuth 'PSMP
- data SrvLoc = SrvLoc HostName ServiceName
- class SMPQueue q where
- qAddress :: SMPQueue q => q -> (SMPServer, QueueId)
- sameQueue :: SMPQueue q => (SMPServer, QueueId) -> q -> Bool
- sameQAddress :: (SMPServer, QueueId) -> (SMPServer, QueueId) -> Bool
- noAuthSrv :: ProtocolServer p -> ProtoServerWithAuth p
- data SMPQueueUri = SMPQueueUri {}
- data SMPQueueInfo = SMPQueueInfo {}
- data SMPQueueAddress = SMPQueueAddress {
- smpServer :: SMPServer
- senderId :: SenderId
- dhPublicKey :: PublicKeyX25519
- queueMode :: Maybe QueueMode
- data ConnectionMode
- data SConnectionMode (m :: ConnectionMode) where
- data AConnectionMode = forall m.ConnectionModeI m => ACM (SConnectionMode m)
- class ConnectionModeI (m :: ConnectionMode) where
- data ConnectionRequestUri (m :: ConnectionMode) where
- data AConnectionRequestUri = forall m.ConnectionModeI m => ACR (SConnectionMode m) (ConnectionRequestUri m)
- data ShortLinkCreds = ShortLinkCreds {}
- data ConnReqUriData = ConnReqUriData {
- crScheme :: ServiceScheme
- crAgentVRange :: VersionRangeSMPA
- crSmpQueues :: NonEmpty SMPQueueUri
- crClientData :: Maybe CRClientData
- type CRClientData = Text
- data ServiceScheme
- data FixedLinkData c = FixedLinkData {
- agentVRange :: VersionRangeSMPA
- rootKey :: PublicKeyEd25519
- linkConnReq :: ConnectionRequestUri c
- linkEntityId :: Maybe ByteString
- data AConnLinkData = forall m.ConnectionModeI m => ACLD (SConnectionMode m) (ConnLinkData m)
- data ConnLinkData c where
- data AUserConnLinkData = forall m.ConnectionModeI m => AULD (SConnectionMode m) (UserConnLinkData m)
- data UserConnLinkData c where
- data UserContactData = UserContactData {
- direct :: Bool
- owners :: [OwnerAuth]
- relays :: [ConnShortLink 'CMContact]
- userData :: UserLinkData
- newtype UserLinkData = UserLinkData ByteString
- data OwnerAuth = OwnerAuth {}
- type OwnerId = ByteString
- data ConnectionLink m
- = CLFull (ConnectionRequestUri m)
- | CLShort (ConnShortLink m)
- data AConnectionLink = forall m.ConnectionModeI m => ACL (SConnectionMode m) (ConnectionLink m)
- data ConnShortLink (m :: ConnectionMode) where
- CSLInvitation :: ShortLinkScheme -> SMPServer -> LinkId -> LinkKey -> ConnShortLink 'CMInvitation
- CSLContact :: ShortLinkScheme -> ContactConnType -> SMPServer -> LinkKey -> ConnShortLink 'CMContact
- data AConnShortLink = forall m.ConnectionModeI m => ACSL (SConnectionMode m) (ConnShortLink m)
- data CreatedConnLink m = CCLink {
- connFullLink :: ConnectionRequestUri m
- connShortLink :: Maybe (ConnShortLink m)
- data ACreatedConnLink = forall m.ConnectionModeI m => ACCL (SConnectionMode m) (CreatedConnLink m)
- data ContactConnType
- data ShortLinkScheme
- newtype LinkKey = LinkKey ByteString
- data PreparedLinkParams = PreparedLinkParams {}
- data StoredClientService (s :: DBStored) = ClientService {
- dbServiceId :: DBEntityId' s
- serviceId :: ServiceId
- type ClientService = StoredClientService 'DBStored
- type ClientServiceId = DBEntityId
- validateOwners :: Maybe ShortLinkCreds -> UserContactData -> Either String ()
- validateLinkOwners :: PublicKeyEd25519 -> [OwnerAuth] -> Either String ()
- sameConnReqContact :: ConnectionRequestUri 'CMContact -> ConnectionRequestUri 'CMContact -> Bool
- sameShortLinkContact :: ConnShortLink 'CMContact -> ConnShortLink 'CMContact -> Bool
- simplexChat :: ServiceScheme
- connReqUriP' :: forall m. ConnectionModeI m => Maybe ServiceScheme -> Parser (ConnectionRequestUri m)
- simplexConnReqUri :: ConnectionRequestUri m -> ConnectionRequestUri m
- simplexShortLink :: ConnShortLink m -> ConnShortLink m
- data AgentErrorType
- = CMD {
- cmdErr :: CommandErrorType
- errContext :: String
- | CONN {
- connErr :: ConnectionErrorType
- errContext :: String
- | NO_USER
- | SMP {
- serverAddress :: String
- smpErr :: ErrorType
- | NTF {
- serverAddress :: String
- ntfErr :: ErrorType
- | XFTP {
- serverAddress :: String
- xftpErr :: XFTPErrorType
- | FILE { }
- | PROXY {
- proxyServer :: String
- relayServer :: String
- proxyErr :: ProxyClientError
- | RCP { }
- | BROKER {
- brokerAddress :: String
- brokerErr :: BrokerErrorType
- | AGENT { }
- | NOTICE { }
- | INTERNAL {
- internalErr :: String
- | CRITICAL {
- offerRestart :: Bool
- criticalErr :: String
- | INACTIVE
- = CMD {
- data CommandErrorType
- = PROHIBITED
- | SYNTAX
- | NO_CONN
- | SIZE
- | LARGE
- data ConnectionErrorType
- data BrokerErrorType
- = RESPONSE {
- respErr :: String
- | UNEXPECTED {
- respErr :: String
- | NETWORK { }
- | HOST
- | NO_SERVICE
- | TRANSPORT { }
- | TIMEOUT
- = RESPONSE {
- data SMPAgentError
- = A_MESSAGE
- | A_PROHIBITED {
- prohibitedErr :: String
- | A_VERSION
- | A_LINK {
- linkErr :: String
- | A_CRYPTO { }
- | A_DUPLICATE {
- droppedMsg_ :: Maybe DroppedMsg
- | A_QUEUE {
- queueErr :: String
- data DroppedMsg = DroppedMsg {}
- data AgentCryptoError
- = DECRYPT_AES
- | DECRYPT_CB
- | RATCHET_HEADER
- | RATCHET_EARLIER Word32
- | RATCHET_SKIPPED Word32
- | RATCHET_SYNC
- cryptoErrToSyncState :: AgentCryptoError -> RatchetSyncState
- type ATransmission = (ACorrId, AEntityId, AEvt)
- type ConnId = ByteString
- type ConfirmationId = ByteString
- type InvitationId = ByteString
- data MsgIntegrity
- data MsgErrorType
- = MsgSkipped { }
- | MsgBadId {
- msgId :: AgentMsgId
- | MsgBadHash
- | MsgDuplicate
- data QueueStatus
- type UserId = Int64
- type ACorrId = ByteString
- type AgentMsgId = Int64
- data NotificationsMode
- data NotificationInfo = NotificationInfo {
- ntfConnId :: ConnId
- ntfDbQueueId :: Int64
- ntfTs :: SystemTime
- ntfMsgMeta :: Maybe NMsgMeta
- data ConnMsgReq = ConnMsgReq {
- msgConnId :: ConnId
- msgDbQueueId :: Int64
- msgTs :: Maybe UTCTime
- serializeCommand :: ACommand -> ByteString
- connMode :: SConnectionMode m -> ConnectionMode
- connMode' :: ConnectionMode -> AConnectionMode
- dbCommandP :: Parser ACommand
- connModeT :: Text -> Maybe ConnectionMode
- serializeQueueStatus :: QueueStatus -> Text
- queueStatusT :: Text -> Maybe QueueStatus
- agentMessageType :: AgentMessage -> AgentMessageType
- aMessageType :: AMessage -> AgentMessageType
- extraSMPServerHosts :: Map TransportHost TransportHost
- updateSMPServerHosts :: SMPServer -> SMPServer
- shortenShortLink :: NonEmpty SMPServer -> ConnShortLink m -> ConnShortLink m
- restoreShortLink :: NonEmpty SMPServer -> ConnShortLink m -> ConnShortLink m
- isPresetServer :: Foldable t => SMPServer -> t SMPServer -> Bool
- linkUserData :: ConnLinkData c -> UserLinkData
- linkUserData' :: ConnLinkData c -> ByteString
Protocol parameters
type VersionSMPA = Version SMPAgentVersion Source #
type VersionRangeSMPA = VersionRange SMPAgentVersion Source #
pattern VersionSMPA :: Word16 -> VersionSMPA Source #
e2eEncConnInfoLength :: VersionSMPA -> PQSupport -> Int Source #
e2eEncAgentMsgLength :: VersionSMPA -> PQSupport -> Int Source #
SMP agent protocol types
type SndQueueSecured = Bool Source #
Constructors
data AEvent (e :: AEntity) where Source #
Parameterized type for SMP agent events
Constructors
data ACommandTag Source #
Instances
| Show ACommandTag Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> ACommandTag -> ShowS show :: ACommandTag -> String showList :: [ACommandTag] -> ShowS | |
| StrEncoding ACommandTag Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods strEncode :: ACommandTag -> ByteString Source # strDecode :: ByteString -> Either String ACommandTag Source # strP :: Parser ACommandTag Source # | |
data AEventTag (e :: AEntity) where Source #
Constructors
aCommandTag :: ACommand -> ACommandTag Source #
data SAEntity :: AEntity -> Type where Source #
Constructors
| SAEConn :: SAEntity AEConn | |
| SAERcvFile :: SAEntity AERcvFile | |
| SAESndFile :: SAEntity AESndFile | |
| SAENone :: SAEntity AENone |
Instances
| TestEquality SAEntity Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods testEquality :: forall (a :: k) (b :: k). SAEntity a -> SAEntity b -> Maybe (a :~: b) | |
| Show (SAEntity e) Source # | |
Agent message metadata sent to the client
Constructors
| MsgMeta | |
Fields
| |
data RcvQueueInfo Source #
Constructors
| RcvQueueInfo | |
Fields
| |
Instances
| FromJSON RcvQueueInfo Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods parseJSON :: Value -> Parser RcvQueueInfo parseJSONList :: Value -> Parser [RcvQueueInfo] omittedField :: Maybe RcvQueueInfo | |
| ToJSON RcvQueueInfo Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods toJSON :: RcvQueueInfo -> Value toEncoding :: RcvQueueInfo -> Encoding toJSONList :: [RcvQueueInfo] -> Value toEncodingList :: [RcvQueueInfo] -> Encoding omitField :: RcvQueueInfo -> Bool | |
| Show RcvQueueInfo Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> RcvQueueInfo -> ShowS show :: RcvQueueInfo -> String showList :: [RcvQueueInfo] -> ShowS | |
| Eq RcvQueueInfo Source # | |
Defined in Simplex.Messaging.Agent.Protocol | |
data SndQueueInfo Source #
Constructors
| SndQueueInfo | |
Fields
| |
Instances
| FromJSON SndQueueInfo Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods parseJSON :: Value -> Parser SndQueueInfo parseJSONList :: Value -> Parser [SndQueueInfo] omittedField :: Maybe SndQueueInfo | |
| ToJSON SndQueueInfo Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods toJSON :: SndQueueInfo -> Value toEncoding :: SndQueueInfo -> Encoding toJSONList :: [SndQueueInfo] -> Value toEncodingList :: [SndQueueInfo] -> Encoding omitField :: SndQueueInfo -> Bool | |
| Show SndQueueInfo Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> SndQueueInfo -> ShowS show :: SndQueueInfo -> String showList :: [SndQueueInfo] -> ShowS | |
| Eq SndQueueInfo Source # | |
Defined in Simplex.Messaging.Agent.Protocol | |
data SubscriptionStatus Source #
Instances
data ConnectionStats Source #
Constructors
| ConnectionStats | |
Fields
| |
Instances
| FromJSON ConnectionStats Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods parseJSON :: Value -> Parser ConnectionStats parseJSONList :: Value -> Parser [ConnectionStats] omittedField :: Maybe ConnectionStats | |
| ToJSON ConnectionStats Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods toJSON :: ConnectionStats -> Value toEncoding :: ConnectionStats -> Encoding toJSONList :: [ConnectionStats] -> Value toEncodingList :: [ConnectionStats] -> Encoding omitField :: ConnectionStats -> Bool | |
| Show ConnectionStats Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> ConnectionStats -> ShowS show :: ConnectionStats -> String showList :: [ConnectionStats] -> ShowS | |
| Eq ConnectionStats Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods (==) :: ConnectionStats -> ConnectionStats -> Bool (/=) :: ConnectionStats -> ConnectionStats -> Bool | |
data SwitchPhase Source #
Constructors
| SPStarted | |
| SPConfirmed | |
| SPSecured | |
| SPCompleted |
Instances
| FromJSON SwitchPhase Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods parseJSON :: Value -> Parser SwitchPhase parseJSONList :: Value -> Parser [SwitchPhase] omittedField :: Maybe SwitchPhase | |
| ToJSON SwitchPhase Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods toJSON :: SwitchPhase -> Value toEncoding :: SwitchPhase -> Encoding toJSONList :: [SwitchPhase] -> Value toEncodingList :: [SwitchPhase] -> Encoding omitField :: SwitchPhase -> Bool | |
| Show SwitchPhase Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> SwitchPhase -> ShowS show :: SwitchPhase -> String showList :: [SwitchPhase] -> ShowS | |
| Eq SwitchPhase Source # | |
Defined in Simplex.Messaging.Agent.Protocol | |
data RcvSwitchStatus Source #
Constructors
| RSSwitchStarted | |
| RSSendingQADD | |
| RSSendingQUSE | |
| RSReceivedMessage |
Instances
data SndSwitchStatus Source #
Constructors
| SSSendingQKEY | |
| SSSendingQTEST |
Instances
data QueueDirection Source #
Instances
| FromJSON QueueDirection Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods parseJSON :: Value -> Parser QueueDirection parseJSONList :: Value -> Parser [QueueDirection] omittedField :: Maybe QueueDirection | |
| ToJSON QueueDirection Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods toJSON :: QueueDirection -> Value toEncoding :: QueueDirection -> Encoding toJSONList :: [QueueDirection] -> Value toEncodingList :: [QueueDirection] -> Encoding omitField :: QueueDirection -> Bool | |
| Show QueueDirection Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> QueueDirection -> ShowS show :: QueueDirection -> String showList :: [QueueDirection] -> ShowS | |
| Eq QueueDirection Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods (==) :: QueueDirection -> QueueDirection -> Bool (/=) :: QueueDirection -> QueueDirection -> Bool | |
data RatchetSyncState Source #
Constructors
| RSOk | |
| RSAllowed | |
| RSRequired | |
| RSStarted | |
| RSAgreed |
Instances
data SMPConfirmation Source #
Constructors
| SMPConfirmation | |
Fields
| |
Instances
| Show SMPConfirmation Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> SMPConfirmation -> ShowS show :: SMPConfirmation -> String showList :: [SMPConfirmation] -> ShowS | |
data AgentMsgEnvelope Source #
Constructors
| AgentConfirmation | |
Fields
| |
| AgentMsgEnvelope | |
Fields
| |
| AgentInvitation | |
Fields
| |
| AgentRatchetKey | |
Fields
| |
Instances
| Show AgentMsgEnvelope Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> AgentMsgEnvelope -> ShowS show :: AgentMsgEnvelope -> String showList :: [AgentMsgEnvelope] -> ShowS | |
| Encoding AgentMsgEnvelope Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods smpEncode :: AgentMsgEnvelope -> ByteString Source # smpDecode :: ByteString -> Either String AgentMsgEnvelope Source # smpP :: Parser AgentMsgEnvelope Source # | |
data AgentMessage Source #
Constructors
| AgentConnInfo ConnInfo | |
| AgentConnInfoReply (NonEmpty SMPQueueInfo) ConnInfo | |
| AgentRatchetInfo ByteString | |
| AgentMessage APrivHeader AMessage |
Instances
| Show AgentMessage Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> AgentMessage -> ShowS show :: AgentMessage -> String showList :: [AgentMessage] -> ShowS | |
| Encoding AgentMessage Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods smpEncode :: AgentMessage -> ByteString Source # smpDecode :: ByteString -> Either String AgentMessage Source # smpP :: Parser AgentMessage Source # | |
data AgentMessageType Source #
Constructors
| AM_CONN_INFO | |
| AM_CONN_INFO_REPLY | |
| AM_RATCHET_INFO | |
| AM_HELLO_ | |
| AM_A_MSG_ | |
| AM_A_RCVD_ | |
| AM_QCONT_ | |
| AM_QADD_ | |
| AM_QKEY_ | |
| AM_QUSE_ | |
| AM_QTEST_ | |
| AM_EREADY_ |
Instances
| Show AgentMessageType Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> AgentMessageType -> ShowS show :: AgentMessageType -> String showList :: [AgentMessageType] -> ShowS | |
| Eq AgentMessageType Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods (==) :: AgentMessageType -> AgentMessageType -> Bool (/=) :: AgentMessageType -> AgentMessageType -> Bool | |
| Encoding AgentMessageType Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods smpEncode :: AgentMessageType -> ByteString Source # smpDecode :: ByteString -> Either String AgentMessageType Source # smpP :: Parser AgentMessageType Source # | |
| FromField AgentMessageType Source # | |
Defined in Simplex.Messaging.Agent.Store.AgentStore Methods fromField :: FieldParser AgentMessageType # | |
| ToField AgentMessageType Source # | |
Defined in Simplex.Messaging.Agent.Store.AgentStore Methods toField :: AgentMessageType -> SQLData # | |
data APrivHeader Source #
Constructors
| APrivHeader | |
Fields
| |
Instances
| Show APrivHeader Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> APrivHeader -> ShowS show :: APrivHeader -> String showList :: [APrivHeader] -> ShowS | |
| Encoding APrivHeader Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods smpEncode :: APrivHeader -> ByteString Source # smpDecode :: ByteString -> Either String APrivHeader Source # smpP :: Parser APrivHeader Source # | |
Messages sent between SMP agents once SMP queue is secured.
Constructors
| HELLO | the first message in the queue to validate it is secured |
| A_MSG MsgBody | agent envelope for the client message |
| A_RCVD (NonEmpty AMessageReceipt) | agent envelope for delivery receipt |
| A_QCONT SndQAddr | the message instructing the client to continue sending messages (after ERR QUOTA) |
| QADD (NonEmpty (SMPQueueUri, Maybe SndQAddr)) | |
| QKEY (NonEmpty (SMPQueueInfo, SndPublicAuthKey)) | |
| QUSE (NonEmpty (SndQAddr, Bool)) | |
| QTEST (NonEmpty SndQAddr) | |
| EREADY AgentMsgId |
data AMessageReceipt Source #
this type is used to send as part of the protocol between different clients TODO possibly, rename fields and types referring to external and internal IDs to make them different
Constructors
| AMessageReceipt | |
Fields
| |
Instances
| Show AMessageReceipt Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> AMessageReceipt -> ShowS show :: AMessageReceipt -> String showList :: [AMessageReceipt] -> ShowS | |
| Encoding AMessageReceipt Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods smpEncode :: AMessageReceipt -> ByteString Source # smpDecode :: ByteString -> Either String AMessageReceipt Source # smpP :: Parser AMessageReceipt Source # | |
data MsgReceipt Source #
this type is used as part of agent protocol to communicate with the user application
Constructors
| MsgReceipt | |
Fields | |
Instances
| Show MsgReceipt Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> MsgReceipt -> ShowS show :: MsgReceipt -> String showList :: [MsgReceipt] -> ShowS | |
| Eq MsgReceipt Source # | |
Defined in Simplex.Messaging.Agent.Protocol | |
type MsgReceiptInfo = ByteString Source #
data MsgReceiptStatus Source #
Constructors
| MROk | |
| MRBadMsgHash |
Instances
type SMPServer = ProtocolServer 'PSMP Source #
pattern SMPServer :: NonEmpty TransportHost -> ServiceName -> KeyHash -> ProtocolServer 'PSMP Source #
pattern ProtoServerWithAuth :: ProtocolServer p -> Maybe BasicAuth -> ProtoServerWithAuth p Source #
type SMPServerWithAuth = ProtoServerWithAuth 'PSMP Source #
Constructors
| SrvLoc HostName ServiceName |
class SMPQueue q where Source #
Instances
| SMPQueue SMPQueueAddress Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods qServer :: SMPQueueAddress -> SMPServer Source # queueId :: SMPQueueAddress -> QueueId Source # | |
| SMPQueue SMPQueueInfo Source # | |
Defined in Simplex.Messaging.Agent.Protocol | |
| SMPQueue SMPQueueUri Source # | |
Defined in Simplex.Messaging.Agent.Protocol | |
| SMPQueue NewRcvQueue Source # | |
Defined in Simplex.Messaging.Agent.Store | |
| SMPQueue RcvQueue Source # | |
| SMPQueue RcvQueueSub Source # | |
Defined in Simplex.Messaging.Agent.Store | |
| SMPQueue SndQueue Source # | |
noAuthSrv :: ProtocolServer p -> ProtoServerWithAuth p Source #
data SMPQueueUri Source #
SMP queue information sent out-of-band.
Constructors
| SMPQueueUri | |
Fields | |
Instances
data SMPQueueInfo Source #
Constructors
| SMPQueueInfo | |
Fields | |
Instances
data SMPQueueAddress Source #
Constructors
| SMPQueueAddress | |
Fields
| |
Instances
| Show SMPQueueAddress Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> SMPQueueAddress -> ShowS show :: SMPQueueAddress -> String showList :: [SMPQueueAddress] -> ShowS | |
| Eq SMPQueueAddress Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods (==) :: SMPQueueAddress -> SMPQueueAddress -> Bool (/=) :: SMPQueueAddress -> SMPQueueAddress -> Bool | |
| SMPQueue SMPQueueAddress Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods qServer :: SMPQueueAddress -> SMPServer Source # queueId :: SMPQueueAddress -> QueueId Source # | |
data ConnectionMode Source #
Constructors
| CMInvitation | |
| CMContact |
Instances
data SConnectionMode (m :: ConnectionMode) where Source #
Constructors
| SCMInvitation :: SConnectionMode CMInvitation | |
| SCMContact :: SConnectionMode CMContact |
Instances
| TestEquality SConnectionMode Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods testEquality :: forall (a :: k) (b :: k). SConnectionMode a -> SConnectionMode b -> Maybe (a :~: b) | |
| Show (SConnectionMode m) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> SConnectionMode m -> ShowS show :: SConnectionMode m -> String showList :: [SConnectionMode m] -> ShowS | |
| Eq (SConnectionMode m) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods (==) :: SConnectionMode m -> SConnectionMode m -> Bool (/=) :: SConnectionMode m -> SConnectionMode m -> Bool | |
| ToField (SConnectionMode c) Source # | |
Defined in Simplex.Messaging.Agent.Store.AgentStore Methods toField :: SConnectionMode c -> SQLData # | |
data AConnectionMode Source #
Constructors
| forall m.ConnectionModeI m => ACM (SConnectionMode m) |
Instances
| Show AConnectionMode Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> AConnectionMode -> ShowS show :: AConnectionMode -> String showList :: [AConnectionMode] -> ShowS | |
| Eq AConnectionMode Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods (==) :: AConnectionMode -> AConnectionMode -> Bool (/=) :: AConnectionMode -> AConnectionMode -> Bool | |
| StrEncoding AConnectionMode Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods strEncode :: AConnectionMode -> ByteString Source # strDecode :: ByteString -> Either String AConnectionMode Source # strP :: Parser AConnectionMode Source # | |
| FromField AConnectionMode Source # | |
Defined in Simplex.Messaging.Agent.Store.AgentStore Methods fromField :: FieldParser AConnectionMode # | |
class ConnectionModeI (m :: ConnectionMode) where Source #
Methods
Instances
| ConnectionModeI 'CMContact Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods | |
| ConnectionModeI 'CMInvitation Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods | |
data ConnectionRequestUri (m :: ConnectionMode) where Source #
Constructors
| CRInvitationUri :: ConnReqUriData -> RcvE2ERatchetParamsUri 'X448 -> ConnectionRequestUri CMInvitation | |
| CRContactUri :: ConnReqUriData -> ConnectionRequestUri CMContact |
Instances
data AConnectionRequestUri Source #
Constructors
| forall m.ConnectionModeI m => ACR (SConnectionMode m) (ConnectionRequestUri m) |
Instances
data ShortLinkCreds Source #
Constructors
| ShortLinkCreds | |
Fields | |
Instances
| Show ShortLinkCreds Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> ShortLinkCreds -> ShowS show :: ShortLinkCreds -> String showList :: [ShortLinkCreds] -> ShowS | |
data ConnReqUriData Source #
Constructors
| ConnReqUriData | |
Fields
| |
Instances
| Show ConnReqUriData Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> ConnReqUriData -> ShowS show :: ConnReqUriData -> String showList :: [ConnReqUriData] -> ShowS | |
| Eq ConnReqUriData Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods (==) :: ConnReqUriData -> ConnReqUriData -> Bool (/=) :: ConnReqUriData -> ConnReqUriData -> Bool | |
| Encoding ConnReqUriData Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods smpEncode :: ConnReqUriData -> ByteString Source # smpDecode :: ByteString -> Either String ConnReqUriData Source # smpP :: Parser ConnReqUriData Source # | |
type CRClientData = Text Source #
data ServiceScheme Source #
Instances
| Show ServiceScheme Source # | |
Defined in Simplex.Messaging.ServiceScheme Methods showsPrec :: Int -> ServiceScheme -> ShowS show :: ServiceScheme -> String showList :: [ServiceScheme] -> ShowS | |
| Eq ServiceScheme Source # | |
Defined in Simplex.Messaging.ServiceScheme | |
| StrEncoding ServiceScheme Source # | |
Defined in Simplex.Messaging.ServiceScheme Methods strEncode :: ServiceScheme -> ByteString Source # strDecode :: ByteString -> Either String ServiceScheme Source # strP :: Parser ServiceScheme Source # | |
data FixedLinkData c Source #
Constructors
| FixedLinkData | |
Fields
| |
Instances
| Show (FixedLinkData c) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> FixedLinkData c -> ShowS show :: FixedLinkData c -> String showList :: [FixedLinkData c] -> ShowS | |
| Eq (FixedLinkData c) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods (==) :: FixedLinkData c -> FixedLinkData c -> Bool (/=) :: FixedLinkData c -> FixedLinkData c -> Bool | |
| ConnectionModeI c => Encoding (FixedLinkData c) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods smpEncode :: FixedLinkData c -> ByteString Source # smpDecode :: ByteString -> Either String (FixedLinkData c) Source # smpP :: Parser (FixedLinkData c) Source # | |
data AConnLinkData Source #
Constructors
| forall m.ConnectionModeI m => ACLD (SConnectionMode m) (ConnLinkData m) |
Instances
| Encoding AConnLinkData Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods smpEncode :: AConnLinkData -> ByteString Source # smpDecode :: ByteString -> Either String AConnLinkData Source # smpP :: Parser AConnLinkData Source # | |
data ConnLinkData c where Source #
Constructors
| InvitationLinkData :: VersionRangeSMPA -> UserLinkData -> ConnLinkData 'CMInvitation | |
| ContactLinkData :: VersionRangeSMPA -> UserContactData -> ConnLinkData 'CMContact |
Instances
| Show (ConnLinkData c) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> ConnLinkData c -> ShowS show :: ConnLinkData c -> String showList :: [ConnLinkData c] -> ShowS | |
| Eq (ConnLinkData c) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods (==) :: ConnLinkData c -> ConnLinkData c -> Bool (/=) :: ConnLinkData c -> ConnLinkData c -> Bool | |
| ConnectionModeI c => Encoding (ConnLinkData c) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods smpEncode :: ConnLinkData c -> ByteString Source # smpDecode :: ByteString -> Either String (ConnLinkData c) Source # smpP :: Parser (ConnLinkData c) Source # | |
data AUserConnLinkData Source #
Constructors
| forall m.ConnectionModeI m => AULD (SConnectionMode m) (UserConnLinkData m) |
Instances
| Encoding AUserConnLinkData Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods smpEncode :: AUserConnLinkData -> ByteString Source # smpDecode :: ByteString -> Either String AUserConnLinkData Source # smpP :: Parser AUserConnLinkData Source # | |
data UserConnLinkData c where Source #
Constructors
| UserInvLinkData :: UserLinkData -> UserConnLinkData 'CMInvitation | |
| UserContactLinkData :: UserContactData -> UserConnLinkData 'CMContact |
Instances
| Show (UserConnLinkData m) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> UserConnLinkData m -> ShowS show :: UserConnLinkData m -> String showList :: [UserConnLinkData m] -> ShowS | |
| Eq (UserConnLinkData m) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods (==) :: UserConnLinkData m -> UserConnLinkData m -> Bool (/=) :: UserConnLinkData m -> UserConnLinkData m -> Bool | |
| ConnectionModeI c => Encoding (UserConnLinkData c) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods smpEncode :: UserConnLinkData c -> ByteString Source # smpDecode :: ByteString -> Either String (UserConnLinkData c) Source # smpP :: Parser (UserConnLinkData c) Source # | |
| ConnectionModeI c => StrEncoding (UserConnLinkData c) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods strEncode :: UserConnLinkData c -> ByteString Source # strDecode :: ByteString -> Either String (UserConnLinkData c) Source # strP :: Parser (UserConnLinkData c) Source # | |
data UserContactData Source #
Constructors
| UserContactData | |
Fields
| |
Instances
| Show UserContactData Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> UserContactData -> ShowS show :: UserContactData -> String showList :: [UserContactData] -> ShowS | |
| Eq UserContactData Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods (==) :: UserContactData -> UserContactData -> Bool (/=) :: UserContactData -> UserContactData -> Bool | |
| Encoding UserContactData Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods smpEncode :: UserContactData -> ByteString Source # smpDecode :: ByteString -> Either String UserContactData Source # smpP :: Parser UserContactData Source # | |
newtype UserLinkData Source #
Constructors
| UserLinkData ByteString |
Instances
| Show UserLinkData Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> UserLinkData -> ShowS show :: UserLinkData -> String showList :: [UserLinkData] -> ShowS | |
| Eq UserLinkData Source # | |
Defined in Simplex.Messaging.Agent.Protocol | |
| Encoding UserLinkData Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods smpEncode :: UserLinkData -> ByteString Source # smpDecode :: ByteString -> Either String UserLinkData Source # smpP :: Parser UserLinkData Source # | |
Constructors
| OwnerAuth | |
Fields | |
data ConnectionLink m Source #
Constructors
| CLFull (ConnectionRequestUri m) | |
| CLShort (ConnShortLink m) |
Instances
data AConnectionLink Source #
Constructors
| forall m.ConnectionModeI m => ACL (SConnectionMode m) (ConnectionLink m) |
Instances
data ConnShortLink (m :: ConnectionMode) where Source #
Constructors
| CSLInvitation :: ShortLinkScheme -> SMPServer -> LinkId -> LinkKey -> ConnShortLink 'CMInvitation | |
| CSLContact :: ShortLinkScheme -> ContactConnType -> SMPServer -> LinkKey -> ConnShortLink 'CMContact |
Instances
data AConnShortLink Source #
Constructors
| forall m.ConnectionModeI m => ACSL (SConnectionMode m) (ConnShortLink m) |
Instances
data CreatedConnLink m Source #
Constructors
| CCLink | |
Fields
| |
Instances
| ConnectionModeI m => FromJSON (CreatedConnLink m) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods parseJSON :: Value -> Parser (CreatedConnLink m) parseJSONList :: Value -> Parser [CreatedConnLink m] omittedField :: Maybe (CreatedConnLink m) | |
| ConnectionModeI m => ToJSON (CreatedConnLink m) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods toJSON :: CreatedConnLink m -> Value toEncoding :: CreatedConnLink m -> Encoding toJSONList :: [CreatedConnLink m] -> Value toEncodingList :: [CreatedConnLink m] -> Encoding omitField :: CreatedConnLink m -> Bool | |
| Show (CreatedConnLink m) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> CreatedConnLink m -> ShowS show :: CreatedConnLink m -> String showList :: [CreatedConnLink m] -> ShowS | |
| Eq (CreatedConnLink m) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods (==) :: CreatedConnLink m -> CreatedConnLink m -> Bool (/=) :: CreatedConnLink m -> CreatedConnLink m -> Bool | |
data ACreatedConnLink Source #
Constructors
| forall m.ConnectionModeI m => ACCL (SConnectionMode m) (CreatedConnLink m) |
Instances
| FromJSON ACreatedConnLink Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods parseJSON :: Value -> Parser ACreatedConnLink parseJSONList :: Value -> Parser [ACreatedConnLink] omittedField :: Maybe ACreatedConnLink | |
| ToJSON ACreatedConnLink Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods toJSON :: ACreatedConnLink -> Value toEncoding :: ACreatedConnLink -> Encoding toJSONList :: [ACreatedConnLink] -> Value toEncodingList :: [ACreatedConnLink] -> Encoding omitField :: ACreatedConnLink -> Bool | |
| Show ACreatedConnLink Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> ACreatedConnLink -> ShowS show :: ACreatedConnLink -> String showList :: [ACreatedConnLink] -> ShowS | |
| Eq ACreatedConnLink Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods (==) :: ACreatedConnLink -> ACreatedConnLink -> Bool (/=) :: ACreatedConnLink -> ACreatedConnLink -> Bool | |
data ContactConnType Source #
Constructors
| CCTContact | |
| CCTChannel | |
| CCTGroup | |
| CCTRelay |
Instances
| Show ContactConnType Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> ContactConnType -> ShowS show :: ContactConnType -> String showList :: [ContactConnType] -> ShowS | |
| Eq ContactConnType Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods (==) :: ContactConnType -> ContactConnType -> Bool (/=) :: ContactConnType -> ContactConnType -> Bool | |
data ShortLinkScheme Source #
Constructors
| SLSSimplex | |
| SLSServer |
Instances
| Show ShortLinkScheme Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> ShortLinkScheme -> ShowS show :: ShortLinkScheme -> String showList :: [ShortLinkScheme] -> ShowS | |
| Eq ShortLinkScheme Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods (==) :: ShortLinkScheme -> ShortLinkScheme -> Bool (/=) :: ShortLinkScheme -> ShortLinkScheme -> Bool | |
Constructors
| LinkKey ByteString |
data PreparedLinkParams Source #
Parameters for creating a connection with a prepared link.
Constructors
| PreparedLinkParams | |
Fields
| |
Instances
| Show PreparedLinkParams Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> PreparedLinkParams -> ShowS show :: PreparedLinkParams -> String showList :: [PreparedLinkParams] -> ShowS | |
data StoredClientService (s :: DBStored) Source #
Constructors
| ClientService | |
Fields
| |
Instances
| Show (StoredClientService s) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> StoredClientService s -> ShowS show :: StoredClientService s -> String showList :: [StoredClientService s] -> ShowS | |
| Eq (StoredClientService s) Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods (==) :: StoredClientService s -> StoredClientService s -> Bool (/=) :: StoredClientService s -> StoredClientService s -> Bool | |
type ClientService = StoredClientService 'DBStored Source #
type ClientServiceId = DBEntityId Source #
validateOwners :: Maybe ShortLinkCreds -> UserContactData -> Either String () Source #
validateLinkOwners :: PublicKeyEd25519 -> [OwnerAuth] -> Either String () Source #
sameConnReqContact :: ConnectionRequestUri 'CMContact -> ConnectionRequestUri 'CMContact -> Bool Source #
sameShortLinkContact :: ConnShortLink 'CMContact -> ConnShortLink 'CMContact -> Bool Source #
connReqUriP' :: forall m. ConnectionModeI m => Maybe ServiceScheme -> Parser (ConnectionRequestUri m) Source #
simplexShortLink :: ConnShortLink m -> ConnShortLink m Source #
data AgentErrorType Source #
Error type used in errors sent to agent clients.
Constructors
| CMD | command or response error |
Fields
| |
| CONN | connection errors |
Fields
| |
| NO_USER | user not found in database |
| SMP | SMP protocol errors forwarded to agent clients |
Fields
| |
| NTF | NTF protocol errors forwarded to agent clients |
Fields
| |
| XFTP | XFTP protocol errors forwarded to agent clients |
Fields
| |
| FILE | XFTP agent errors |
Fields | |
| PROXY | SMP proxy errors |
Fields
| |
| RCP | XRCP protocol errors forwarded to agent clients |
Fields | |
| BROKER | SMP server errors |
Fields
| |
| AGENT | errors of other agents |
Fields | |
| NOTICE | client notice |
| INTERNAL | agent implementation or dependency errors |
Fields
| |
| CRITICAL | critical agent errors that should be shown to the user, optionally with restart button |
Fields
| |
| INACTIVE | agent inactive |
Instances
data CommandErrorType Source #
SMP agent protocol command or response error.
Constructors
| PROHIBITED | command is prohibited in this context |
| SYNTAX | command syntax is invalid |
| NO_CONN | entity ID is required with this command |
| SIZE | message size is not correct (no terminating space) |
| LARGE | message does not fit in SMP block |
Instances
data ConnectionErrorType Source #
Connection error.
Constructors
| NOT_FOUND | connection is not in the database |
| DUPLICATE | connection already exists |
| SIMPLEX | connection is simplex, but operation requires another queue |
| NOT_ACCEPTED | connection not accepted on join HELLO after timeout |
| NOT_AVAILABLE | connection not available on reply confirmation/HELLO after timeout |
Instances
data BrokerErrorType Source #
SMP server errors.
Constructors
| RESPONSE | invalid server response (failed to parse) |
Fields
| |
| UNEXPECTED | unexpected response |
Fields
| |
| NETWORK | network error |
Fields | |
| HOST | no compatible server host (e.g. onion when public is required, or vice versa) |
| NO_SERVICE | service unavailable client-side - used in agent errors |
| TRANSPORT | handshake or other transport error |
Fields | |
| TIMEOUT | command response timeout |
Instances
data SMPAgentError Source #
Errors of another SMP agent.
Constructors
| A_MESSAGE | client or agent message that failed to parse |
| A_PROHIBITED | prohibited SMP/agent message |
Fields
| |
| A_VERSION | incompatible version of SMP client, agent or encryption protocols |
| A_LINK | failed signature, hash or senderId verification of retrieved link data |
Fields
| |
| A_CRYPTO | cannot decrypt message |
Fields | |
| A_DUPLICATE | duplicate message - this error is detected by ratchet decryption - this message will be ignored and not shown. it may also indicate a loss of ratchet synchronization (when only one message is sent via copied ratchet). when message is dropped after too many reception attempts, DroppedMsg is included. |
Fields
| |
| A_QUEUE | error in the message to adddeleteetc queue in connection |
Fields
| |
Instances
| FromJSON SMPAgentError Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods parseJSON :: Value -> Parser SMPAgentError parseJSONList :: Value -> Parser [SMPAgentError] omittedField :: Maybe SMPAgentError | |
| ToJSON SMPAgentError Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods toJSON :: SMPAgentError -> Value toEncoding :: SMPAgentError -> Encoding toJSONList :: [SMPAgentError] -> Value toEncodingList :: [SMPAgentError] -> Encoding omitField :: SMPAgentError -> Bool | |
| Exception SMPAgentError Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods toException :: SMPAgentError -> SomeException fromException :: SomeException -> Maybe SMPAgentError displayException :: SMPAgentError -> String | |
| Show SMPAgentError Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> SMPAgentError -> ShowS show :: SMPAgentError -> String showList :: [SMPAgentError] -> ShowS | |
| Eq SMPAgentError Source # | |
Defined in Simplex.Messaging.Agent.Protocol | |
data DroppedMsg Source #
Constructors
| DroppedMsg | |
Instances
| FromJSON DroppedMsg Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods parseJSON :: Value -> Parser DroppedMsg parseJSONList :: Value -> Parser [DroppedMsg] omittedField :: Maybe DroppedMsg | |
| ToJSON DroppedMsg Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods toJSON :: DroppedMsg -> Value toEncoding :: DroppedMsg -> Encoding toJSONList :: [DroppedMsg] -> Value toEncodingList :: [DroppedMsg] -> Encoding omitField :: DroppedMsg -> Bool | |
| Show DroppedMsg Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> DroppedMsg -> ShowS show :: DroppedMsg -> String showList :: [DroppedMsg] -> ShowS | |
| Eq DroppedMsg Source # | |
Defined in Simplex.Messaging.Agent.Protocol | |
data AgentCryptoError Source #
Constructors
| DECRYPT_AES | AES decryption error |
| DECRYPT_CB | |
| RATCHET_HEADER | can't decrypt ratchet header, possibly ratchet out of sync due to device change |
| RATCHET_EARLIER Word32 | earlier message number (or, possibly, skipped message that failed to decrypt?) |
| RATCHET_SKIPPED Word32 | too many skipped messages |
| RATCHET_SYNC | ratchet synchronization error |
Instances
type ConfirmationId = ByteString Source #
type InvitationId = ByteString Source #
data MsgIntegrity Source #
Result of received message integrity validation.
Instances
data MsgErrorType Source #
Error of message integrity validation.
Constructors
| MsgSkipped | |
Fields
| |
| MsgBadId | |
Fields
| |
| MsgBadHash | |
| MsgDuplicate | |
Instances
| FromJSON MsgErrorType Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods parseJSON :: Value -> Parser MsgErrorType parseJSONList :: Value -> Parser [MsgErrorType] omittedField :: Maybe MsgErrorType | |
| ToJSON MsgErrorType Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods toJSON :: MsgErrorType -> Value toEncoding :: MsgErrorType -> Encoding toJSONList :: [MsgErrorType] -> Value toEncodingList :: [MsgErrorType] -> Encoding omitField :: MsgErrorType -> Bool | |
| Show MsgErrorType Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> MsgErrorType -> ShowS show :: MsgErrorType -> String showList :: [MsgErrorType] -> ShowS | |
| Eq MsgErrorType Source # | |
Defined in Simplex.Messaging.Agent.Protocol | |
| StrEncoding MsgErrorType Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods strEncode :: MsgErrorType -> ByteString Source # strDecode :: ByteString -> Either String MsgErrorType Source # strP :: Parser MsgErrorType Source # | |
data QueueStatus Source #
SMP queue status.
Constructors
| New | queue is created |
| Confirmed | queue is confirmed by the sender |
| Secured | queue is secured with sender key (only used by the queue recipient) |
| Active | queue is active |
| Disabled | queue is disabled (only used by the queue recipient) |
Instances
type AgentMsgId = Int64 Source #
data NotificationsMode Source #
Constructors
| NMPeriodic | |
| NMInstant |
Instances
data NotificationInfo Source #
Constructors
| NotificationInfo | |
Fields
| |
Instances
| Show NotificationInfo Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> NotificationInfo -> ShowS show :: NotificationInfo -> String showList :: [NotificationInfo] -> ShowS | |
data ConnMsgReq Source #
Constructors
| ConnMsgReq | |
Fields
| |
Instances
| Show ConnMsgReq Source # | |
Defined in Simplex.Messaging.Agent.Protocol Methods showsPrec :: Int -> ConnMsgReq -> ShowS show :: ConnMsgReq -> String showList :: [ConnMsgReq] -> ShowS | |
Encode/decode
serializeCommand :: ACommand -> ByteString Source #
Serialize SMP agent command.
connMode :: SConnectionMode m -> ConnectionMode Source #
dbCommandP :: Parser ACommand Source #
SMP agent command and response parser for commands stored in db (fully parses binary bodies)
connModeT :: Text -> Maybe ConnectionMode Source #
serializeQueueStatus :: QueueStatus -> Text Source #
queueStatusT :: Text -> Maybe QueueStatus Source #
shortenShortLink :: NonEmpty SMPServer -> ConnShortLink m -> ConnShortLink m Source #
restoreShortLink :: NonEmpty SMPServer -> ConnShortLink m -> ConnShortLink m Source #
isPresetServer :: Foldable t => SMPServer -> t SMPServer -> Bool Source #
linkUserData :: ConnLinkData c -> UserLinkData Source #
linkUserData' :: ConnLinkData c -> ByteString Source #