Copyright | (c) 2018 Chris Coffey (c) 2018 CollegeVine |
---|---|
License | MIT |
Maintainer | Chris Coffey |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Core types and some small helper functions used to construct ConfCrypt.
Synopsis
- type ConfCryptM m ctx = ReaderT (ConfCryptFile, ctx) (ExceptT ConfCryptError (ResourceT m))
- data ConfCryptError
- data ConfCryptFile = ConfCryptFile {}
- data Parameter = Parameter {
- paramName :: Text
- paramValue :: Text
- paramType :: Maybe SchemaType
- data ConfCryptElement
- newtype LineNumber = LineNumber Int
- data SchemaType
- data ParamLine = ParamLine {}
- data Schema = Schema {
- sName :: Text
- sType :: SchemaType
- class LocalKey key
- class KMSKey key
- unWrapSchema :: ConfCryptElement -> Maybe Schema
- isParameter :: ConfCryptElement -> Bool
- typeToOutputString :: SchemaType -> Text
- parameterToLines :: Parameter -> (ParamLine, Maybe Schema)
Core types
type ConfCryptM m ctx = ReaderT (ConfCryptFile, ctx) (ExceptT ConfCryptError (ResourceT m)) Source #
Errors
data ConfCryptError Source #
The possible errors produced during a confcrypt operation.
Instances
Runtime Environment
data ConfCryptFile Source #
As indicated in the Readme, a ConfCrypt file
ConfCryptFile | |
|
Instances
Parameter | |
|
Instances
Eq Parameter Source # | |
Ord Parameter Source # | |
Defined in ConfCrypt.Types | |
Show Parameter Source # | |
Generic Parameter Source # | |
NFData Parameter Source # | |
Defined in ConfCrypt.Types | |
type Rep Parameter Source # | |
Defined in ConfCrypt.Types type Rep Parameter = D1 (MetaData "Parameter" "ConfCrypt.Types" "confcrypt-0.2.0.0-I4wOZFPwd2q3sKulD4AHVE" False) (C1 (MetaCons "Parameter" PrefixI True) (S1 (MetaSel (Just "paramName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text) :*: (S1 (MetaSel (Just "paramValue") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text) :*: S1 (MetaSel (Just "paramType") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe SchemaType))))) |
File Format
data ConfCryptElement Source #
The syntax used to describe a confcrypt file. A line in a confcrypt file may be one of Schema
,
ParamLine
, or comment. The grammar itself is described in the readme and Parser
.
Instances
newtype LineNumber Source #
Self explanitory
Instances
data SchemaType Source #
Indicates which types a
Instances
A parsed parameter line from a confcrypt file
Instances
Eq ParamLine Source # | |
Ord ParamLine Source # | |
Defined in ConfCrypt.Types | |
Show ParamLine Source # | |
Generic ParamLine Source # | |
NFData ParamLine Source # | |
Defined in ConfCrypt.Types | |
type Rep ParamLine Source # | |
Defined in ConfCrypt.Types type Rep ParamLine = D1 (MetaData "ParamLine" "ConfCrypt.Types" "confcrypt-0.2.0.0-I4wOZFPwd2q3sKulD4AHVE" False) (C1 (MetaCons "ParamLine" PrefixI True) (S1 (MetaSel (Just "pName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text) :*: S1 (MetaSel (Just "pValue") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text))) |
A parsed schema line from a confcrypt file
Schema | |
|
Instances
Eq Schema Source # | |
Ord Schema Source # | |
Show Schema Source # | |
Generic Schema Source # | |
NFData Schema Source # | |
Defined in ConfCrypt.Types | |
type Rep Schema Source # | |
Defined in ConfCrypt.Types type Rep Schema = D1 (MetaData "Schema" "ConfCrypt.Types" "confcrypt-0.2.0.0-I4wOZFPwd2q3sKulD4AHVE" False) (C1 (MetaCons "Schema" PrefixI True) (S1 (MetaSel (Just "sName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text) :*: S1 (MetaSel (Just "sType") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 SchemaType))) |
Key constraints
This constraint provides a type-level check that the wrapped key type is local to the current machine. For use with things like RSA keys.
Instances
LocalKey PublicKey Source # | |
Defined in ConfCrypt.Encryption | |
LocalKey PrivateKey Source # | |
Defined in ConfCrypt.Encryption |
This constraint provides a type-level check that the wrapped key type exists off-system inside an externally provided Key Management System (KMS). For use with AWS KMS or Azure KMS.
Instances
KMSKey AWSCtx Source # | |
Defined in ConfCrypt.Encryption |
Helpers
unWrapSchema :: ConfCryptElement -> Maybe Schema Source #
Attempts to unwrap a line from a confcrypt file into a Schema
isParameter :: ConfCryptElement -> Bool Source #
Checks whether the provided line from a confcrypt file is a Parameter
typeToOutputString :: SchemaType -> Text Source #
A special purpose Show
function for convert
parameterToLines :: Parameter -> (ParamLine, Maybe Schema) Source #
Convert a parameter into a ParameterLine
and SchemaLine
if possible.