~bigbes/core-go

ref: ba01be8449eadd60ffae7ae28f27247bbefa8bcc core-go/auth/middleware_test.go -rw-r--r-- 6.2 KiB
293ca65a — Conrad Hoffmann 1 year, 5 months ago
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.
6eae2199 — Drew DeVault 1 year, 7 months ago
auth: use config.IsInternalIP
b2c8e81e — Conrad Hoffmann 4 years ago
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.
af2afebd — Drew DeVault 5 years ago
Add legacy webhooks worker implementation
dc469471 — Drew DeVault 5 years ago
Add test for internal auth
b335efbd — Drew DeVault 5 years ago
auth/middleware_test: test invalid auth cookie
bfc744fc — Drew DeVault 5 years ago
Add basic auth tests