|
@@ -471,6 +471,11 @@ type TorListenersConfig struct {
|
471
|
471
|
MaxConnectionsPerDuration int `yaml:"max-connections-per-duration"`
|
472
|
472
|
}
|
473
|
473
|
|
|
474
|
+type JwtServiceConfig struct {
|
|
475
|
+ ExpiryInSeconds int64 `yaml:"expiry-in-seconds"`
|
|
476
|
+ Secret string
|
|
477
|
+}
|
|
478
|
+
|
474
|
479
|
// Config defines the overall configuration.
|
475
|
480
|
type Config struct {
|
476
|
481
|
Network struct {
|
|
@@ -502,9 +507,9 @@ type Config struct {
|
502
|
507
|
MOTDFormatting bool `yaml:"motd-formatting"`
|
503
|
508
|
ProxyAllowedFrom []string `yaml:"proxy-allowed-from"`
|
504
|
509
|
proxyAllowedFromNets []net.IPNet
|
505
|
|
- WebIRC []webircConfig `yaml:"webirc"`
|
506
|
|
- JwtServices map[string]string `yaml:"jwt-services"`
|
507
|
|
- MaxSendQString string `yaml:"max-sendq"`
|
|
510
|
+ WebIRC []webircConfig `yaml:"webirc"`
|
|
511
|
+ JwtServices map[string]JwtServiceConfig `yaml:"jwt-services"`
|
|
512
|
+ MaxSendQString string `yaml:"max-sendq"`
|
508
|
513
|
MaxSendQBytes int
|
509
|
514
|
AllowPlaintextResume bool `yaml:"allow-plaintext-resume"`
|
510
|
515
|
Compatibility struct {
|
|
@@ -922,6 +927,13 @@ func LoadConfig(filename string) (config *Config, err error) {
|
922
|
927
|
config.Server.capValues[caps.Multiline] = multilineCapValue
|
923
|
928
|
}
|
924
|
929
|
|
|
930
|
+ // confirm jwt config
|
|
931
|
+ for name, info := range config.Server.JwtServices {
|
|
932
|
+ if info.Secret == "" {
|
|
933
|
+ return nil, fmt.Errorf("Could not parse jwt-services config, %s service has no secret set", name)
|
|
934
|
+ }
|
|
935
|
+ }
|
|
936
|
+
|
925
|
937
|
// handle legacy name 'bouncer' for 'multiclient' section:
|
926
|
938
|
if config.Accounts.Bouncer != nil {
|
927
|
939
|
config.Accounts.Multiclient = *config.Accounts.Bouncer
|