mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-08 02:59:31 -06:00
federated authentication better logging + tidying (#232)
* change trace logging in authenticator * messing about * lil changes * go fmt * error fix * Fix broken test
This commit is contained in:
parent
2e5dcc2929
commit
92186c8c6f
13 changed files with 134 additions and 123 deletions
|
|
@ -128,12 +128,13 @@ func (suite *ProtocolTestSuite) TestAuthenticatePostInbox() {
|
|||
ctxWithAccount := context.WithValue(ctx, util.APAccount, inboxAccount)
|
||||
ctxWithActivity := context.WithValue(ctxWithAccount, util.APActivity, activity)
|
||||
ctxWithVerifier := context.WithValue(ctxWithActivity, util.APRequestingPublicKeyVerifier, verifier)
|
||||
ctxWithSignature := context.WithValue(ctxWithVerifier, util.APRequestingPublicKeySignature, activity.SignatureHeader)
|
||||
|
||||
// we can pass this recorder as a writer and read it back after
|
||||
recorder := httptest.NewRecorder()
|
||||
|
||||
// trigger the function being tested, and return the new context it creates
|
||||
newContext, authed, err := federator.AuthenticatePostInbox(ctxWithVerifier, recorder, request)
|
||||
newContext, authed, err := federator.AuthenticatePostInbox(ctxWithSignature, recorder, request)
|
||||
assert.NoError(suite.T(), err)
|
||||
assert.True(suite.T(), authed)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue