From 570fa7c3598118ded6df7ced0a5326f54e7a43e2 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Sat, 20 Aug 2022 22:47:19 +0200 Subject: [bugfix] Fix potential dereference of accounts on own instance (#757) * add GetAccountByUsernameDomain * simplify search * add escape to not deref accounts on own domain * check if local + we have account by ap uri --- internal/db/account.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'internal/db/account.go') diff --git a/internal/db/account.go b/internal/db/account.go index 79e7c01a5..155bd666c 100644 --- a/internal/db/account.go +++ b/internal/db/account.go @@ -36,6 +36,9 @@ type Account interface { // GetAccountByURL returns one account with the given URL, or an error if something goes wrong. GetAccountByURL(ctx context.Context, uri string) (*gtsmodel.Account, Error) + // GetAccountByUsernameDomain returns one account with the given username and domain, or an error if something goes wrong. + GetAccountByUsernameDomain(ctx context.Context, username string, domain string) (*gtsmodel.Account, Error) + // UpdateAccount updates one account by ID. UpdateAccount(ctx context.Context, account *gtsmodel.Account) (*gtsmodel.Account, Error) -- cgit v1.2.3