auth: fix middleware tests
They got broken with 6eae2199 because the tests cannot use
`config.LoadConfig`, so the list of internal IP nets never gets
populated.
auth: use config.IsInternalIP
Fix (some) user PGP key lookups from meta.sr.ht
The authForUsername() function uses a closure that is almost identical
to the LookupUser() function, but is missing the handling for the PGP
key if called from meta.sr.ht. This causes at least the email
notifications for new OAuth2 tokens to be sent unencrypted. This commit
fixes that (and reduces code duplication) by calling LookupUser()
instead.
This requires the context for the tests to have a value for the calling
service, so add that to the mock.
Add legacy webhooks worker implementation
Add test for internal auth
auth/middleware_test: test invalid auth cookie