This avoids needing real production tokens in order to run the tests,
or needing to reach out to the network.
It also deletes several tests.
- Unnormalized username (non-canonical lowercasing).
We don't depend on this anywhere in the implementation, we only check
whether the server says the username is valid or not.
No point in mocking it.
- Organization username.
We never call `validateUsername` for a project *owner*, only when
validating access configuration. Organizations don't have access
tokens, users do.
- Project validation with different scopes.
We don't actually care here which scope the token needs -- that's
something that goes in our docs, not in the code. If the prod API
returns 404, that's good enough. Note that since Forgejo 15, all
unauthorized endpoints return 404, not 403, so we don't even need to
handle this case specially in the implementation.
Currently, this is just a rebase of #1077 with no other changes. I'm not looking for a review, just wanted to put the rebased code up.