wip: load repo to ctx

This commit is contained in:
Michael Jerger 2023-10-23 17:16:38 +02:00
parent 643681663f
commit 317b7fac8f
3 changed files with 42 additions and 2 deletions

View file

@ -894,6 +894,11 @@ func Routes() *web.Route {
m.Get("", activitypub.Person)
m.Post("/inbox", activitypub.ReqHTTPSignature(), activitypub.PersonInbox)
}, context_service.UserIDAssignmentAPI())
// TODO: implement ctx
m.Group("/repository-id/{repsitory-id}", func() {
m.Get("", activitypub.Repository)
m.Post("/inbox", activitypub.ReqHTTPSignature(), activitypub.RepositoryInbox)
}, context_service.RepositoryAssignmentAPI())
}, tokenRequiresScopes(auth_model.AccessTokenScopeCategoryActivityPub))
}
@ -1081,7 +1086,10 @@ func Routes() *web.Route {
repo.CreateOrgRepoDeprecated)
// requires repo scope
m.Combo("/repositories/{id}", reqToken(), tokenRequiresScopes(auth_model.AccessTokenScopeCategoryRepository)).Get(repo.GetByID)
m.Combo("/repositories/{id}",
reqToken(),
tokenRequiresScopes(auth_model.AccessTokenScopeCategoryRepository)
).Get(repo.GetByID)
// Repos (requires repo scope)
m.Group("/repos", func() {