namespace MyWebLog open MyWebLog.Data.RethinkDB open Newtonsoft.Json open System.Text /// Configuration for this myWebLog instance type AppConfig = { /// The text from which to derive salt to use for passwords [] PasswordSaltString : string /// The text from which to derive salt to use for forms authentication [] AuthSaltString : string /// The encryption passphrase to use for forms authentication [] AuthEncryptionPassphrase : string /// The HMAC passphrase to use for forms authentication [] AuthHmacPassphrase : string /// The data configuration [] DataConfig : DataConfig } with /// The salt to use for passwords member this.PasswordSalt = Encoding.UTF8.GetBytes this.PasswordSaltString /// The salt to use for forms authentication member this.AuthSalt = Encoding.UTF8.GetBytes this.AuthSaltString /// Deserialize the configuration from the JSON file static member FromJson json = let cfg = JsonConvert.DeserializeObject json { cfg with DataConfig = DataConfig.Connect cfg.DataConfig }