| Copyright | (c) 2018 Chris Coffey (c) 2018 CollegeVine |
|---|---|
| License | MIT |
| Maintainer | Chris Coffey |
| Stability | experimental |
| Portability | portable |
| Safe Haskell | None |
| Language | Haskell2010 |
ConfCrypt.Types
Description
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)) #
Errors
data ConfCryptError #
The possible errors produced during a confcrypt operation.
Constructors
Instances
Runtime Environment
data ConfCryptFile #
As indicated in the Readme, a ConfCrypt file
Constructors
| ConfCryptFile | |
Fields
| |
Instances
Constructors
| Parameter | |
Fields
| |
Instances
| Eq Parameter # | |
| Ord Parameter # | |
| Show Parameter # | |
| Generic Parameter # | |
| NFData Parameter # | |
Defined in ConfCrypt.Types | |
| type Rep Parameter # | |
Defined in ConfCrypt.Types type Rep Parameter = D1 (MetaData "Parameter" "ConfCrypt.Types" "confcrypt-0.1.0.4-DVHvSaFYzUh4p1s8F9TW6i" 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 #
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.
Constructors
| SchemaLine Schema | |
| CommentLine | |
| ParameterLine ParamLine | |
Instances
newtype LineNumber #
Self explanitory
Constructors
| LineNumber Int |
Instances
data SchemaType #
Indicates which types a
Instances
A parsed parameter line from a confcrypt file
Instances
| Eq ParamLine # | |
| Ord ParamLine # | |
| Show ParamLine # | |
| Generic ParamLine # | |
| NFData ParamLine # | |
Defined in ConfCrypt.Types | |
| type Rep ParamLine # | |
Defined in ConfCrypt.Types type Rep ParamLine = D1 (MetaData "ParamLine" "ConfCrypt.Types" "confcrypt-0.1.0.4-DVHvSaFYzUh4p1s8F9TW6i" 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
Constructors
| Schema | |
Fields
| |
Instances
| Eq Schema # | |
| Ord Schema # | |
| Show Schema # | |
| Generic Schema # | |
| NFData Schema # | |
Defined in ConfCrypt.Types | |
| type Rep Schema # | |
Defined in ConfCrypt.Types type Rep Schema = D1 (MetaData "Schema" "ConfCrypt.Types" "confcrypt-0.1.0.4-DVHvSaFYzUh4p1s8F9TW6i" 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 # | |
Defined in ConfCrypt.Encryption | |
| LocalKey PrivateKey # | |
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 # | |
Defined in ConfCrypt.Encryption | |
Helpers
unWrapSchema :: ConfCryptElement -> Maybe Schema #
Attempts to unwrap a line from a confcrypt file into a Schema
isParameter :: ConfCryptElement -> Bool #
Checks whether the provided line from a confcrypt file is a Parameter
typeToOutputString :: SchemaType -> Text #
A special purpose Show function for convert
parameterToLines :: Parameter -> (ParamLine, Maybe Schema) #
Convert a parameter into a ParameterLine and SchemaLine if possible.