[feature] Discover webfinger through host-meta (#1588)

* [feature] Discover webfinger through host-meta

This implements a fallback for discovering the webfinger endpoint in
case the /.well-known/webfinger endpoint wasn't properly redirected.
Some instances do this because the recommendation used to be to use
host-meta for the webfinger redirect in the before times.

Closes #1558.

* [bug] Ensure we only ever update cache on success

* [chore] Move finger tests to their own place

This adds a test suite for transport and moves the finger cache tests
into there instead of abusing the search test suite.

* [chore] cleanup the test a bit more

We don't really need a separate function for the oddly located webfinger
response as we check the full URL string anyway

* Address review comments

* [chore] update config example

* [chore] access DB only through state in controller
This commit is contained in:
Daenney 2023-03-08 13:57:41 +01:00 committed by GitHub
commit e397272fe8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 563 additions and 30 deletions

View file

@ -52,7 +52,10 @@ EXPECT=$(cat <<"EOF"
"tombstone-ttl": 300000000000,
"user-max-size": 100,
"user-sweep-freq": 30000000000,
"user-ttl": 300000000000
"user-ttl": 300000000000,
"webfinger-max-size": 250,
"webfinger-sweep-freq": 900000000000,
"webfinger-ttl": 86400000000000
}
},
"config-path": "internal/config/testdata/test.yaml",