fix(proxy): [OCISDEV-1517] add missing /vault/graph routes for activities and invitations (#13109)

This commit is contained in:
Michal Klos authored and GitHub committed 2026-10-13 13:15:20 +00:00
1 parent 2a23956a8b
commit 7b83f36060
2 files changed
+39

No files matched your search

@@ -274,6 +274,14 @@ func DefaultPolicies() []config.Policy {
Endpoint: "/graph/",
Service: "com.owncloud.web.graph",
},
{
Endpoint: "/vault/graph/v1beta1/extensions/org.libregraph/activities",
Service: "com.owncloud.web.activitylog",
},
{
Endpoint: "/vault/graph/v1.0/invitations",
Service: "com.owncloud.web.invitations",
},
{
Endpoint: "/vault/graph/",
Service: "com.owncloud.web.graph",
+31
View File
@@ -165,3 +165,34 @@ func TestRouter(t *testing.T) {
}
}
}
// Vault /graph/ sub-routes must reach the same service as their non-vault counterpart.
func TestRouterVaultGraphSubRoutes(t *testing.T) {
cfg := defaults.DefaultConfig()
cfg.Policies = defaults.DefaultPolicies()
reg := registry.GetRegistry()
sel := selector.NewSelector(selector.Registry(reg))
router := New(sel, cfg.PolicySelector, cfg.Policies, log.NewLogger())
// Each path must match its own route, not a catch-all.
paths := []string{
"/graph/v1beta1/extensions/org.libregraph/activities",
"/vault/graph/v1beta1/extensions/org.libregraph/activities",
"/graph/v1.0/invitations",
"/vault/graph/v1.0/invitations",
}
for _, path := range paths {
r := httptest.NewRequest("GET", path, nil)
ri, ok := router.Route(r)
if !ok {
t.Errorf("router.Route failed to route %s", path)
continue
}
if ri.endpoint != path {
t.Errorf("%s matched endpoint %q, want %q — got routed to the generic graph catch-all instead", path, ri.endpoint, path)
}
}
}