* Enable allowed_domains in oauth and oidc providers
Signed-off-by: Vladimir DOMBROVSKI <vladimir.dombrovski@bso.co>
* Domain check code cleanup
* Run gofmt on domain validation code
---------
Signed-off-by: Vladimir DOMBROVSKI <vladimir.dombrovski@bso.co>
Before this commit, the default was to not validate TLS certificates of
the SMTP server. This is perhaps a rather unexpected default and can be
considered insecure. This commit activates mail server TLS cert validation
by default.
This change might break some users' email configuration, if they did not
explicitly set the `mail.cert_validation` config variable. Nonetheless,
I think that the secure option should be the default option (e.g.,
to prevent man-in-the-middle attacks and breaching mail server login
credentials).
Signed-off-by: klmmr <35450576+klmmr@users.noreply.github.com>
Before this fix, a too early `return` statement terminated the
`updateLdapUsers()` function, whenever one not already existing user was
created. Therefore, in each LDAP sync a maximum of one new user could be
created (i.e., it took x LDAP sync cycles until x new LDAP users are
registered in wg-portal). Depending on the LDAP `sync_interval` this can
take a long time and produces unecessary long waiting times until users
are available in wg-portal.
Removing the early return statement, and move the remainder of the
function into an `else` statement, so that all new users can be
added in a single LDAP sync.
Also adding a debug statement to better trace the behavior.
Signed-off-by: klmmr <35450576+klmmr@users.noreply.github.com>
Public REST API implementation to handle peers, interfaces and users. It also includes some simple provisioning endpoints.
The Swagger API documentation is available under /api/v1/doc.html