~bigbes/core-go: b2c8e81e

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.

Conrad Hoffmann <ch@bitfehler.net> — 2022-02-02 20:17:13 UTC

Commit b2c8e81ee698e6de5257e332cc4788b893d20cd5view raw patch

Parent(s): d56e2d79

2 changed file(s)

FileStatus+
auth/middleware.go M +1 -43
auth/middleware_test.go M +5 -1