@element-hq/element-web-playwright-common 1.4.4 → 1.4.6

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