diff --git a/src/Network/Minio.hs b/src/Network/Minio.hs index d79c11d..0cc6632 100644 --- a/src/Network/Minio.hs +++ b/src/Network/Minio.hs @@ -20,9 +20,11 @@ module Network.Minio ( -- * Credentials Credentials (..) + , Provider , fromAWSConfigFile , fromAWSEnv , fromMinioEnv + , findFirst -- * Connecting to object storage --------------------------------- diff --git a/src/Network/Minio/Data.hs b/src/Network/Minio/Data.hs index d48d6e2..349adbf 100644 --- a/src/Network/Minio/Data.hs +++ b/src/Network/Minio/Data.hs @@ -113,8 +113,11 @@ data Credentials = Credentials { cAccessKey :: Text , cSecretKey :: Text } deriving (Eq, Show) +-- | A Provider is an action that may return Credentials type Provider = IO (Maybe Credentials) +-- | Combines the given list of providers, by calling each one in +-- order until Credentials are found. findFirst :: [Provider] -> Provider findFirst [] = return Nothing findFirst (f:fs) = do c <- f