summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Gpg.hs
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2014-11-17 17:02:47 -0400
committerJoey Hess <joey@kitenet.net>2014-11-17 17:02:47 -0400
commit2fab1a08b4f197874ad6c613f118315ab0d474a3 (patch)
tree025353fea85436242bb706cd75914d85c3fca98f /src/Propellor/Property/Gpg.hs
parent90f5cff061e11a06d3f37fdd5424b49678a2b07d (diff)
parentfbd8ea3b3d46b8cb56f3b9c82847cc849a37f89d (diff)
Merge branch 'joeyconfig'
Diffstat (limited to 'src/Propellor/Property/Gpg.hs')
-rw-r--r--src/Propellor/Property/Gpg.hs8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/Propellor/Property/Gpg.hs b/src/Propellor/Property/Gpg.hs
index b4698663..5819ea7b 100644
--- a/src/Propellor/Property/Gpg.hs
+++ b/src/Propellor/Property/Gpg.hs
@@ -9,7 +9,8 @@ import System.PosixCompat
installed :: Property
installed = Apt.installed ["gnupg"]
-type GpgKeyId = String
+-- A numeric id, or a description of the key, in a form understood by gpg.
+newtype GpgKeyId = GpgKeyId { getGpgKeyId :: String }
-- | Sets up a user with a gpg key from the privdata.
--
@@ -19,11 +20,8 @@ type GpgKeyId = String
--
-- Recommend only using this for low-value dedicated role keys.
-- No attempt has been made to scrub the key out of memory once it's used.
---
--- The GpgKeyId does not have to be a numeric id; it can just as easily
--- be a description of the key.
keyImported :: GpgKeyId -> UserName -> Property
-keyImported keyid user = flagFile' prop genflag
+keyImported (GpgKeyId keyid) user = flagFile' prop genflag
`requires` installed
where
desc = user ++ " has gpg key " ++ show keyid