summaryrefslogtreecommitdiff
path: root/internal/processing
diff options
context:
space:
mode:
Diffstat (limited to 'internal/processing')
-rw-r--r--internal/processing/instance.go13
-rw-r--r--internal/processing/processor.go2
2 files changed, 2 insertions, 13 deletions
diff --git a/internal/processing/instance.go b/internal/processing/instance.go
index fec636d2a..afa60ad1e 100644
--- a/internal/processing/instance.go
+++ b/internal/processing/instance.go
@@ -28,7 +28,6 @@ import (
"github.com/superseriousbusiness/gotosocial/internal/db"
"github.com/superseriousbusiness/gotosocial/internal/gtserror"
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
- "github.com/superseriousbusiness/gotosocial/internal/oauth"
"github.com/superseriousbusiness/gotosocial/internal/text"
"github.com/superseriousbusiness/gotosocial/internal/util"
"github.com/superseriousbusiness/gotosocial/internal/validate"
@@ -48,15 +47,10 @@ func (p *processor) InstanceGet(ctx context.Context, domain string) (*apimodel.I
return ai, nil
}
-func (p *processor) InstancePeersGet(ctx context.Context, authed *oauth.Auth, includeSuspended bool, includeOpen bool, flat bool) (interface{}, gtserror.WithCode) {
+func (p *processor) InstancePeersGet(ctx context.Context, includeSuspended bool, includeOpen bool, flat bool) (interface{}, gtserror.WithCode) {
domains := []*apimodel.Domain{}
if includeOpen {
- if !config.GetInstanceExposePeers() && (authed.Account == nil || authed.User == nil) {
- err := fmt.Errorf("peers open query requires an authenticated account/user")
- return nil, gtserror.NewErrorUnauthorized(err, err.Error())
- }
-
instances, err := p.db.GetInstancePeers(ctx, false)
if err != nil && err != db.ErrNoEntries {
err = fmt.Errorf("error selecting instance peers: %s", err)
@@ -70,11 +64,6 @@ func (p *processor) InstancePeersGet(ctx context.Context, authed *oauth.Auth, in
}
if includeSuspended {
- if !config.GetInstanceExposeSuspended() && (authed.Account == nil || authed.User == nil) {
- err := fmt.Errorf("peers suspended query requires an authenticated account/user")
- return nil, gtserror.NewErrorUnauthorized(err, err.Error())
- }
-
domainBlocks := []*gtsmodel.DomainBlock{}
if err := p.db.GetAll(ctx, &domainBlocks); err != nil && err != db.ErrNoEntries {
return nil, gtserror.NewErrorInternalError(err)
diff --git a/internal/processing/processor.go b/internal/processing/processor.go
index 46634aaaa..68a4c5fa4 100644
--- a/internal/processing/processor.go
+++ b/internal/processing/processor.go
@@ -172,7 +172,7 @@ type Processor interface {
// InstanceGet retrieves instance information for serving at api/v1/instance
InstanceGet(ctx context.Context, domain string) (*apimodel.Instance, gtserror.WithCode)
- InstancePeersGet(ctx context.Context, authed *oauth.Auth, includeSuspended bool, includeOpen bool, flat bool) (interface{}, gtserror.WithCode)
+ InstancePeersGet(ctx context.Context, includeSuspended bool, includeOpen bool, flat bool) (interface{}, gtserror.WithCode)
// InstancePatch updates this instance according to the given form.
//
// It should already be ascertained that the requesting account is authenticated and an admin.