mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-01 23:02:24 -05:00
fiddling with federation a bit
This commit is contained in:
parent
dba33c2c5c
commit
b2c7e5f379
5 changed files with 167 additions and 158 deletions
|
|
@ -27,22 +27,27 @@ import (
|
|||
|
||||
"github.com/go-fed/activity/pub"
|
||||
"github.com/go-fed/activity/streams/vocab"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||
)
|
||||
|
||||
// New returns a go-fed compatible federating actor
|
||||
func New(db db.DB) pub.FederatingActor {
|
||||
f := &Federator{}
|
||||
func New(db db.DB, log *logrus.Logger) pub.FederatingActor {
|
||||
f := &Federator{
|
||||
db: db,
|
||||
}
|
||||
return pub.NewFederatingActor(f, f, db.Federation(), f)
|
||||
}
|
||||
|
||||
// Federator implements several go-fed interfaces in one convenient location
|
||||
type Federator struct {
|
||||
db db.DB
|
||||
}
|
||||
|
||||
// AuthenticateGetInbox determines whether the request is for a GET call to the Actor's Inbox.
|
||||
func (f *Federator) AuthenticateGetInbox(ctx context.Context, w http.ResponseWriter, r *http.Request) (context.Context, bool, error) {
|
||||
// TODO
|
||||
// use context.WithValue() and context.Value() to set and get values through here
|
||||
return nil, false, nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue