forgejo/modules/validation
patdyn 9eebadce02 federation with allow lists (#5393)
## Description

This addresses Issue #5379.
The email validation was extended.
Additionally to checking whether the email domain is in the block list or in the allow list now we also check if the email domain is the servers own FQDN.
Tests have been written for the correct function of the allow list and if the local FQDN is admitted as email domain.

Edit: Clarifications, Typos

## Checklist

The [contributor guide](https://forgejo.org/docs/next/contributor/) contains information that will be helpful to first time contributors. There also are a few [conditions for merging Pull Requests in Forgejo repositories](https://codeberg.org/forgejo/governance/src/branch/main/PullRequestsAgreement.md). You are also welcome to join the [Forgejo development chatroom](https://matrix.to/#/#forgejo-development:matrix.org).

### Tests

- I added test coverage for Go changes...
  - [x] in their respective `*_test.go` for unit tests.

### Documentation

- [x] I did not document these changes and I do not expect someone else to do it.

### Release notes

- [x] I want the title to show in the release notes with a link to this pull request.

Co-authored-by: Michael Jerger <michael.jerger@meissa-gmbh.de>
Co-authored-by: patdyn <erik.seiert@meissa-gmbh.de>
Co-authored-by: Mirco <mirco.zachmann@meissa.de>
Co-authored-by: jerger <jerger@noreply.codeberg.org>
Co-authored-by: zam <mirco.zachmann@meissa.de>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5393
Reviewed-by: jerger <jerger@noreply.codeberg.org>
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: patdyn <patdyn@noreply.codeberg.org>
Co-committed-by: patdyn <patdyn@noreply.codeberg.org>
2025-02-23 08:02:10 +00:00
..
binding.go Validate OAuth Redirect URIs (#32643) 2024-12-03 10:19:22 +01:00
binding_test.go Validate OAuth Redirect URIs (#32643) 2024-12-03 10:19:22 +01:00
email.go federation with allow lists (#5393) 2025-02-23 08:02:10 +00:00
email_test.go federation with allow lists (#5393) 2025-02-23 08:02:10 +00:00
glob_pattern_test.go [CHORE] Use forked binding library 2024-11-05 22:47:34 +01:00
helpers.go fix: use ValidateEmail as binding across web forms 2024-08-28 22:25:17 -06:00
helpers_test.go [GITEA] add option for banning dots in usernames 2024-02-05 16:05:50 +01:00
refname_test.go [CHORE] Use forked binding library 2024-11-05 22:47:34 +01:00
regex_pattern_test.go [CHORE] Use forked binding library 2024-11-05 22:47:34 +01:00
validatable.go added validation fixes 2024-05-14 08:31:34 +02:00
validatable_test.go added validation fixes 2024-05-14 08:31:34 +02:00
validurl_test.go [CHORE] Use forked binding library 2024-11-05 22:47:34 +01:00
validurllist_test.go Validate OAuth Redirect URIs (#32643) 2024-12-03 10:19:22 +01:00