diff options
author | 2021-08-25 15:34:33 +0200 | |
---|---|---|
committer | 2021-08-25 15:34:33 +0200 | |
commit | 2dc9fc1626507bb54417fc4a1920b847cafb27a2 (patch) | |
tree | 4ddeac479b923db38090aac8bd9209f3646851c1 /internal/federation/authenticate.go | |
parent | Manually approves followers (#146) (diff) | |
download | gotosocial-2dc9fc1626507bb54417fc4a1920b847cafb27a2.tar.xz |
Pg to bun (#148)
* start moving to bun
* changing more stuff
* more
* and yet more
* tests passing
* seems stable now
* more big changes
* small fix
* little fixes
Diffstat (limited to 'internal/federation/authenticate.go')
-rw-r--r-- | internal/federation/authenticate.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/federation/authenticate.go b/internal/federation/authenticate.go index 699691ca6..81ac84544 100644 --- a/internal/federation/authenticate.go +++ b/internal/federation/authenticate.go @@ -148,7 +148,7 @@ func (f *federator) AuthenticateFederatedRequest(ctx context.Context, requestedU // LOCAL ACCOUNT REQUEST // the request is coming from INSIDE THE HOUSE so skip the remote dereferencing l.Tracef("proceeding without dereference for local public key %s", requestingPublicKeyID) - if err := f.db.GetWhere([]db.Where{{Key: "public_key_uri", Value: requestingPublicKeyID.String()}}, requestingLocalAccount); err != nil { + if err := f.db.GetWhere(ctx, []db.Where{{Key: "public_key_uri", Value: requestingPublicKeyID.String()}}, requestingLocalAccount); err != nil { return nil, false, fmt.Errorf("couldn't get local account with public key uri %s from the database: %s", requestingPublicKeyID.String(), err) } publicKey = requestingLocalAccount.PublicKey @@ -156,7 +156,7 @@ func (f *federator) AuthenticateFederatedRequest(ctx context.Context, requestedU if err != nil { return nil, false, fmt.Errorf("error parsing url %s: %s", requestingLocalAccount.URI, err) } - } else if err := f.db.GetWhere([]db.Where{{Key: "public_key_uri", Value: requestingPublicKeyID.String()}}, requestingRemoteAccount); err == nil { + } else if err := f.db.GetWhere(ctx, []db.Where{{Key: "public_key_uri", Value: requestingPublicKeyID.String()}}, requestingRemoteAccount); err == nil { // REMOTE ACCOUNT REQUEST WITH KEY CACHED LOCALLY // this is a remote account and we already have the public key for it so use that l.Tracef("proceeding without dereference for cached public key %s", requestingPublicKeyID) @@ -170,7 +170,7 @@ func (f *federator) AuthenticateFederatedRequest(ctx context.Context, requestedU // the request is remote and we don't have the public key yet, // so we need to authenticate the request properly by dereferencing the remote key l.Tracef("proceeding with dereference for uncached public key %s", requestingPublicKeyID) - transport, err := f.transportController.NewTransportForUsername(requestedUsername) + transport, err := f.transportController.NewTransportForUsername(ctx, requestedUsername) if err != nil { return nil, false, fmt.Errorf("transport err: %s", err) } |