[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
parent 4cb3e4d3e6
commit 5212a1057e
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)
}