propellor-5.3.3: property-based host configuration management in haskell

Safe Haskell | None
Language | Haskell98

Propellor.Types.PrivData

Synopsis

- data PrivDataField
  - = DockerAuthentication
  - | SshPubKey SshKeyType UserName
  - | SshPrivKey SshKeyType UserName
  - | SshAuthorizedKeys UserName
  - | Password UserName
  - | CryptPassword UserName
  - | PrivFile FilePath
  - | GpgKey
  - | DnsSec DnsSecKey
- data PrivDataSource
  - = PrivDataSourceFile PrivDataField FilePath
  - | PrivDataSourceFileFromCommand PrivDataField FilePath String
  - | PrivDataSource PrivDataField String
- type PrivDataSourceDesc = String
- class IsPrivDataSource s where
- newtype Context = Context String
- newtype HostContext = HostContext {
  - mkHostContext :: HostName -> Context
  }
- class IsContext c where
- anyContext :: Context
- hostContext :: HostContext
- newtype PrivData = PrivData String
- privDataLines :: PrivData -> [String]
- privDataVal :: PrivData -> String
- privDataByteString :: PrivData -> ByteString
- data SshKeyType
  - = SshRsa
  - | SshDsa
  - | SshEcdsa
  - | SshEd25519
- sshKeyTypeParam :: SshKeyType -> String
- data DnsSecKey
  - = PubZSK
  - | PrivZSK
  - | PubKSK
  - | PrivKSK

# Documentation

data PrivDataField Source #

Note that removing or changing constructors or changing types will break the serialized privdata files, so don't do that! It's fine to add new constructors.

Constructors

DockerAuthentication |
SshPubKey SshKeyType UserName | Not used anymore, but retained to avoid breaking serialization of old files
SshPrivKey SshKeyType UserName | For host key, use empty UserName
SshAuthorizedKeys UserName |
Password UserName |
CryptPassword UserName |
PrivFile FilePath |
GpgKey |
DnsSec DnsSecKey |

Instances

Eq PrivDataField Source # |
Methods (==) :: PrivDataField -> PrivDataField -> Bool (/=) :: PrivDataField -> PrivDataField -> Bool
Ord PrivDataField Source # |
Methods compare :: PrivDataField -> PrivDataField -> Ordering (<) :: PrivDataField -> PrivDataField -> Bool (<=) :: PrivDataField -> PrivDataField -> Bool (>) :: PrivDataField -> PrivDataField -> Bool (>=) :: PrivDataField -> PrivDataField -> Bool max :: PrivDataField -> PrivDataField -> PrivDataField min :: PrivDataField -> PrivDataField -> PrivDataField
Read PrivDataField Source # |
Methods readsPrec :: Int -> ReadS PrivDataField readList :: ReadS [PrivDataField] readPrec :: ReadPrec PrivDataField readListPrec :: ReadPrec [PrivDataField]
Show PrivDataField Source # |
Methods showsPrec :: Int -> PrivDataField -> ShowS show :: PrivDataField -> String showList :: [PrivDataField] -> ShowS
IsPrivDataSource PrivDataField Source # |
Methods privDataField :: PrivDataField -> PrivDataField Source # describePrivDataSource :: PrivDataField -> Maybe PrivDataSourceDesc Source #

data PrivDataSource Source #

Combines a PrivDataField with a description of how to generate its value.

Constructors

PrivDataSourceFile PrivDataField FilePath |
PrivDataSourceFileFromCommand PrivDataField FilePath String |
PrivDataSource PrivDataField String |

Instances

IsPrivDataSource PrivDataSource Source # |
Methods privDataField :: PrivDataSource -> PrivDataField Source # describePrivDataSource :: PrivDataSource -> Maybe PrivDataSourceDesc Source #

type PrivDataSourceDesc = String Source #

class IsPrivDataSource s where Source #

Minimal complete definition

privDataField, describePrivDataSource

Methods

privDataField :: s -> PrivDataField Source #

describePrivDataSource :: s -> Maybe PrivDataSourceDesc Source #

Instances

IsPrivDataSource PrivDataSource Source # |
Methods privDataField :: PrivDataSource -> PrivDataField Source # describePrivDataSource :: PrivDataSource -> Maybe PrivDataSourceDesc Source #
IsPrivDataSource PrivDataField Source # |
Methods privDataField :: PrivDataField -> PrivDataField Source # describePrivDataSource :: PrivDataField -> Maybe PrivDataSourceDesc Source #

newtype Context Source #

A context in which a PrivDataField is used.

Often this will be a domain name. For example, Context "www.example.com" could be used for the SSL cert for the web server serving that domain. Multiple hosts might use that privdata.

This appears in serialized privdata files.

Constructors

Context String |

Instances

Eq Context Source # |
Methods (==) :: Context -> Context -> Bool (/=) :: Context -> Context -> Bool
Ord Context Source # |
Methods compare :: Context -> Context -> Ordering (<) :: Context -> Context -> Bool (<=) :: Context -> Context -> Bool (>) :: Context -> Context -> Bool (>=) :: Context -> Context -> Bool max :: Context -> Context -> Context min :: Context -> Context -> Context
Read Context Source # |
Methods readsPrec :: Int -> ReadS Context readList :: ReadS [Context] readPrec :: ReadPrec Context readListPrec :: ReadPrec [Context]
Show Context Source # |
Methods showsPrec :: Int -> Context -> ShowS show :: Context -> String showList :: [Context] -> ShowS
IsContext Context Source # |
Methods asContext :: HostName -> Context -> Context Source # asHostContext :: Context -> HostContext Source #

newtype HostContext Source #

A context that may vary depending on the HostName where it's used.

Constructors

HostContext |

Fields

- mkHostContext :: HostName -> Context

Instances

Eq HostContext Source # |
Methods (==) :: HostContext -> HostContext -> Bool (/=) :: HostContext -> HostContext -> Bool
Ord HostContext Source # |
Methods compare :: HostContext -> HostContext -> Ordering (<) :: HostContext -> HostContext -> Bool (<=) :: HostContext -> HostContext -> Bool (>) :: HostContext -> HostContext -> Bool (>=) :: HostContext -> HostContext -> Bool max :: HostContext -> HostContext -> HostContext min :: HostContext -> HostContext -> HostContext
Show HostContext Source # |
Methods showsPrec :: Int -> HostContext -> ShowS show :: HostContext -> String showList :: [HostContext] -> ShowS
IsContext HostContext Source # |
Methods asContext :: HostName -> HostContext -> Context Source # asHostContext :: HostContext -> HostContext Source #

class IsContext c where Source #

Class of things that can be used as a Context.

Minimal complete definition

asContext, asHostContext

Methods

asContext :: HostName -> c -> Context Source #

asHostContext :: c -> HostContext Source #

Instances

IsContext HostContext Source # |
Methods asContext :: HostName -> HostContext -> Context Source # asHostContext :: HostContext -> HostContext Source #
IsContext Context Source # |
Methods asContext :: HostName -> Context -> Context Source # asHostContext :: Context -> HostContext Source #

anyContext :: Context Source #

Use when a PrivDataField is not dependent on any paricular context.

hostContext :: HostContext Source #

Makes a HostContext that consists just of the hostname.

newtype PrivData Source #

Contains the actual private data.

Note that this may contain exta newlines at the end, or they may have been stripped off, depending on how the user entered the privdata, and which version of propellor stored it. Use the accessor functions below to avoid newline problems.

Constructors

PrivData String |

privDataLines :: PrivData -> [String] Source #

When PrivData is the content of a file, this is the lines thereof.

privDataVal :: PrivData -> String Source #

When the PrivData is a single value, like a password, this extracts it. Note that if multiple lines are present in the PrivData, only the first is returned; there is never a newline in the String.

privDataByteString :: PrivData -> ByteString Source #

Use to get ByteString out of PrivData.

data SshKeyType Source #

Constructors

SshRsa |
SshDsa |
SshEcdsa |
SshEd25519 |

Instances

Bounded SshKeyType Source # |
Methods minBound :: SshKeyType maxBound :: SshKeyType
Enum SshKeyType Source # |
Methods succ :: SshKeyType -> SshKeyType pred :: SshKeyType -> SshKeyType toEnum :: Int -> SshKeyType fromEnum :: SshKeyType -> Int enumFrom :: SshKeyType -> [SshKeyType] enumFromThen :: SshKeyType -> SshKeyType -> [SshKeyType] enumFromTo :: SshKeyType -> SshKeyType -> [SshKeyType] enumFromThenTo :: SshKeyType -> SshKeyType -> SshKeyType -> [SshKeyType]
Eq SshKeyType Source # |
Methods (==) :: SshKeyType -> SshKeyType -> Bool (/=) :: SshKeyType -> SshKeyType -> Bool
Ord SshKeyType Source # |
Methods compare :: SshKeyType -> SshKeyType -> Ordering (<) :: SshKeyType -> SshKeyType -> Bool (<=) :: SshKeyType -> SshKeyType -> Bool (>) :: SshKeyType -> SshKeyType -> Bool (>=) :: SshKeyType -> SshKeyType -> Bool max :: SshKeyType -> SshKeyType -> SshKeyType min :: SshKeyType -> SshKeyType -> SshKeyType
Read SshKeyType Source # |
Methods readsPrec :: Int -> ReadS SshKeyType readList :: ReadS [SshKeyType] readPrec :: ReadPrec SshKeyType readListPrec :: ReadPrec [SshKeyType]
Show SshKeyType Source # |
Methods showsPrec :: Int -> SshKeyType -> ShowS show :: SshKeyType -> String showList :: [SshKeyType] -> ShowS

sshKeyTypeParam :: SshKeyType -> String Source #

Parameter that would be passed to ssh-keygen to generate key of this type

data DnsSecKey Source #

Constructors

PubZSK | DNSSEC Zone Signing Key (public)
PrivZSK | DNSSEC Zone Signing Key (private)
PubKSK | DNSSEC Key Signing Key (public)
PrivKSK | DNSSEC Key Signing Key (private)

Instances

Bounded DnsSecKey Source # |
Methods minBound :: DnsSecKey maxBound :: DnsSecKey
Enum DnsSecKey Source # |
Methods succ :: DnsSecKey -> DnsSecKey pred :: DnsSecKey -> DnsSecKey toEnum :: Int -> DnsSecKey fromEnum :: DnsSecKey -> Int enumFrom :: DnsSecKey -> [DnsSecKey] enumFromThen :: DnsSecKey -> DnsSecKey -> [DnsSecKey] enumFromTo :: DnsSecKey -> DnsSecKey -> [DnsSecKey] enumFromThenTo :: DnsSecKey -> DnsSecKey -> DnsSecKey -> [DnsSecKey]
Eq DnsSecKey Source # |
Methods (==) :: DnsSecKey -> DnsSecKey -> Bool (/=) :: DnsSecKey -> DnsSecKey -> Bool
Ord DnsSecKey Source # |
Methods compare :: DnsSecKey -> DnsSecKey -> Ordering (<) :: DnsSecKey -> DnsSecKey -> Bool (<=) :: DnsSecKey -> DnsSecKey -> Bool (>) :: DnsSecKey -> DnsSecKey -> Bool (>=) :: DnsSecKey -> DnsSecKey -> Bool max :: DnsSecKey -> DnsSecKey -> DnsSecKey min :: DnsSecKey -> DnsSecKey -> DnsSecKey
Read DnsSecKey Source # |
Methods readsPrec :: Int -> ReadS DnsSecKey readList :: ReadS [DnsSecKey] readPrec :: ReadPrec DnsSecKey readListPrec :: ReadPrec [DnsSecKey]
Show DnsSecKey Source # |
Methods showsPrec :: Int -> DnsSecKey -> ShowS show :: DnsSecKey -> String showList :: [DnsSecKey] -> ShowS