thentos-core-0.0.1.1: The swiss army knife of privacy-preserving identity management

Safe HaskellNone
LanguageHaskell2010

Thentos.Config

Contents

Synopsis

config structure

type ThentosConfig = Tagged (ToConfigCode ThentosConfig')

type ThentosConfig' = Maybe (("frontend" :> HttpConfig') :>: "HTTP server for html forms.") :*> (Maybe (("backend" :> HttpConfig') :>: "HTTP server for rest api.") :*> (Maybe (("purescript" :> ST) :>: "File system location of frontend code") :*> (Maybe (("proxy" :> ProxyConfig') :>: "The default proxied app.") :*> (Maybe (("proxies" :> [ProxyConfig']) :>: "A list of proxied apps.") :*> ((("smtp" :> SmtpConfig') :>: "Sending email.") :*> ((("database" :> DatabaseConfig') :>: "The database.") :*> (Maybe (("default_user" :> DefaultUserConfig') :>: "A user that is created if the user table is empty.") :*> ((("user_reg_expiration" :> Timeout) :>: "User registration expiration period") :*> ((("pw_reset_expiration" :> Timeout) :>: "Password registration token expiration period") :*> ((("email_change_expiration" :> Timeout) :>: "Email-change-token expiration period") :*> ((("captcha_expiration" :> Timeout) :>: "Captcha expiration period") :*> (Maybe (("gc_interval" :> Timeout) :>: "Garbage collection interval") :*> ((("log" :> LogConfig') :>: "Logging") :*> (("mail" :> MailConfig') :>: "Mail templates"))))))))))))))

defaultThentosConfig :: ToConfig (ToConfigCode ThentosConfig') Maybe

type HttpConfig = Tagged (ToConfigCode HttpConfig')

type HttpConfig' = Maybe (("bind_schema" :> HttpSchema) :>: "Http schema that the server experiences. Differs from expose_schema e.g. when running behind nginx.") :*> ((("bind_host" :> ST) :>: "Host name that the server experiences. Differs from expose_host e.g. when running behind nginx.") :*> ((("bind_port" :> Int) :>: "Host port that the server experiences. Differs from expose_port e.g. when running behind nginx.") :*> (Maybe (("expose_schema" :> HttpSchema) :>: "Http schema that the client experiences. Differs from bind_schema e.g. when running behind nginx.") :*> (Maybe (("expose_host" :> ST) :>: "Host name that the client experiences. Differs from bind_host e.g. when running behind nginx.") :*> Maybe (("expose_port" :> Int) :>: "Host port that the client experiences. Differs from bind_port e.g. when running behind nginx.")))))

type ProxyConfig = Tagged (ToConfigCode ProxyConfig')

type ProxyConfig' = ("service_id" :> ST) :*> ("endpoint" :> ProxyUri)

type SmtpConfig = Tagged (ToConfigCode SmtpConfig')

type SmtpConfig' = Maybe ("sender_name" :> ST) :*> (("sender_address" :> ST) :*> (("sendmail_path" :> ST) :*> ("sendmail_args" :> [ST])))

defaultSmtpConfig :: ToConfig (ToConfigCode SmtpConfig') Maybe

type DatabaseConfig = Tagged (ToConfigCode DatabaseConfig')

type DatabaseConfig' = "name" :> ST

defaultDatabaseConfig :: ToConfig (ToConfigCode DatabaseConfig') Maybe

type DefaultUserConfig = Tagged (ToConfigCode DefaultUserConfig')

type DefaultUserConfig' = ("name" :> ST) :*> (("password" :> ST) :*> (("email" :> UserEmail) :*> Maybe ("roles" :> [Role])))

type LogConfig = Tagged (ToConfigCode LogConfig')

type LogConfig' = ("path" :> ST) :*> ("level" :> Prio)

type MailConfig = Tagged (ToConfigCode MailConfig')

type MailConfig' = "account_verification" :> AccountVerificationConfig'

type AccountVerificationConfig' = ("subject" :> ST) :*> ("body" :> ST)

defaultMailConfig :: ToConfig (ToConfigCode MailConfig') Maybe

leaf types

driver

helpers

_renderUrl :: Maybe HttpSchema -> ST -> Int -> ST

logging

configLogger :: ST -> Prio -> IO ()