[#3364] added mailcow OAuth2 provider

Co-authored-by: thisni1s <nils@jn2p.de>
This commit is contained in:
Gani Georgiev
2023-10-14 14:46:01 +03:00
parent 69983bff5e
commit 01e33c07fe
45 changed files with 3332 additions and 3219 deletions

View File

@@ -64,6 +64,7 @@ type Settings struct {
VKAuth AuthProviderConfig `form:"vkAuth" json:"vkAuth"`
YandexAuth AuthProviderConfig `form:"yandexAuth" json:"yandexAuth"`
PatreonAuth AuthProviderConfig `form:"patreonAuth" json:"patreonAuth"`
MailcowAuth AuthProviderConfig `form:"mailcowAuth" json:"mailcowAuth"`
}
// New creates and returns a new default Settings instance.
@@ -191,6 +192,9 @@ func New() *Settings {
PatreonAuth: AuthProviderConfig{
Enabled: false,
},
MailcowAuth: AuthProviderConfig{
Enabled: false,
},
}
}
@@ -235,6 +239,7 @@ func (s *Settings) Validate() error {
validation.Field(&s.VKAuth),
validation.Field(&s.YandexAuth),
validation.Field(&s.PatreonAuth),
validation.Field(&s.MailcowAuth),
)
}
@@ -302,6 +307,7 @@ func (s *Settings) RedactClone() (*Settings, error) {
&clone.VKAuth.ClientSecret,
&clone.YandexAuth.ClientSecret,
&clone.PatreonAuth.ClientSecret,
&clone.MailcowAuth.ClientSecret,
}
// mask all sensitive fields
@@ -343,6 +349,7 @@ func (s *Settings) NamedAuthProviderConfigs() map[string]AuthProviderConfig {
auth.NameVK: s.VKAuth,
auth.NameYandex: s.YandexAuth,
auth.NamePatreon: s.PatreonAuth,
auth.NameMailcow: s.MailcowAuth,
}
}