Skip to content

Bug 1582393: restore the Bugzilla.parameters webservice method - #193

Open
topunix wants to merge 2 commits into
bugzilla:mainfrom
topunix:bug-1582393
Open

topunix wants to merge 2 commits into
bugzilla:mainfrom
topunix:bug-1582393

Conversation

@topunix

@topunix topunix commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1582393

The /parameters endpoint returned "No such method" because Bugzilla.parameters was never ported to Harmony. This ports it from upstream Bugzilla (bug 443210), keeping the same access tiers:

  • Logged out: maintainer and requirelogin only
  • Logged in: the params already visible in the web UI
  • tweakparams members: every param

Harmony-specific changes:

  • urlbase and attachment_base moved from data/params to localconfig, so they are served from Bugzilla->localconfig, which matches the existing REST docs.
  • cookiepath and maxlocalattachment no longer exist and are omitted.

Not included: last_audit_time from the same upstream patch. It is a separate method outside this bug, and I can port it separately if wanted.

Tested locally in Docker:

  • Logged out returns only maintainer and requirelogin
  • include_fields=maintainer returns only maintainer
  • Admin returns all params, with urlbase read from localconfig

The plain logged-in tier was not exercised live because my local DB has no non-admin test user. It runs the same code path with a different parameter list.

Port /parameters from upstream Bugzilla (bug 443210). Logged-out users get maintainer and requirelogin, logged-in users get the params already visible in the web UI, and tweakparams members get every param.

In Harmony, urlbase and attachment_base moved from data/params to localconfig, so they are served from Bugzilla->localconfig. cookiepath and maxlocalattachment no longer exist and are omitted. last_audit_time from the same upstream patch is not included.

@mrenvoize mrenvoize left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes, mostly for tests and a policy decision. The access model reads as sound (anonymous gets maintainer/requirelogin; logged-in users a whitelist; tweakparams all keys).

  1. Secrets via the API: please decide whether tweakparams users should receive secret params (smtp_password, aws_secret_access_key, duo_skey, duo_akey, duo_ikey). The web UI already shows them, but the API is easier to scrape; I'd suggest masking them.
  2. Tests: there are none, and the webservice tests do not run in CI (the job is commented out in .github/workflows/ci.yml:28-37). Please add tests for the anonymous, logged-in and admin views and run them locally.
  3. The docs say "Restored in 6.0" but BUGZILLA_VERSION is 5.9.1+; please correct. perltidy flags line 185.

@topunix

topunix commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

Thanks. On secrets, I'll mask them: smtp_password, aws_secret_access_key, duo_skey, duo_akey and duo_ikey will come back masked even for tweakparams users. I'll also add webservice tests for the anonymous, logged-in and admin views, run them locally since the CI job is still disabled, and fix the version wording and line 185.

@topunix

topunix commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

Requesting changes, mostly for tests and a policy decision. The access model reads as sound (anonymous gets maintainer/requirelogin; logged-in users a whitelist; tweakparams all keys).

  1. Secrets via the API: please decide whether tweakparams users should receive secret params (smtp_password, aws_secret_access_key, duo_skey, duo_akey, duo_ikey). The web UI already shows them, but the API is easier to scrape; I'd suggest masking them.
  2. Tests: there are none, and the webservice tests do not run in CI (the job is commented out in .github/workflows/ci.yml:28-37). Please add tests for the anonymous, logged-in and admin views and run them locally.
  3. The docs say "Restored in 6.0" but BUGZILLA_VERSION is 5.9.1+; please correct. perltidy flags line 185.

Thanks for the review. Addressed in deb53be:

  • Masking: smtp_password, aws_secret_access_key, duo_ikey, duo_skey and duo_akey, plus six other credential params (RADIUS_secret, LDAPbinddn, github_client_secret, phabricator_api_key, bitly_token, honeypot_api_key), are now always returned as ********, for tweakparams users and admins too, whether set or not. REST, JSON-RPC and XML-RPC all go through the same method, so the mask covers all three. The POD and docs/en/rst/api/core/v1/bugzilla.rst each note this.
  • Tests: new qa/t/webservice_bugzilla_parameters.t covers anonymous, logged-in, tweakparams-only and admin users over XML-RPC and JSON-RPC, and qa/t/rest_bugzilla.t gets an admin case for GET /parameters. Both pass locally. The rest of the webservices suite fails only webservice_bug_update.t (198) and webservice_user_create.t (6), same as on main; Bug 1851434: guard secure_mail call for installs without SecureMail extension #183 and Bug 1851434: make password quality hookable, drop passwdqc params #197 fix those.
  • Version: the history line now says 5.9.1+ to match BUGZILLA_VERSION.
  • perltidy: tidied the line 185 statement with the repo's .perltidyrc.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants