Switch back to mainline go-ap

Marius merged my last go-ap patch (https://lists.sr.ht/~mariusor/activitypub-go/%3Cf23190d1-1376-6ad1-63ee-9c0d291d1eb5%40exozy.me%3E#%3C20230218114214.b5hecpabruk66g7r@slate%3E) so we no longer have to use my custom fork
This commit is contained in:
Anthony Wang 2023-02-18 17:15:14 +00:00
parent e61e9fba59
commit 07df0a6b1c
No known key found for this signature in database
GPG Key ID: 42A5B952E6DD8D38
10 changed files with 22 additions and 24 deletions

4
go.mod
View File

@ -35,7 +35,7 @@ require (
github.com/felixge/fgprof v0.9.3
github.com/fsnotify/fsnotify v1.6.0
github.com/gliderlabs/ssh v0.3.5
github.com/go-ap/activitypub v0.0.0-20221209114049-1ceafda50f9f
github.com/go-ap/activitypub v0.0.0-20230218112952-bfb607b04799
github.com/go-ap/jsonld v0.0.0-20221030091449-f2a191312c73
github.com/go-chi/chi/v5 v5.0.8
github.com/go-chi/cors v1.2.1
@ -284,8 +284,6 @@ replace github.com/hashicorp/go-version => github.com/6543/go-version v1.3.1
replace github.com/shurcooL/vfsgen => github.com/lunny/vfsgen v0.0.0-20220105142115-2c99e1ffdfa0
replace github.com/go-ap/activitypub => gitea.com/xy/activitypub v0.0.0-20221126171442-81405e14ea3b
replace github.com/blevesearch/zapx/v15 v15.3.6 => github.com/zeripath/zapx/v15 v15.3.6-alignment-fix
replace github.com/nektos/act => gitea.com/gitea/act v0.234.2-0.20230131074955-e46ede1b1744

4
go.sum
View File

@ -87,8 +87,6 @@ gitea.com/lunny/levelqueue v0.4.2-0.20220729054728-f020868cc2f7 h1:Zc3RQWC2xOVgl
gitea.com/lunny/levelqueue v0.4.2-0.20220729054728-f020868cc2f7/go.mod h1:HBqmLbz56JWpfEGG0prskAV97ATNRoj5LDmPicD22hU=
gitea.com/xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a h1:lSA0F4e9A2NcQSqGqTOXqu2aRi/XEQxDCBwM8yJtE6s=
gitea.com/xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a/go.mod h1:EXuID2Zs0pAQhH8yz+DNjUbjppKQzKFAn28TMYPB6IU=
gitea.com/xy/activitypub v0.0.0-20221126171442-81405e14ea3b h1:z5zmwZVoKEu2c3+lGiLlTDxQZpcKlZoWz4wjCtcyfxU=
gitea.com/xy/activitypub v0.0.0-20221126171442-81405e14ea3b/go.mod h1:1jG7QyKCGx/FO63p/xWO0h9ytVSJmkjcQSYPj6zWpGs=
gitee.com/travelliu/dm v1.8.11192/go.mod h1:DHTzyhCrM843x9VdKVbZ+GKXGRbKM2sJ4LxihRxShkE=
github.com/42wim/sshsig v0.0.0-20211121163825-841cf5bbc121 h1:r3qt8PCHnfjOv9PN3H+XXKmDA1dfFMIN1AislhlA/ps=
github.com/42wim/sshsig v0.0.0-20211121163825-841cf5bbc121/go.mod h1:Ock8XgA7pvULhIaHGAk/cDnRfNrF9Jey81nPcc403iU=
@ -381,6 +379,8 @@ github.com/gliderlabs/ssh v0.3.5 h1:OcaySEmAQJgyYcArR+gGGTHCyE7nvhEMTlYY+Dp8CpY=
github.com/gliderlabs/ssh v0.3.5/go.mod h1:8XB4KraRrX39qHhT6yxPsHedjA08I/uBVwj4xC+/+z4=
github.com/glycerine/go-unsnap-stream v0.0.0-20181221182339-f9677308dec2/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE=
github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24=
github.com/go-ap/activitypub v0.0.0-20230218112952-bfb607b04799 h1:zVZaYt1h4yWL7uRHvq2StewCu4ObtS+ws9gGgoZJ+2s=
github.com/go-ap/activitypub v0.0.0-20230218112952-bfb607b04799/go.mod h1:1oVD0h0aPT3OEE1ZoSUoym/UGKzxe+e0y8K2AkQ1Hqs=
github.com/go-ap/errors v0.0.0-20221205040414-01c1adfc98ea h1:ywGtLGVjJjMrq4mu35Qmu+NtlhlTk/gTayE6Bb4tQZk=
github.com/go-ap/errors v0.0.0-20221205040414-01c1adfc98ea/go.mod h1:SaTNjEEkp0q+w3pUS1ccyEL/lUrHteORlDq/e21mCc8=
github.com/go-ap/jsonld v0.0.0-20221030091449-f2a191312c73 h1:GMKIYXyXPGIp+hYiWOhfqK4A023HdgisDT4YGgf99mw=

View File

@ -36,7 +36,7 @@ func (b Branch) MarshalJSON() ([]byte, error) {
bin = bin[:len(bin)-1]
if b.Ref != nil {
ap.JSONWriteItemJSONProp(&bin, "ref", b.Ref)
ap.JSONWriteItemProp(&bin, "ref", b.Ref)
}
ap.JSONWrite(&bin, '}')
return bin, nil

View File

@ -39,10 +39,10 @@ func (c Commit) MarshalJSON() ([]byte, error) {
b = b[:len(b)-1]
if !c.Created.IsZero() {
ap.JSONWriteTimeJSONProp(&b, "created", c.Created)
ap.JSONWriteTimeProp(&b, "created", c.Created)
}
if !c.Committed.IsZero() {
ap.JSONWriteTimeJSONProp(&b, "committed", c.Committed)
ap.JSONWriteTimeProp(&b, "committed", c.Committed)
}
ap.JSONWrite(&b, '}')
return b, nil

View File

@ -40,13 +40,13 @@ func (p Push) MarshalJSON() ([]byte, error) {
b = b[:len(b)-1]
if p.Target != nil {
ap.JSONWriteItemJSONProp(&b, "target", p.Target)
ap.JSONWriteItemProp(&b, "target", p.Target)
}
if p.HashBefore != nil {
ap.JSONWriteItemJSONProp(&b, "hashBefore", p.HashBefore)
ap.JSONWriteItemProp(&b, "hashBefore", p.HashBefore)
}
if p.HashAfter != nil {
ap.JSONWriteItemJSONProp(&b, "hashAfter", p.HashAfter)
ap.JSONWriteItemProp(&b, "hashAfter", p.HashAfter)
}
ap.JSONWrite(&b, '}')
return b, nil

View File

@ -41,13 +41,13 @@ func (r Repository) MarshalJSON() ([]byte, error) {
b = b[:len(b)-1]
if r.Team != nil {
ap.JSONWriteItemJSONProp(&b, "team", r.Team)
ap.JSONWriteItemProp(&b, "team", r.Team)
}
if r.Forks != nil {
ap.JSONWriteItemJSONProp(&b, "forks", r.Forks)
ap.JSONWriteItemProp(&b, "forks", r.Forks)
}
if r.ForkedFrom != nil {
ap.JSONWriteItemJSONProp(&b, "forkedFrom", r.ForkedFrom)
ap.JSONWriteItemProp(&b, "forkedFrom", r.ForkedFrom)
}
ap.JSONWrite(&b, '}')
return b, nil

View File

@ -49,23 +49,23 @@ func (t Ticket) MarshalJSON() ([]byte, error) {
b = b[:len(b)-1]
if t.Dependants != nil {
ap.JSONWriteItemCollectionJSONProp(&b, "dependants", t.Dependants)
ap.JSONWriteItemCollectionProp(&b, "dependants", t.Dependants)
}
if t.Dependencies != nil {
ap.JSONWriteItemCollectionJSONProp(&b, "dependencies", t.Dependencies)
ap.JSONWriteItemCollectionProp(&b, "dependencies", t.Dependencies)
}
ap.JSONWriteBoolJSONProp(&b, "isResolved", t.IsResolved)
ap.JSONWriteBoolProp(&b, "isResolved", t.IsResolved)
if t.ResolvedBy != nil {
ap.JSONWriteItemJSONProp(&b, "resolvedBy", t.ResolvedBy)
ap.JSONWriteItemProp(&b, "resolvedBy", t.ResolvedBy)
}
if !t.Resolved.IsZero() {
ap.JSONWriteTimeJSONProp(&b, "resolved", t.Resolved)
ap.JSONWriteTimeProp(&b, "resolved", t.Resolved)
}
if t.Origin != nil {
ap.JSONWriteItemJSONProp(&b, "origin", t.Origin)
ap.JSONWriteItemProp(&b, "origin", t.Origin)
}
if t.Target != nil {
ap.JSONWriteItemJSONProp(&b, "target", t.Target)
ap.JSONWriteItemProp(&b, "target", t.Target)
}
ap.JSONWrite(&b, '}')
return b, nil

View File

@ -27,7 +27,7 @@ func AuthorizeInteraction(ctx *context.Context) {
ap.ItemTyperFunc = forgefed.GetItemByType
ap.JSONItemUnmarshal = forgefed.JSONUnmarshalerFn
ap.NotEmptyChecker = forgefed.NotEmpty
ap.IsNotEmpty = forgefed.NotEmpty
object, err := ap.UnmarshalJSON(resp)
if err != nil {
ctx.ServerError("UnmarshalJSON", err)

View File

@ -94,7 +94,7 @@ func RepoInbox(ctx *context.APIContext) {
ap.ItemTyperFunc = forgefed.GetItemByType
ap.JSONItemUnmarshal = forgefed.JSONUnmarshalerFn
ap.NotEmptyChecker = forgefed.NotEmpty
ap.IsNotEmpty = forgefed.NotEmpty
var activity ap.Activity
err = activity.UnmarshalJSON(body)
if err != nil {

View File

@ -48,7 +48,7 @@ func FetchObject(iri string) (ap.ObjectOrLink, error) {
}
ap.ItemTyperFunc = forgefed.GetItemByType
ap.JSONItemUnmarshal = forgefed.JSONUnmarshalerFn
ap.NotEmptyChecker = forgefed.NotEmpty
ap.IsNotEmpty = forgefed.NotEmpty
return ap.UnmarshalJSON(resp)
}