Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Request
- = CreateSession { }
- | PostAuthMessageResponse { }
- | StartSession { }
- | CancelSession
- data Response
- = Success
- | Error { }
- | AuthMessage { }
- data AuthMessageType
- data ErrorType
- encodeRequest :: Request -> ByteString
- decodeResponse :: ByteString -> Response
- encodeLen :: Int -> ByteString
- decodeLen :: ByteString -> Int
Documentation
CreateSession | Creates a session and initiates a login atempted for the given user. The session is ready to be started if a success is returned. |
PostAuthMessageResponse | Answers an authentication message. If the message was informative (info, error), then a response does not need to be set in this message. Tht session is ready to be started if a success is returned. |
StartSession | Requests for the session to be started using the provided command line. The session will start after the greeter process terminates. |
CancelSession | Cancel the session that is currently under configuration. |
Instances
Eq Request Source # | |
Show Request Source # | |
Generic Request Source # | |
ToJSON Request Source # | |
Defined in HGreet.Packet | |
type Rep Request Source # | |
Defined in HGreet.Packet type Rep Request = D1 ('MetaData "Request" "HGreet.Packet" "hgreet-0.1.0.0-L18MbcRjDZbE3raonslubm" 'False) ((C1 ('MetaCons "CreateSession" 'PrefixI 'True) (S1 ('MetaSel ('Just "username") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: C1 ('MetaCons "PostAuthMessageResponse" 'PrefixI 'True) (S1 ('MetaSel ('Just "respone") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe String)))) :+: (C1 ('MetaCons "StartSession" 'PrefixI 'True) (S1 ('MetaSel ('Just "cmd") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [String])) :+: C1 ('MetaCons "CancelSession" 'PrefixI 'False) (U1 :: Type -> Type))) |
Success | Indicates that the request succeeded. |
Error | Indicates that the request failed. |
| |
AuthMessage | Indicates that an authentication message needs to be answered to continue trough the authenticaltion flow. There are no limits on the number and type of messages that may be required for authentication to succeed, and a greeter should not make any assumptions about the messages. Must be answerd with either PostAuthMessageResponse or CancelSession. |
Instances
Eq Response Source # | |
Show Response Source # | |
Generic Response Source # | |
FromJSON Response Source # | |
type Rep Response Source # | |
Defined in HGreet.Packet type Rep Response = D1 ('MetaData "Response" "HGreet.Packet" "hgreet-0.1.0.0-L18MbcRjDZbE3raonslubm" 'False) (C1 ('MetaCons "Success" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Error" 'PrefixI 'True) (S1 ('MetaSel ('Just "error_type") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ErrorType) :*: S1 ('MetaSel ('Just "description") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: C1 ('MetaCons "AuthMessage" 'PrefixI 'True) (S1 ('MetaSel ('Just "auth_message_type") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 AuthMessageType) :*: S1 ('MetaSel ('Just "auth_message") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))) |
data AuthMessageType Source #
Visible | Indicates that the input from the user should be visible when they answer this question. |
Secret | Indicates that input from the user should be considered secret when they answer this question. |
Info | Indicates that this message is informative, not a question. |
ErrorType | Indicates that this message is an error, not a question. |
Instances
Eq AuthMessageType Source # | |
Defined in HGreet.Packet (==) :: AuthMessageType -> AuthMessageType -> Bool # (/=) :: AuthMessageType -> AuthMessageType -> Bool # | |
Show AuthMessageType Source # | |
Defined in HGreet.Packet showsPrec :: Int -> AuthMessageType -> ShowS # show :: AuthMessageType -> String # showList :: [AuthMessageType] -> ShowS # | |
FromJSON AuthMessageType Source # | |
Defined in HGreet.Packet parseJSON :: Value -> Parser AuthMessageType # parseJSONList :: Value -> Parser [AuthMessageType] # |
AuthError | Indicates that authentication failed. THis is not a fatal error, and is likely caused by incorrect credentials. Handle as appropriate. |
OtherError | A general error. See the error description for more information. |
:: Request | Raw Request packet to encode. |
-> ByteString | Encoded Request packet. |
Encode a Request packet as a UTF-8 JSON ByteString to be sent to the greetd socket.
:: ByteString | Encoded Response packet. |
-> Response | Decoded raw Response packet. |
Decode a Response packet from a ByteString received from the greetd socket.
encodeLen :: Int -> ByteString Source #
Encode a length as a 32-bit integer in native byte order encapsulated in a Lazy ByteString.
decodeLen :: ByteString -> Int Source #
Decode a length as a 32-bit integer in native byte order from a Lazy ByteString.