started on auth
This commit is contained in:
parent
b5b3d8cde2
commit
08371c3745
6 changed files with 76 additions and 16 deletions
|
@ -26,12 +26,14 @@ import Control.Concurrent.STM
|
|||
|
||||
data P2PHttpServerState = P2PHttpServerState
|
||||
{ acquireP2PConnection :: AcquireP2PConnection
|
||||
, getServerMode :: GetServerMode
|
||||
, openLocks :: TMVar (M.Map LockID Locker)
|
||||
}
|
||||
|
||||
mkP2PHttpServerState :: AcquireP2PConnection -> IO P2PHttpServerState
|
||||
mkP2PHttpServerState acquireconn = P2PHttpServerState
|
||||
mkP2PHttpServerState :: AcquireP2PConnection -> GetServerMode -> IO P2PHttpServerState
|
||||
mkP2PHttpServerState acquireconn getservermode = P2PHttpServerState
|
||||
<$> pure acquireconn
|
||||
<*> pure getservermode
|
||||
<*> newTMVarIO mempty
|
||||
|
||||
withP2PConnection
|
||||
|
@ -61,6 +63,8 @@ withP2PConnection apiver st cu su bypass connaction = do
|
|||
, connectionServerMode = P2P.ServeReadWrite -- XXX auth
|
||||
}
|
||||
|
||||
type GetServerMode = IsSecure -> Maybe BasicAuthData -> Maybe P2P.ServerMode
|
||||
|
||||
data ConnectionParams = ConnectionParams
|
||||
{ connectionProtocolVersion :: P2P.ProtocolVersion
|
||||
, connectionServerUUID :: UUID
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue