ganeti

Safe HaskellSafe-Infered

Ganeti.Confd.Utils

Description

Implementation of the Ganeti confd utilities.

This holds a few utility functions that could be useful in both clients and servers.

Synopsis

Documentation

getClusterHmac :: IO HashKeySource

Returns the HMAC key.

parseSignedMessage :: JSON a => HashKey -> String -> Result (String, String, a)Source

Parses a signed message.

parseRequest :: HashKey -> String -> Integer -> Result (String, ConfdRequest)Source

Message parsing. This can either result in a good, valid request message, or fail in the Result monad.

parseReply :: HashKey -> String -> String -> Result (String, ConfdReply)Source

Message parsing. This can either result in a good, valid reply message, or fail in the Result monad. It also checks that the salt in the message corresponds to the one that is expected

signMessage :: HashKey -> String -> String -> SignedMessageSource

Signs a message with a given key and salt.