fix: return 404 for update feeds when update server is disabled (#589)
Generic: Repo Health / Site Health (push) Has been skipped
Generic: Repo Health / Access control (push) Successful in 1s
Generic: Repo Health / Site Health (pull_request) Has been skipped
Branch Policy Check / Verify merge target (pull_request) Failing after 1s
Universal: PR Check / Branch Policy (pull_request) Failing after 1s
Generic: Repo Health / Access control (pull_request) Successful in 1s
Universal: PR Check / Validate PR (pull_request) Failing after 8s
PR RC Release / Build RC Release (pull_request) Failing after 1m3s
Universal: Secret Scanning / Gitleaks Secret Scan (pull_request) Successful in 1m6s
Universal: Build & Release / Promote to RC (pull_request) Has been skipped
RC Revert / Rename rc/ back to dev/ (pull_request) Has been skipped
Branch Cleanup / Delete merged branch (pull_request) Successful in 2s
Universal: Build & Release / Build & Release Pipeline (pull_request) Failing after 33s
Generic: Repo Health / Scripts governance (push) Has been cancelled
Generic: Repo Health / Repository health (push) Has been cancelled
Generic: Repo Health / Report Issues (push) Has been cancelled
Universal: PR Check / Build RC Package (pull_request) Has been cancelled
Universal: PR Check / Report Issues (pull_request) Has been cancelled
Generic: Repo Health / Scripts governance (pull_request) Has been cancelled
Generic: Repo Health / Repository health (pull_request) Has been cancelled
Generic: Repo Health / Report Issues (pull_request) Has been cancelled

The RepoAssignmentPublicFeed middleware did not check LicensingEnabled,
so feed endpoints responded with valid data even when the feature was
disabled. Now checks the effective config (repo → org cascade) and
returns 404 when neither level has LicensingEnabled=true.

Co-Authored-By: Moko Consulting <hello@mokoconsulting.tech>
This commit is contained in:
Jonathan Miller
2026-06-11 15:26:52 -05:00
parent 7ed335e6c3
commit 7f3785e7de
+10 -5
View File
@@ -42,11 +42,16 @@ func RepoAssignmentPublicFeed() func(ctx *Context) {
repo.Owner = owner
ctx.Repo.Repository = repo
// Load update config for platform-aware routing.
repoUpdateCfg, _ := updateserver_model.GetRepoConfig(ctx, repo.ID)
if repoUpdateCfg != nil {
ctx.Data["RepoUpdatePlatform"] = repoUpdateCfg.Platform
} else {
// Check if the update server is enabled (repo config → org config).
// Return 404 when neither level has LicensingEnabled=true.
cfg := updateserver_model.GetEffectiveConfig(ctx, owner.ID, repo.ID)
if cfg == nil || !cfg.LicensingEnabled {
ctx.NotFound(nil)
return
}
ctx.Data["RepoUpdatePlatform"] = cfg.Platform
if cfg.Platform == "" {
ctx.Data["RepoUpdatePlatform"] = "joomla"
}