2022-10-03 15:25:32 +00:00
|
|
|
def test_issuer(testclient, user):
|
|
|
|
res = testclient.get(
|
2024-11-20 22:30:44 +00:00
|
|
|
"/.well-known/webfinger?resource=acct%3Auser%40mydomain.test&rel=http%3A%2F%2Fopenid.net%2Fspecs%2Fconnect%2F1.0%2Fissuer"
|
2022-10-03 15:25:32 +00:00
|
|
|
)
|
|
|
|
assert res.json == {
|
2024-11-20 22:30:44 +00:00
|
|
|
"subject": "acct:user@mydomain.test",
|
2022-10-03 15:25:32 +00:00
|
|
|
"links": [
|
|
|
|
{
|
|
|
|
"rel": "http://openid.net/specs/connect/1.0/issuer",
|
2024-11-20 22:30:44 +00:00
|
|
|
"href": "https://auth.mydomain.test",
|
2022-10-03 15:25:32 +00:00
|
|
|
}
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
def test_resource_unknown(testclient):
|
|
|
|
res = testclient.get(
|
2024-11-20 22:30:44 +00:00
|
|
|
"/.well-known/webfinger?resource=acct%3Ainvalid%40mydomain.test&rel=http%3A%2F%2Fopenid.net%2Fspecs%2Fconnect%2F1.0%2Fissuer",
|
2022-10-03 15:25:32 +00:00
|
|
|
)
|
|
|
|
assert res.json == {
|
2024-11-20 22:30:44 +00:00
|
|
|
"subject": "acct:invalid@mydomain.test",
|
2022-10-03 15:25:32 +00:00
|
|
|
"links": [
|
|
|
|
{
|
|
|
|
"rel": "http://openid.net/specs/connect/1.0/issuer",
|
2024-11-20 22:30:44 +00:00
|
|
|
"href": "https://auth.mydomain.test",
|
2022-10-03 15:25:32 +00:00
|
|
|
}
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
def test_bad_request(testclient, user):
|
|
|
|
testclient.get("/.well-known/webfinger", status=400)
|