@@ -18,9 +18,9 @@ use schemars::JsonSchema;
1818use serde:: { Deserialize , Serialize } ;
1919
2020mod clients;
21- mod csrf;
2221mod database;
2322mod email;
23+ mod hack;
2424mod http;
2525mod matrix;
2626mod passwords;
@@ -32,9 +32,9 @@ mod upstream_oauth2;
3232
3333pub use self :: {
3434 clients:: { ClientAuthMethodConfig , ClientConfig , ClientsConfig } ,
35- csrf:: CsrfConfig ,
3635 database:: { ConnectConfig as DatabaseConnectConfig , DatabaseConfig } ,
3736 email:: { EmailConfig , EmailSmtpMode , EmailTransportConfig } ,
37+ hack:: HackConfig ,
3838 http:: {
3939 BindConfig as HttpBindConfig , HttpConfig , ListenerConfig as HttpListenerConfig ,
4040 Resource as HttpResource , TlsConfig as HttpTlsConfig , UnixOrTcp ,
@@ -81,10 +81,6 @@ pub struct RootConfig {
8181 #[ serde( default ) ]
8282 pub templates : TemplatesConfig ,
8383
84- /// Configuration related to Cross-Site Request Forgery protections
85- #[ serde( default ) ]
86- pub csrf : CsrfConfig ,
87-
8884 /// Configuration related to sending emails
8985 #[ serde( default ) ]
9086 pub email : EmailConfig ,
@@ -106,6 +102,10 @@ pub struct RootConfig {
106102 /// Configuration related to upstream OAuth providers
107103 #[ serde( default ) ]
108104 pub upstream_oauth2 : UpstreamOAuth2Config ,
105+
106+ /// Miscellaneous configuration options
107+ #[ serde( default ) ]
108+ pub hack : HackConfig ,
109109}
110110
111111#[ async_trait]
@@ -124,13 +124,13 @@ impl ConfigurationSection for RootConfig {
124124 database : DatabaseConfig :: generate ( & mut rng) . await ?,
125125 telemetry : TelemetryConfig :: generate ( & mut rng) . await ?,
126126 templates : TemplatesConfig :: generate ( & mut rng) . await ?,
127- csrf : CsrfConfig :: generate ( & mut rng) . await ?,
128127 email : EmailConfig :: generate ( & mut rng) . await ?,
129128 passwords : PasswordsConfig :: generate ( & mut rng) . await ?,
130129 secrets : SecretsConfig :: generate ( & mut rng) . await ?,
131130 matrix : MatrixConfig :: generate ( & mut rng) . await ?,
132131 policy : PolicyConfig :: generate ( & mut rng) . await ?,
133132 upstream_oauth2 : UpstreamOAuth2Config :: generate ( & mut rng) . await ?,
133+ hack : HackConfig :: generate ( & mut rng) . await ?,
134134 } )
135135 }
136136
@@ -142,12 +142,12 @@ impl ConfigurationSection for RootConfig {
142142 telemetry : TelemetryConfig :: test ( ) ,
143143 templates : TemplatesConfig :: test ( ) ,
144144 passwords : PasswordsConfig :: test ( ) ,
145- csrf : CsrfConfig :: test ( ) ,
146145 email : EmailConfig :: test ( ) ,
147146 secrets : SecretsConfig :: test ( ) ,
148147 matrix : MatrixConfig :: test ( ) ,
149148 policy : PolicyConfig :: test ( ) ,
150149 upstream_oauth2 : UpstreamOAuth2Config :: test ( ) ,
150+ hack : HackConfig :: test ( ) ,
151151 }
152152 }
153153}
@@ -165,9 +165,6 @@ pub struct AppConfig {
165165 #[ serde( default ) ]
166166 pub templates : TemplatesConfig ,
167167
168- #[ serde( default ) ]
169- pub csrf : CsrfConfig ,
170-
171168 #[ serde( default ) ]
172169 pub email : EmailConfig ,
173170
@@ -180,6 +177,9 @@ pub struct AppConfig {
180177
181178 #[ serde( default ) ]
182179 pub policy : PolicyConfig ,
180+
181+ #[ serde( default ) ]
182+ pub hack : HackConfig ,
183183}
184184
185185#[ async_trait]
@@ -196,12 +196,12 @@ impl ConfigurationSection for AppConfig {
196196 http : HttpConfig :: generate ( & mut rng) . await ?,
197197 database : DatabaseConfig :: generate ( & mut rng) . await ?,
198198 templates : TemplatesConfig :: generate ( & mut rng) . await ?,
199- csrf : CsrfConfig :: generate ( & mut rng) . await ?,
200199 email : EmailConfig :: generate ( & mut rng) . await ?,
201200 passwords : PasswordsConfig :: generate ( & mut rng) . await ?,
202201 secrets : SecretsConfig :: generate ( & mut rng) . await ?,
203202 matrix : MatrixConfig :: generate ( & mut rng) . await ?,
204203 policy : PolicyConfig :: generate ( & mut rng) . await ?,
204+ hack : HackConfig :: generate ( & mut rng) . await ?,
205205 } )
206206 }
207207
@@ -211,11 +211,11 @@ impl ConfigurationSection for AppConfig {
211211 database : DatabaseConfig :: test ( ) ,
212212 templates : TemplatesConfig :: test ( ) ,
213213 passwords : PasswordsConfig :: test ( ) ,
214- csrf : CsrfConfig :: test ( ) ,
215214 email : EmailConfig :: test ( ) ,
216215 secrets : SecretsConfig :: test ( ) ,
217216 matrix : MatrixConfig :: test ( ) ,
218217 policy : PolicyConfig :: test ( ) ,
218+ hack : HackConfig :: test ( ) ,
219219 }
220220 }
221221}
0 commit comments