[bugfix] relax missing preferred_username, instead using webfingered username (#3189)

* support no preferred_username, instead using webfingered username

* add tests for the new preferred_username behaviour
This commit is contained in:
kim 2024-08-13 09:01:50 +00:00 committed by GitHub
commit 5212a1057e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 148 additions and 77 deletions

View file

@ -86,7 +86,7 @@ func (suite *UserGetTestSuite) TestGetUser() {
suite.True(ok)
// convert person to account
a, err := suite.tc.ASRepresentationToAccount(context.Background(), person, "")
a, err := suite.tc.ASRepresentationToAccount(context.Background(), person, "", "")
suite.NoError(err)
suite.EqualValues(targetAccount.Username, a.Username)
}
@ -154,7 +154,7 @@ func (suite *UserGetTestSuite) TestGetUserPublicKeyDeleted() {
suite.True(ok)
// convert person to account
a, err := suite.tc.ASRepresentationToAccount(context.Background(), person, "")
a, err := suite.tc.ASRepresentationToAccount(context.Background(), person, "", "")
suite.NoError(err)
suite.EqualValues(targetAccount.Username, a.Username)
}