summaryrefslogtreecommitdiff
path: root/internal/federation/dereferencing/handshake.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2023-11-21 10:35:30 +0000
committerLibravatar GitHub <noreply@github.com>2023-11-21 11:35:30 +0100
commit42d8011ff4f10664a853c483685db8e97b7a3118 (patch)
treec0ea4d930add2363312766da7da35c4e846aa3e6 /internal/federation/dereferencing/handshake.go
parent[feature] Initial Prometheus metrics implementation (#2334) (diff)
downloadgotosocial-42d8011ff4f10664a853c483685db8e97b7a3118.tar.xz
[chore/security] refactor AuthenticateFederatedRequest() to handle account deref + suspension checks (#2371)
* refactor AuthenticateFederatedRequest() to handle account suspension + fetching of owner * small fixups * small changes * revert to 'IsEitherBlocked' instead of just 'IsBlocked" :grimace: * update code comment to indicate that AuthenticateFederatedRequest() will handle account + instance dereferencing
Diffstat (limited to 'internal/federation/dereferencing/handshake.go')
-rw-r--r--internal/federation/dereferencing/handshake.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/internal/federation/dereferencing/handshake.go b/internal/federation/dereferencing/handshake.go
index 1180ff140..253c5f2da 100644
--- a/internal/federation/dereferencing/handshake.go
+++ b/internal/federation/dereferencing/handshake.go
@@ -38,8 +38,11 @@ func (d *Dereferencer) Handshaking(username string, remoteAccountID *url.URL) bo
return false
}
+ // Calculate remote account ID str once.
+ remoteIDStr := remoteAccountID.String()
+
for _, id := range remoteIDs {
- if id.String() == remoteAccountID.String() {
+ if id.String() == remoteIDStr {
// We are currently handshaking
// with the remote account.
return true