@element-hq/element-web-playwright-common 1.4.3 → 1.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1383 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * This file was automatically generated by json-schema-to-typescript.
4
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5
+ * and run json-schema-to-typescript to regenerate this file.
6
+ */
7
+
8
+ /**
9
+ * Authentication method used by clients
10
+ */
11
+ export type ClientAuthMethodConfig =
12
+ | "none"
13
+ | "client_secret_basic"
14
+ | "client_secret_post"
15
+ | "client_secret_jwt"
16
+ | "private_key_jwt";
17
+ export type JsonWebKeyFor_JsonWebKeyPublicParameters = {
18
+ "use"?: JsonWebKeyUse;
19
+ "key_ops"?: JsonWebKeyOperation[];
20
+ "alg"?: JsonWebSignatureAlg;
21
+ "kid"?: string;
22
+ "x5u"?: string;
23
+ "x5c"?: string[];
24
+ "x5t"?: string;
25
+ "x5t#S256"?: string;
26
+ [k: string]: unknown;
27
+ } & JsonWebKeyFor_JsonWebKeyPublicParameters1;
28
+ /**
29
+ * JSON Web Key Use
30
+ */
31
+ export type JsonWebKeyUse = "sig" | "enc";
32
+ /**
33
+ * JSON Web Key Operation
34
+ */
35
+ export type JsonWebKeyOperation =
36
+ | "sign"
37
+ | "verify"
38
+ | "encrypt"
39
+ | "decrypt"
40
+ | "wrapKey"
41
+ | "unwrapKey"
42
+ | "deriveKey"
43
+ | "deriveBits";
44
+ /**
45
+ * JSON Web Signature "alg" parameter
46
+ */
47
+ export type JsonWebSignatureAlg =
48
+ | "HS256"
49
+ | "HS384"
50
+ | "HS512"
51
+ | "RS256"
52
+ | "RS384"
53
+ | "RS512"
54
+ | "ES256"
55
+ | "ES384"
56
+ | "ES512"
57
+ | "PS256"
58
+ | "PS384"
59
+ | "PS512"
60
+ | "none"
61
+ | "EdDSA"
62
+ | "ES256K"
63
+ | "Ed25519"
64
+ | "Ed448";
65
+ export type JsonWebKeyFor_JsonWebKeyPublicParameters1 =
66
+ | {
67
+ kty: "RSA";
68
+ n: string;
69
+ e: string;
70
+ [k: string]: unknown;
71
+ }
72
+ | {
73
+ kty: "EC";
74
+ crv: JsonWebKeyEcEllipticCurve;
75
+ x: string;
76
+ y: string;
77
+ [k: string]: unknown;
78
+ }
79
+ | {
80
+ kty: "OKP";
81
+ crv: JsonWebKeyOkpEllipticCurve;
82
+ x: string;
83
+ [k: string]: unknown;
84
+ };
85
+ /**
86
+ * JSON Web Key EC Elliptic Curve
87
+ */
88
+ export type JsonWebKeyEcEllipticCurve = "P-256" | "P-384" | "P-521" | "secp256k1";
89
+ /**
90
+ * JSON Web Key OKP Elliptic Curve
91
+ */
92
+ export type JsonWebKeyOkpEllipticCurve = "Ed25519" | "Ed448" | "X25519" | "X448";
93
+ /**
94
+ * HTTP resources to mount
95
+ */
96
+ export type Resource =
97
+ | {
98
+ name: "health";
99
+ [k: string]: unknown;
100
+ }
101
+ | {
102
+ name: "prometheus";
103
+ [k: string]: unknown;
104
+ }
105
+ | {
106
+ name: "discovery";
107
+ [k: string]: unknown;
108
+ }
109
+ | {
110
+ name: "human";
111
+ [k: string]: unknown;
112
+ }
113
+ | {
114
+ name: "graphql";
115
+ /**
116
+ * Enabled the GraphQL playground
117
+ */
118
+ playground?: boolean;
119
+ /**
120
+ * Allow access for OAuth 2.0 clients (undocumented)
121
+ */
122
+ undocumented_oauth2_access?: boolean;
123
+ [k: string]: unknown;
124
+ }
125
+ | {
126
+ name: "oauth";
127
+ [k: string]: unknown;
128
+ }
129
+ | {
130
+ name: "compat";
131
+ [k: string]: unknown;
132
+ }
133
+ | {
134
+ name: "assets";
135
+ /**
136
+ * Path to the directory to serve.
137
+ */
138
+ path?: string;
139
+ [k: string]: unknown;
140
+ }
141
+ | {
142
+ name: "adminapi";
143
+ [k: string]: unknown;
144
+ }
145
+ | {
146
+ name: "connection-info";
147
+ [k: string]: unknown;
148
+ };
149
+ /**
150
+ * Configuration of a single listener
151
+ */
152
+ export type BindConfig =
153
+ | {
154
+ /**
155
+ * Host on which to listen.
156
+ *
157
+ * Defaults to listening on all addresses
158
+ */
159
+ host?: string;
160
+ /**
161
+ * Port on which to listen.
162
+ */
163
+ port: number;
164
+ [k: string]: unknown;
165
+ }
166
+ | {
167
+ /**
168
+ * Host and port on which to listen
169
+ */
170
+ address: string;
171
+ [k: string]: unknown;
172
+ }
173
+ | {
174
+ /**
175
+ * Path to the socket
176
+ */
177
+ socket: string;
178
+ [k: string]: unknown;
179
+ }
180
+ | {
181
+ /**
182
+ * Index of the file descriptor. Note that this is offseted by 3 because of the standard input/output sockets, so setting here a value of `0` will grab the file descriptor `3`
183
+ */
184
+ fd?: number;
185
+ /**
186
+ * Whether the socket is a TCP socket or a UNIX domain socket. Defaults to TCP.
187
+ */
188
+ kind?: UnixOrTcp & string;
189
+ [k: string]: unknown;
190
+ };
191
+ /**
192
+ * Kind of socket
193
+ */
194
+ export type UnixOrTcp = "unix" | "tcp";
195
+ export type IpNetwork = V4 | V6;
196
+ export type V4 = Ipv4Network;
197
+ export type Ipv4Network = string;
198
+ export type V6 = Ipv6Network;
199
+ export type Ipv6Network = string;
200
+ export type Hostname = string;
201
+ /**
202
+ * Options for controlling the level of protection provided for PostgreSQL SSL connections.
203
+ */
204
+ export type PgSslMode = "disable" | "allow" | "prefer" | "require" | "verify-ca" | "verify-full";
205
+ /**
206
+ * Exporter to use when exporting traces
207
+ */
208
+ export type TracingExporterKind = "none" | "stdout" | "otlp";
209
+ /**
210
+ * Propagation format for incoming and outgoing requests
211
+ */
212
+ export type Propagator = "tracecontext" | "baggage" | "jaeger";
213
+ /**
214
+ * Exporter to use when exporting metrics
215
+ */
216
+ export type MetricsExporterKind = "none" | "stdout" | "otlp" | "prometheus";
217
+ /**
218
+ * What backend should be used when sending emails
219
+ */
220
+ export type EmailTransportKind = "blackhole" | "smtp" | "sendmail";
221
+ /**
222
+ * Encryption mode to use
223
+ */
224
+ export type EmailSmtpMode = "plain" | "starttls" | "tls";
225
+ /**
226
+ * A hashing algorithm
227
+ */
228
+ export type Algorithm = "bcrypt" | "argon2id" | "pbkdf2";
229
+ /**
230
+ * The kind of homeserver it is.
231
+ */
232
+ export type HomeserverKind = "synapse" | "synapse_read_only" | "synapse_legacy" | "synapse_modern";
233
+ /**
234
+ * Authentication methods used against the OAuth 2.0 provider
235
+ */
236
+ export type TokenAuthMethod =
237
+ | "none"
238
+ | "client_secret_basic"
239
+ | "client_secret_post"
240
+ | "client_secret_jwt"
241
+ | "private_key_jwt"
242
+ | "sign_in_with_apple";
243
+ /**
244
+ * How to discover the provider's configuration
245
+ */
246
+ export type DiscoveryMode = "oidc" | "insecure" | "disabled";
247
+ /**
248
+ * Whether to use proof key for code exchange (PKCE) when requesting and exchanging the token.
249
+ */
250
+ export type PkceMethod = "auto" | "always" | "never";
251
+ /**
252
+ * The response mode we ask the provider to use for the callback
253
+ */
254
+ export type ResponseMode = "query" | "form_post";
255
+ /**
256
+ * How to handle a claim
257
+ */
258
+ export type ImportAction = "ignore" | "suggest" | "force" | "require";
259
+ /**
260
+ * How to handle an existing localpart claim
261
+ */
262
+ export type OnConflict = "fail" | "add";
263
+ /**
264
+ * What to do when receiving an OIDC Backchannel logout request.
265
+ */
266
+ export type OnBackchannelLogout = "do_nothing" | "logout_browser_only" | "logout_all";
267
+ /**
268
+ * Which service should be used for CAPTCHA protection
269
+ */
270
+ export type CaptchaServiceKind = "recaptcha_v2" | "cloudflare_turnstile" | "hcaptcha";
271
+
272
+ /**
273
+ * Application configuration root
274
+ */
275
+ export interface RootConfig {
276
+ /**
277
+ * List of OAuth 2.0/OIDC clients config
278
+ */
279
+ clients?: ClientConfig[];
280
+ /**
281
+ * Configuration of the HTTP server
282
+ */
283
+ http?: HttpConfig;
284
+ /**
285
+ * Database connection configuration
286
+ */
287
+ database?: DatabaseConfig;
288
+ /**
289
+ * Configuration related to sending monitoring data
290
+ */
291
+ telemetry?: TelemetryConfig;
292
+ /**
293
+ * Configuration related to templates
294
+ */
295
+ templates?: TemplatesConfig;
296
+ /**
297
+ * Configuration related to sending emails
298
+ */
299
+ email?: EmailConfig;
300
+ /**
301
+ * Application secrets
302
+ */
303
+ secrets: SecretsConfig;
304
+ /**
305
+ * Configuration related to user passwords
306
+ */
307
+ passwords?: PasswordsConfig;
308
+ /**
309
+ * Configuration related to the homeserver
310
+ */
311
+ matrix: MatrixConfig;
312
+ /**
313
+ * Configuration related to the OPA policies
314
+ */
315
+ policy?: PolicyConfig;
316
+ /**
317
+ * Configuration related to limiting the rate of user actions to prevent abuse
318
+ */
319
+ rate_limiting?: RateLimitingConfig;
320
+ /**
321
+ * Configuration related to upstream OAuth providers
322
+ */
323
+ upstream_oauth2?: UpstreamOAuth2Config;
324
+ /**
325
+ * Configuration section for tweaking the branding of the service
326
+ */
327
+ branding?: BrandingConfig;
328
+ /**
329
+ * Configuration section to setup CAPTCHA protection on a few operations
330
+ */
331
+ captcha?: CaptchaConfig;
332
+ /**
333
+ * Configuration section to configure features related to account management
334
+ */
335
+ account?: AccountConfig;
336
+ /**
337
+ * Experimental configuration options
338
+ */
339
+ experimental?: ExperimentalConfig;
340
+ [k: string]: unknown;
341
+ }
342
+ /**
343
+ * An OAuth 2.0 client configuration
344
+ */
345
+ export interface ClientConfig {
346
+ /**
347
+ * A ULID as per https://github.com/ulid/spec
348
+ */
349
+ client_id: string;
350
+ /**
351
+ * Authentication method used for this client
352
+ */
353
+ client_auth_method: ClientAuthMethodConfig;
354
+ /**
355
+ * Name of the `OAuth2` client
356
+ */
357
+ client_name?: string;
358
+ /**
359
+ * The client secret, used by the `client_secret_basic`, `client_secret_post` and `client_secret_jwt` authentication methods
360
+ */
361
+ client_secret?: string;
362
+ /**
363
+ * The JSON Web Key Set (JWKS) used by the `private_key_jwt` authentication method. Mutually exclusive with `jwks_uri`
364
+ */
365
+ jwks?: JsonWebKeySetFor_JsonWebKeyPublicParameters;
366
+ /**
367
+ * The URL of the JSON Web Key Set (JWKS) used by the `private_key_jwt` authentication method. Mutually exclusive with `jwks`
368
+ */
369
+ jwks_uri?: string;
370
+ /**
371
+ * List of allowed redirect URIs
372
+ */
373
+ redirect_uris?: string[];
374
+ [k: string]: unknown;
375
+ }
376
+ export interface JsonWebKeySetFor_JsonWebKeyPublicParameters {
377
+ keys: JsonWebKeyFor_JsonWebKeyPublicParameters[];
378
+ [k: string]: unknown;
379
+ }
380
+ /**
381
+ * Configuration related to the web server
382
+ */
383
+ export interface HttpConfig {
384
+ /**
385
+ * List of listeners to run
386
+ */
387
+ listeners?: ListenerConfig[];
388
+ /**
389
+ * List of trusted reverse proxies that can set the `X-Forwarded-For` header
390
+ */
391
+ trusted_proxies?: IpNetwork[];
392
+ /**
393
+ * Public URL base from where the authentication service is reachable
394
+ */
395
+ public_base: string;
396
+ /**
397
+ * OIDC issuer URL. Defaults to `public_base` if not set.
398
+ */
399
+ issuer?: string;
400
+ [k: string]: unknown;
401
+ }
402
+ /**
403
+ * Configuration of a listener
404
+ */
405
+ export interface ListenerConfig {
406
+ /**
407
+ * A unique name for this listener which will be shown in traces and in metrics labels
408
+ */
409
+ name?: string;
410
+ /**
411
+ * List of resources to mount
412
+ */
413
+ resources: Resource[];
414
+ /**
415
+ * HTTP prefix to mount the resources on
416
+ */
417
+ prefix?: string;
418
+ /**
419
+ * List of sockets to bind
420
+ */
421
+ binds: BindConfig[];
422
+ /**
423
+ * Accept `HAProxy`'s Proxy Protocol V1
424
+ */
425
+ proxy_protocol?: boolean;
426
+ /**
427
+ * If set, makes the listener use TLS with the provided certificate and key
428
+ */
429
+ tls?: TlsConfig;
430
+ [k: string]: unknown;
431
+ }
432
+ /**
433
+ * Configuration related to TLS on a listener
434
+ */
435
+ export interface TlsConfig {
436
+ /**
437
+ * PEM-encoded X509 certificate chain
438
+ *
439
+ * Exactly one of `certificate` or `certificate_file` must be set.
440
+ */
441
+ certificate?: string;
442
+ /**
443
+ * File containing the PEM-encoded X509 certificate chain
444
+ *
445
+ * Exactly one of `certificate` or `certificate_file` must be set.
446
+ */
447
+ certificate_file?: string;
448
+ /**
449
+ * PEM-encoded private key
450
+ *
451
+ * Exactly one of `key` or `key_file` must be set.
452
+ */
453
+ key?: string;
454
+ /**
455
+ * File containing a PEM or DER-encoded private key
456
+ *
457
+ * Exactly one of `key` or `key_file` must be set.
458
+ */
459
+ key_file?: string;
460
+ /**
461
+ * Password used to decode the private key
462
+ *
463
+ * One of `password` or `password_file` must be set if the key is encrypted.
464
+ */
465
+ password?: string;
466
+ /**
467
+ * Password file used to decode the private key
468
+ *
469
+ * One of `password` or `password_file` must be set if the key is encrypted.
470
+ */
471
+ password_file?: string;
472
+ [k: string]: unknown;
473
+ }
474
+ /**
475
+ * Database connection configuration
476
+ */
477
+ export interface DatabaseConfig {
478
+ /**
479
+ * Connection URI
480
+ *
481
+ * This must not be specified if `host`, `port`, `socket`, `username`, `password`, or `database` are specified.
482
+ */
483
+ uri?: string;
484
+ /**
485
+ * Name of host to connect to
486
+ *
487
+ * This must not be specified if `uri` is specified.
488
+ */
489
+ host?: Hostname;
490
+ /**
491
+ * Port number to connect at the server host
492
+ *
493
+ * This must not be specified if `uri` is specified.
494
+ */
495
+ port?: number;
496
+ /**
497
+ * Directory containing the UNIX socket to connect to
498
+ *
499
+ * This must not be specified if `uri` is specified.
500
+ */
501
+ socket?: string;
502
+ /**
503
+ * PostgreSQL user name to connect as
504
+ *
505
+ * This must not be specified if `uri` is specified.
506
+ */
507
+ username?: string;
508
+ /**
509
+ * Password to be used if the server demands password authentication
510
+ *
511
+ * This must not be specified if `uri` is specified.
512
+ */
513
+ password?: string;
514
+ /**
515
+ * The database name
516
+ *
517
+ * This must not be specified if `uri` is specified.
518
+ */
519
+ database?: string;
520
+ /**
521
+ * How to handle SSL connections
522
+ */
523
+ ssl_mode?: PgSslMode;
524
+ /**
525
+ * The PEM-encoded root certificate for SSL connections
526
+ *
527
+ * This must not be specified if the `ssl_ca_file` option is specified.
528
+ */
529
+ ssl_ca?: string;
530
+ /**
531
+ * Path to the root certificate for SSL connections
532
+ *
533
+ * This must not be specified if the `ssl_ca` option is specified.
534
+ */
535
+ ssl_ca_file?: string;
536
+ /**
537
+ * The PEM-encoded client certificate for SSL connections
538
+ *
539
+ * This must not be specified if the `ssl_certificate_file` option is specified.
540
+ */
541
+ ssl_certificate?: string;
542
+ /**
543
+ * Path to the client certificate for SSL connections
544
+ *
545
+ * This must not be specified if the `ssl_certificate` option is specified.
546
+ */
547
+ ssl_certificate_file?: string;
548
+ /**
549
+ * The PEM-encoded client key for SSL connections
550
+ *
551
+ * This must not be specified if the `ssl_key_file` option is specified.
552
+ */
553
+ ssl_key?: string;
554
+ /**
555
+ * Path to the client key for SSL connections
556
+ *
557
+ * This must not be specified if the `ssl_key` option is specified.
558
+ */
559
+ ssl_key_file?: string;
560
+ /**
561
+ * Set the maximum number of connections the pool should maintain
562
+ */
563
+ max_connections?: number;
564
+ /**
565
+ * Set the minimum number of connections the pool should maintain
566
+ */
567
+ min_connections?: number;
568
+ /**
569
+ * Set the amount of time to attempt connecting to the database
570
+ */
571
+ connect_timeout?: number;
572
+ /**
573
+ * Set a maximum idle duration for individual connections
574
+ */
575
+ idle_timeout?: number;
576
+ /**
577
+ * Set the maximum lifetime of individual connections
578
+ */
579
+ max_lifetime?: number;
580
+ [k: string]: unknown;
581
+ }
582
+ /**
583
+ * Configuration related to sending monitoring data
584
+ */
585
+ export interface TelemetryConfig {
586
+ /**
587
+ * Configuration related to exporting traces
588
+ */
589
+ tracing?: TracingConfig;
590
+ /**
591
+ * Configuration related to exporting metrics
592
+ */
593
+ metrics?: MetricsConfig;
594
+ /**
595
+ * Configuration related to the Sentry integration
596
+ */
597
+ sentry?: SentryConfig;
598
+ [k: string]: unknown;
599
+ }
600
+ /**
601
+ * Configuration related to exporting traces
602
+ */
603
+ export interface TracingConfig {
604
+ /**
605
+ * Exporter to use when exporting traces
606
+ */
607
+ exporter?: TracingExporterKind & string;
608
+ /**
609
+ * OTLP exporter: OTLP over HTTP compatible endpoint
610
+ */
611
+ endpoint?: string;
612
+ /**
613
+ * List of propagation formats to use for incoming and outgoing requests
614
+ */
615
+ propagators?: Propagator[];
616
+ /**
617
+ * Sample rate for traces
618
+ *
619
+ * Defaults to `1.0` if not set.
620
+ */
621
+ sample_rate?: number;
622
+ [k: string]: unknown;
623
+ }
624
+ /**
625
+ * Configuration related to exporting metrics
626
+ */
627
+ export interface MetricsConfig {
628
+ /**
629
+ * Exporter to use when exporting metrics
630
+ */
631
+ exporter?: MetricsExporterKind & string;
632
+ /**
633
+ * OTLP exporter: OTLP over HTTP compatible endpoint
634
+ */
635
+ endpoint?: string;
636
+ [k: string]: unknown;
637
+ }
638
+ /**
639
+ * Configuration related to the Sentry integration
640
+ */
641
+ export interface SentryConfig {
642
+ /**
643
+ * Sentry DSN
644
+ */
645
+ dsn?: string;
646
+ /**
647
+ * Environment to use when sending events to Sentry
648
+ *
649
+ * Defaults to `production` if not set.
650
+ */
651
+ environment?: string;
652
+ /**
653
+ * Sample rate for event submissions
654
+ *
655
+ * Defaults to `1.0` if not set.
656
+ */
657
+ sample_rate?: number;
658
+ /**
659
+ * Sample rate for tracing transactions
660
+ *
661
+ * Defaults to `0.0` if not set.
662
+ */
663
+ traces_sample_rate?: number;
664
+ [k: string]: unknown;
665
+ }
666
+ /**
667
+ * Configuration related to templates
668
+ */
669
+ export interface TemplatesConfig {
670
+ /**
671
+ * Path to the folder which holds the templates
672
+ */
673
+ path?: string;
674
+ /**
675
+ * Path to the assets manifest
676
+ */
677
+ assets_manifest?: string;
678
+ /**
679
+ * Path to the translations
680
+ */
681
+ translations_path?: string;
682
+ [k: string]: unknown;
683
+ }
684
+ /**
685
+ * Configuration related to sending emails
686
+ */
687
+ export interface EmailConfig {
688
+ /**
689
+ * Email address to use as From when sending emails
690
+ */
691
+ from?: string;
692
+ /**
693
+ * Email address to use as Reply-To when sending emails
694
+ */
695
+ reply_to?: string;
696
+ /**
697
+ * What backend should be used when sending emails
698
+ */
699
+ transport: EmailTransportKind;
700
+ /**
701
+ * SMTP transport: Connection mode to the relay
702
+ */
703
+ mode?: EmailSmtpMode;
704
+ /**
705
+ * SMTP transport: Hostname to connect to
706
+ */
707
+ hostname?: Hostname;
708
+ /**
709
+ * SMTP transport: Port to connect to. Default is 25 for plain, 465 for TLS and 587 for `StartTLS`
710
+ */
711
+ port?: number;
712
+ /**
713
+ * SMTP transport: Username for use to authenticate when connecting to the SMTP server
714
+ *
715
+ * Must be set if the `password` field is set
716
+ */
717
+ username?: string;
718
+ /**
719
+ * SMTP transport: Password for use to authenticate when connecting to the SMTP server
720
+ *
721
+ * Must be set if the `username` field is set
722
+ */
723
+ password?: string;
724
+ /**
725
+ * Sendmail transport: Command to use to send emails
726
+ */
727
+ command?: string;
728
+ [k: string]: unknown;
729
+ }
730
+ /**
731
+ * Application secrets
732
+ */
733
+ export interface SecretsConfig {
734
+ /**
735
+ * List of private keys to use for signing and encrypting payloads
736
+ */
737
+ keys?: KeyConfig[];
738
+ /**
739
+ * File containing the encryption key for secure cookies.
740
+ */
741
+ encryption_file?: string;
742
+ /**
743
+ * Encryption key for secure cookies.
744
+ */
745
+ encryption?: string;
746
+ [k: string]: unknown;
747
+ }
748
+ /**
749
+ * A single key with its key ID and optional password.
750
+ */
751
+ export interface KeyConfig {
752
+ kid: string;
753
+ password_file?: string;
754
+ password?: string;
755
+ key_file?: string;
756
+ key?: string;
757
+ [k: string]: unknown;
758
+ }
759
+ /**
760
+ * User password hashing config
761
+ */
762
+ export interface PasswordsConfig {
763
+ /**
764
+ * Whether password-based authentication is enabled
765
+ */
766
+ enabled?: boolean;
767
+ /**
768
+ * The hashing schemes to use for hashing and validating passwords
769
+ *
770
+ * The hashing scheme with the highest version number will be used for hashing new passwords.
771
+ */
772
+ schemes?: HashingScheme[];
773
+ /**
774
+ * Score between 0 and 4 determining the minimum allowed password complexity. Scores are based on the ESTIMATED number of guesses needed to guess the password.
775
+ *
776
+ * - 0: less than 10^2 (100) - 1: less than 10^4 (10'000) - 2: less than 10^6 (1'000'000) - 3: less than 10^8 (100'000'000) - 4: any more than that
777
+ */
778
+ minimum_complexity?: number;
779
+ [k: string]: unknown;
780
+ }
781
+ /**
782
+ * Parameters for a password hashing scheme
783
+ */
784
+ export interface HashingScheme {
785
+ /**
786
+ * The version of the hashing scheme. They must be unique, and the highest version will be used for hashing new passwords.
787
+ */
788
+ version: number;
789
+ /**
790
+ * The hashing algorithm to use
791
+ */
792
+ algorithm: Algorithm;
793
+ /**
794
+ * Whether to apply Unicode normalization to the password before hashing
795
+ *
796
+ * Defaults to `false`, and generally recommended to stay false. This is although recommended when importing password hashs from Synapse, as it applies an NFKC normalization to the password before hashing it.
797
+ */
798
+ unicode_normalization?: boolean;
799
+ /**
800
+ * Cost for the bcrypt algorithm
801
+ */
802
+ cost?: number;
803
+ /**
804
+ * An optional secret to use when hashing passwords. This makes it harder to brute-force the passwords in case of a database leak.
805
+ */
806
+ secret?: string;
807
+ /**
808
+ * Same as `secret`, but read from a file.
809
+ */
810
+ secret_file?: string;
811
+ [k: string]: unknown;
812
+ }
813
+ /**
814
+ * Configuration related to the Matrix homeserver
815
+ */
816
+ export interface MatrixConfig {
817
+ /**
818
+ * The kind of homeserver it is.
819
+ */
820
+ kind?: HomeserverKind & string;
821
+ /**
822
+ * The server name of the homeserver.
823
+ */
824
+ homeserver?: string;
825
+ /**
826
+ * Shared secret to use for calls to the admin API
827
+ */
828
+ secret: string;
829
+ /**
830
+ * The base URL of the homeserver's client API
831
+ */
832
+ endpoint?: string;
833
+ [k: string]: unknown;
834
+ }
835
+ /**
836
+ * Application secrets
837
+ */
838
+ export interface PolicyConfig {
839
+ /**
840
+ * Path to the WASM module
841
+ */
842
+ wasm_module?: string;
843
+ /**
844
+ * Entrypoint to use when evaluating client registrations
845
+ */
846
+ client_registration_entrypoint?: string;
847
+ /**
848
+ * Entrypoint to use when evaluating user registrations
849
+ */
850
+ register_entrypoint?: string;
851
+ /**
852
+ * Entrypoint to use when evaluating authorization grants
853
+ */
854
+ authorization_grant_entrypoint?: string;
855
+ /**
856
+ * Entrypoint to use when changing password
857
+ */
858
+ password_entrypoint?: string;
859
+ /**
860
+ * Entrypoint to use when adding an email address
861
+ */
862
+ email_entrypoint?: string;
863
+ /**
864
+ * Arbitrary data to pass to the policy
865
+ */
866
+ data?: {
867
+ [k: string]: unknown;
868
+ };
869
+ [k: string]: unknown;
870
+ }
871
+ /**
872
+ * Configuration related to sending emails
873
+ */
874
+ export interface RateLimitingConfig {
875
+ /**
876
+ * Account Recovery-specific rate limits
877
+ */
878
+ account_recovery?: AccountRecoveryRateLimitingConfig;
879
+ /**
880
+ * Login-specific rate limits
881
+ */
882
+ login?: LoginRateLimitingConfig;
883
+ /**
884
+ * Controls how many registrations attempts are permitted based on source address.
885
+ */
886
+ registration?: RateLimiterConfiguration;
887
+ /**
888
+ * Email authentication-specific rate limits
889
+ */
890
+ email_authentication?: EmailauthenticationRateLimitingConfig;
891
+ [k: string]: unknown;
892
+ }
893
+ export interface AccountRecoveryRateLimitingConfig {
894
+ /**
895
+ * Controls how many account recovery attempts are permitted based on source IP address. This can protect against causing e-mail spam to many targets.
896
+ *
897
+ * Note: this limit also applies to re-sends.
898
+ */
899
+ per_ip?: RateLimiterConfiguration;
900
+ /**
901
+ * Controls how many account recovery attempts are permitted based on the e-mail address entered into the recovery form. This can protect against causing e-mail spam to one target.
902
+ *
903
+ * Note: this limit also applies to re-sends.
904
+ */
905
+ per_address?: RateLimiterConfiguration;
906
+ [k: string]: unknown;
907
+ }
908
+ export interface RateLimiterConfiguration {
909
+ /**
910
+ * A one-off burst of actions that the user can perform in one go without waiting.
911
+ */
912
+ burst: number;
913
+ /**
914
+ * How quickly the allowance replenishes, in number of actions per second. Can be fractional to replenish slower.
915
+ */
916
+ per_second: number;
917
+ [k: string]: unknown;
918
+ }
919
+ export interface LoginRateLimitingConfig {
920
+ /**
921
+ * Controls how many login attempts are permitted based on source IP address. This can protect against brute force login attempts.
922
+ *
923
+ * Note: this limit also applies to password checks when a user attempts to change their own password.
924
+ */
925
+ per_ip?: RateLimiterConfiguration;
926
+ /**
927
+ * Controls how many login attempts are permitted based on the account that is being attempted to be logged into. This can protect against a distributed brute force attack but should be set high enough to prevent someone's account being casually locked out.
928
+ *
929
+ * Note: this limit also applies to password checks when a user attempts to change their own password.
930
+ */
931
+ per_account?: RateLimiterConfiguration;
932
+ [k: string]: unknown;
933
+ }
934
+ export interface EmailauthenticationRateLimitingConfig {
935
+ /**
936
+ * Controls how many email authentication attempts are permitted based on the source IP address. This can protect against causing e-mail spam to many targets.
937
+ */
938
+ per_ip?: RateLimiterConfiguration;
939
+ /**
940
+ * Controls how many email authentication attempts are permitted based on the e-mail address entered into the authentication form. This can protect against causing e-mail spam to one target.
941
+ *
942
+ * Note: this limit also applies to re-sends.
943
+ */
944
+ per_address?: RateLimiterConfiguration;
945
+ /**
946
+ * Controls how many authentication emails are permitted to be sent per authentication session. This ensures not too many authentication codes are created for the same authentication session.
947
+ */
948
+ emails_per_session?: RateLimiterConfiguration;
949
+ /**
950
+ * Controls how many code authentication attempts are permitted per authentication session. This can protect against brute-forcing the code.
951
+ */
952
+ attempt_per_session?: RateLimiterConfiguration;
953
+ [k: string]: unknown;
954
+ }
955
+ /**
956
+ * Upstream OAuth 2.0 providers configuration
957
+ */
958
+ export interface UpstreamOAuth2Config {
959
+ /**
960
+ * List of OAuth 2.0 providers
961
+ */
962
+ providers: Provider[];
963
+ [k: string]: unknown;
964
+ }
965
+ /**
966
+ * Configuration for one upstream OAuth 2 provider.
967
+ */
968
+ export interface Provider {
969
+ /**
970
+ * Whether this provider is enabled.
971
+ *
972
+ * Defaults to `true`
973
+ */
974
+ enabled?: boolean;
975
+ /**
976
+ * A ULID as per https://github.com/ulid/spec
977
+ */
978
+ id: string;
979
+ /**
980
+ * The ID of the provider that was used by Synapse. In order to perform a Synapse-to-MAS migration, this must be specified.
981
+ *
982
+ * ## For providers that used OAuth 2.0 or OpenID Connect in Synapse
983
+ *
984
+ * ### For `oidc_providers`: This should be specified as `oidc-` followed by the ID that was configured as `idp_id` in one of the `oidc_providers` in the Synapse configuration. For example, if Synapse's configuration contained `idp_id: wombat` for this provider, then specify `oidc-wombat` here.
985
+ *
986
+ * ### For `oidc_config` (legacy): Specify `oidc` here.
987
+ */
988
+ synapse_idp_id?: string;
989
+ /**
990
+ * The OIDC issuer URL
991
+ *
992
+ * This is required if OIDC discovery is enabled (which is the default)
993
+ */
994
+ issuer?: string;
995
+ /**
996
+ * A human-readable name for the provider, that will be shown to users
997
+ */
998
+ human_name?: string;
999
+ /**
1000
+ * A brand identifier used to customise the UI, e.g. `apple`, `google`, `github`, etc.
1001
+ *
1002
+ * Values supported by the default template are:
1003
+ *
1004
+ * - `apple` - `google` - `facebook` - `github` - `gitlab` - `twitter` - `discord`
1005
+ */
1006
+ brand_name?: string;
1007
+ /**
1008
+ * The client ID to use when authenticating with the provider
1009
+ */
1010
+ client_id: string;
1011
+ /**
1012
+ * The client secret to use when authenticating with the provider
1013
+ *
1014
+ * Used by the `client_secret_basic`, `client_secret_post`, and `client_secret_jwt` methods
1015
+ */
1016
+ client_secret?: string;
1017
+ /**
1018
+ * The method to authenticate the client with the provider
1019
+ */
1020
+ token_endpoint_auth_method: TokenAuthMethod;
1021
+ /**
1022
+ * Additional parameters for the `sign_in_with_apple` method
1023
+ */
1024
+ sign_in_with_apple?: SignInWithApple;
1025
+ /**
1026
+ * The JWS algorithm to use when authenticating the client with the provider
1027
+ *
1028
+ * Used by the `client_secret_jwt` and `private_key_jwt` methods
1029
+ */
1030
+ token_endpoint_auth_signing_alg?: JsonWebSignatureAlg;
1031
+ /**
1032
+ * Expected signature for the JWT payload returned by the token authentication endpoint.
1033
+ *
1034
+ * Defaults to `RS256`.
1035
+ */
1036
+ id_token_signed_response_alg?: JsonWebSignatureAlg;
1037
+ /**
1038
+ * The scopes to request from the provider
1039
+ *
1040
+ * Defaults to `openid`.
1041
+ */
1042
+ scope?: string;
1043
+ /**
1044
+ * How to discover the provider's configuration
1045
+ *
1046
+ * Defaults to `oidc`, which uses OIDC discovery with strict metadata verification
1047
+ */
1048
+ discovery_mode?: DiscoveryMode;
1049
+ /**
1050
+ * Whether to use proof key for code exchange (PKCE) when requesting and exchanging the token.
1051
+ *
1052
+ * Defaults to `auto`, which uses PKCE if the provider supports it.
1053
+ */
1054
+ pkce_method?: PkceMethod;
1055
+ /**
1056
+ * Whether to fetch the user profile from the userinfo endpoint, or to rely on the data returned in the `id_token` from the `token_endpoint`.
1057
+ *
1058
+ * Defaults to `false`.
1059
+ */
1060
+ fetch_userinfo?: boolean;
1061
+ /**
1062
+ * Expected signature for the JWT payload returned by the userinfo endpoint.
1063
+ *
1064
+ * If not specified, the response is expected to be an unsigned JSON payload.
1065
+ */
1066
+ userinfo_signed_response_alg?: JsonWebSignatureAlg;
1067
+ /**
1068
+ * The URL to use for the provider's authorization endpoint
1069
+ *
1070
+ * Defaults to the `authorization_endpoint` provided through discovery
1071
+ */
1072
+ authorization_endpoint?: string;
1073
+ /**
1074
+ * The URL to use for the provider's userinfo endpoint
1075
+ *
1076
+ * Defaults to the `userinfo_endpoint` provided through discovery
1077
+ */
1078
+ userinfo_endpoint?: string;
1079
+ /**
1080
+ * The URL to use for the provider's token endpoint
1081
+ *
1082
+ * Defaults to the `token_endpoint` provided through discovery
1083
+ */
1084
+ token_endpoint?: string;
1085
+ /**
1086
+ * The URL to use for getting the provider's public keys
1087
+ *
1088
+ * Defaults to the `jwks_uri` provided through discovery
1089
+ */
1090
+ jwks_uri?: string;
1091
+ /**
1092
+ * The response mode we ask the provider to use for the callback
1093
+ */
1094
+ response_mode?: ResponseMode;
1095
+ /**
1096
+ * How claims should be imported from the `id_token` provided by the provider
1097
+ */
1098
+ claims_imports?: ClaimsImports;
1099
+ /**
1100
+ * Additional parameters to include in the authorization request
1101
+ *
1102
+ * Orders of the keys are not preserved.
1103
+ */
1104
+ additional_authorization_parameters?: {
1105
+ [k: string]: string;
1106
+ };
1107
+ /**
1108
+ * Whether the `login_hint` should be forwarded to the provider in the authorization request.
1109
+ *
1110
+ * Defaults to `false`.
1111
+ */
1112
+ forward_login_hint?: boolean;
1113
+ /**
1114
+ * What to do when receiving an OIDC Backchannel logout request.
1115
+ *
1116
+ * Defaults to "do_nothing".
1117
+ */
1118
+ on_backchannel_logout?: OnBackchannelLogout;
1119
+ [k: string]: unknown;
1120
+ }
1121
+ export interface SignInWithApple {
1122
+ /**
1123
+ * The private key file used to sign the `id_token`
1124
+ */
1125
+ private_key_file?: string;
1126
+ /**
1127
+ * The private key used to sign the `id_token`
1128
+ */
1129
+ private_key?: string;
1130
+ /**
1131
+ * The Team ID of the Apple Developer Portal
1132
+ */
1133
+ team_id: string;
1134
+ /**
1135
+ * The key ID of the Apple Developer Portal
1136
+ */
1137
+ key_id: string;
1138
+ [k: string]: unknown;
1139
+ }
1140
+ /**
1141
+ * How claims should be imported
1142
+ */
1143
+ export interface ClaimsImports {
1144
+ /**
1145
+ * How to determine the subject of the user
1146
+ */
1147
+ subject?: SubjectImportPreference;
1148
+ /**
1149
+ * Import the localpart of the MXID
1150
+ */
1151
+ localpart?: LocalpartImportPreference;
1152
+ /**
1153
+ * Import the displayname of the user.
1154
+ */
1155
+ displayname?: DisplaynameImportPreference;
1156
+ /**
1157
+ * Import the email address of the user based on the `email` and `email_verified` claims
1158
+ */
1159
+ email?: EmailImportPreference;
1160
+ /**
1161
+ * Set a human-readable name for the upstream account for display purposes
1162
+ */
1163
+ account_name?: AccountNameImportPreference;
1164
+ [k: string]: unknown;
1165
+ }
1166
+ /**
1167
+ * What should be done for the subject attribute
1168
+ */
1169
+ export interface SubjectImportPreference {
1170
+ /**
1171
+ * The Jinja2 template to use for the subject attribute
1172
+ *
1173
+ * If not provided, the default template is `{{ user.sub }}`
1174
+ */
1175
+ template?: string;
1176
+ [k: string]: unknown;
1177
+ }
1178
+ /**
1179
+ * What should be done for the localpart attribute
1180
+ */
1181
+ export interface LocalpartImportPreference {
1182
+ /**
1183
+ * How to handle the attribute
1184
+ */
1185
+ action?: ImportAction;
1186
+ /**
1187
+ * The Jinja2 template to use for the localpart attribute
1188
+ *
1189
+ * If not provided, the default template is `{{ user.preferred_username }}`
1190
+ */
1191
+ template?: string;
1192
+ /**
1193
+ * How to handle conflicts on the claim, default value is `Fail`
1194
+ */
1195
+ on_conflict?: OnConflict;
1196
+ [k: string]: unknown;
1197
+ }
1198
+ /**
1199
+ * What should be done for the displayname attribute
1200
+ */
1201
+ export interface DisplaynameImportPreference {
1202
+ /**
1203
+ * How to handle the attribute
1204
+ */
1205
+ action?: ImportAction;
1206
+ /**
1207
+ * The Jinja2 template to use for the displayname attribute
1208
+ *
1209
+ * If not provided, the default template is `{{ user.name }}`
1210
+ */
1211
+ template?: string;
1212
+ [k: string]: unknown;
1213
+ }
1214
+ /**
1215
+ * What should be done with the email attribute
1216
+ */
1217
+ export interface EmailImportPreference {
1218
+ /**
1219
+ * How to handle the claim
1220
+ */
1221
+ action?: ImportAction;
1222
+ /**
1223
+ * The Jinja2 template to use for the email address attribute
1224
+ *
1225
+ * If not provided, the default template is `{{ user.email }}`
1226
+ */
1227
+ template?: string;
1228
+ [k: string]: unknown;
1229
+ }
1230
+ /**
1231
+ * What should be done for the account name attribute
1232
+ */
1233
+ export interface AccountNameImportPreference {
1234
+ /**
1235
+ * The Jinja2 template to use for the account name. This name is only used for display purposes.
1236
+ *
1237
+ * If not provided, it will be ignored.
1238
+ */
1239
+ template?: string;
1240
+ [k: string]: unknown;
1241
+ }
1242
+ /**
1243
+ * Configuration section for tweaking the branding of the service
1244
+ */
1245
+ export interface BrandingConfig {
1246
+ /**
1247
+ * A human-readable name. Defaults to the server's address.
1248
+ */
1249
+ service_name?: string;
1250
+ /**
1251
+ * Link to a privacy policy, displayed in the footer of web pages and emails. It is also advertised to clients through the `op_policy_uri` OIDC provider metadata.
1252
+ */
1253
+ policy_uri?: string;
1254
+ /**
1255
+ * Link to a terms of service document, displayed in the footer of web pages and emails. It is also advertised to clients through the `op_tos_uri` OIDC provider metadata.
1256
+ */
1257
+ tos_uri?: string;
1258
+ /**
1259
+ * Legal imprint, displayed in the footer in the footer of web pages and emails.
1260
+ */
1261
+ imprint?: string;
1262
+ /**
1263
+ * Logo displayed in some web pages.
1264
+ */
1265
+ logo_uri?: string;
1266
+ [k: string]: unknown;
1267
+ }
1268
+ /**
1269
+ * Configuration section to setup CAPTCHA protection on a few operations
1270
+ */
1271
+ export interface CaptchaConfig {
1272
+ /**
1273
+ * Which service should be used for CAPTCHA protection
1274
+ */
1275
+ service?: CaptchaServiceKind;
1276
+ /**
1277
+ * The site key to use
1278
+ */
1279
+ site_key?: string;
1280
+ /**
1281
+ * The secret key to use
1282
+ */
1283
+ secret_key?: string;
1284
+ [k: string]: unknown;
1285
+ }
1286
+ /**
1287
+ * Configuration section to configure features related to account management
1288
+ */
1289
+ export interface AccountConfig {
1290
+ /**
1291
+ * Whether users are allowed to change their email addresses. Defaults to `true`.
1292
+ */
1293
+ email_change_allowed?: boolean;
1294
+ /**
1295
+ * Whether users are allowed to change their display names. Defaults to `true`.
1296
+ *
1297
+ * This should be in sync with the policy in the homeserver configuration.
1298
+ */
1299
+ displayname_change_allowed?: boolean;
1300
+ /**
1301
+ * Whether to enable self-service password registration. Defaults to `false` if password authentication is enabled.
1302
+ *
1303
+ * This has no effect if password login is disabled.
1304
+ */
1305
+ password_registration_enabled?: boolean;
1306
+ /**
1307
+ * Whether users are allowed to change their passwords. Defaults to `true`.
1308
+ *
1309
+ * This has no effect if password login is disabled.
1310
+ */
1311
+ password_change_allowed?: boolean;
1312
+ /**
1313
+ * Whether email-based password recovery is enabled. Defaults to `false`.
1314
+ *
1315
+ * This has no effect if password login is disabled.
1316
+ */
1317
+ password_recovery_enabled?: boolean;
1318
+ /**
1319
+ * Whether users are allowed to delete their own account. Defaults to `true`.
1320
+ */
1321
+ account_deactivation_allowed?: boolean;
1322
+ /**
1323
+ * Whether users can log in with their email address. Defaults to `false`.
1324
+ *
1325
+ * This has no effect if password login is disabled.
1326
+ */
1327
+ login_with_email_allowed?: boolean;
1328
+ /**
1329
+ * Whether registration tokens are required for password registrations. Defaults to `false`.
1330
+ *
1331
+ * When enabled, users must provide a valid registration token during password registration. This has no effect if password registration is disabled.
1332
+ */
1333
+ registration_token_required?: boolean;
1334
+ [k: string]: unknown;
1335
+ }
1336
+ /**
1337
+ * Configuration sections for experimental options
1338
+ *
1339
+ * Do not change these options unless you know what you are doing.
1340
+ */
1341
+ export interface ExperimentalConfig {
1342
+ /**
1343
+ * Time-to-live of access tokens in seconds. Defaults to 5 minutes.
1344
+ */
1345
+ access_token_ttl?: number;
1346
+ /**
1347
+ * Time-to-live of compatibility access tokens in seconds. Defaults to 5 minutes.
1348
+ */
1349
+ compat_token_ttl?: number;
1350
+ /**
1351
+ * Experimetal feature to automatically expire inactive sessions
1352
+ *
1353
+ * Disabled by default
1354
+ */
1355
+ inactive_session_expiration?: InactiveSessionExpirationConfig;
1356
+ /**
1357
+ * Experimental feature to show a plan management tab and iframe. This value is passed through "as is" to the client without any validation.
1358
+ */
1359
+ plan_management_iframe_uri?: string;
1360
+ [k: string]: unknown;
1361
+ }
1362
+ /**
1363
+ * Configuration options for the inactive session expiration feature
1364
+ */
1365
+ export interface InactiveSessionExpirationConfig {
1366
+ /**
1367
+ * Time after which an inactive session is automatically finished
1368
+ */
1369
+ ttl: number;
1370
+ /**
1371
+ * Should compatibility sessions expire after inactivity
1372
+ */
1373
+ expire_compat_sessions?: boolean;
1374
+ /**
1375
+ * Should OAuth 2.0 sessions expire after inactivity
1376
+ */
1377
+ expire_oauth_sessions?: boolean;
1378
+ /**
1379
+ * Should user sessions expire after inactivity
1380
+ */
1381
+ expire_user_sessions?: boolean;
1382
+ [k: string]: unknown;
1383
+ }