Repository navigation
Closed
Description
Low-severity findings from the pre-release review of dev at 98771b3 (before v0.3.0), collected in one issue. Larger items may get their own issue or PR; tick them off here when done.
Access control and data integrity
- PUT racing DELETE re-creates a deleted service. If a maintainer's
PUT /services/{serviceId}overlaps with the owner'sDELETE,_replaceupserts the service again, and the maintainer becomes its owner (or the service is left without roles). This breaks "new identifiers: admins only". Fix: don't upsert after a first read found the service (return 404 instead, unless the caller is an admin); remove roles before deleting the document; add a test. - Roles granted during a delete survive it. A role added on a service while it is being deleted (or when removing the roles fails after the delete) stays stored, and with the race above its holder could re-create the service. Fix: after granting, check that the service still exists and remove the role otherwise.
- FOCA's permissions API (
/admin/access-control/permissions) is exposed but undocumented and untested. Access is admin-only (checked), but admins can use it to bypass app invariants (e.g. remove the last owner without the 409 check or theuser_namescleanup)./mecomputesadminfrom claim groups only, so an admin role granted through this API showsadmin: false. Fix: document it (or keep it off the Ingress), compute/me'sadminwith the enforcer, add tests. -
date-timeformats in registration bodies are not validated (createdAt: "yesterday"is stored and served on GA4GH endpoints). Fix: add a date-time format validator (e.g. rfc3339-validator) or reuse the format checker used for service info; tests expecting 400. - A service with id
typescan be created but not fetched (GET /services/typesroutes togetServiceTypes). Fix: rejecttypesas aserviceId. - No length limits or per-user quotas on registrations. Fix:
maxLengthwhere GA4GH allows, a per-user limit, rate limiting at the ingress. (Pagination stays deferred to the next Service Registry spec, as documented.) - Schema-validation 400s drop the reason ("The request is malformed", without a trailing period unlike the other 400 texts). Fix: pass the validator message through.
- No audit logging of role changes and verifications. Fix: log grants, revocations and verification changes (who, what, which service).
- Log values from request paths aren't escaped in the app's own log messages (
verification.py,permissions.py). Fix: log them with%ror an escape helper. (The FOCA side is tracked in FOCA.)
Deployment and release
- No curated release notes or upgrade guide, although v0.3.0 has many breaking changes;
deployment/README.mdpoints to "the release notes". Fix: add release notes (e.g.docs/releases/0.3.0.md) with breaking changes and upgrade steps, passed togh release create --notes-file; mention that the chart version goes from 4.0.0 back to 0.3.0 because it now follows the app version. - Release images are not reproducible: unpinned requirements (ranges only), a mutable base image tag, pip at build time, and the release rebuilds instead of promoting the CI-tested image. Fix: a pinned constraints/lock file for the image and CI, the base image pinned by digest, Dependabot for both.
- The release workflow doesn't check that CI passed for the tagged commit. Fix: check the commit's check runs in the
preparejob. - Chart: the default Ingress has no TLS or HTTP redirect, while the config advertises
https://…:443.NOTES.txtwarns,deployment/README.mddoesn't. Fix: document it in the deployment README and/or add an SSL-redirect annotation. - Chart:
security.auth.audienceis not checked at render time (a missing audience only shows as a crash-looping pod), unlike the admin group mapping. Fix: render-timefailplus a chart test. - Chart hardening: set
automountServiceAccountToken: false; optionally add a NetworkPolicy. - Chart values mix naming conventions (
host_name,cloud_registrynext to camelCase keys). Renaming after the first release is breaking, so decide before or with v0.3.0. - Docker Compose publishes the dev app on all interfaces while the dev config disables audience checks. Fix: bind to
127.0.0.1:8080:8080. - The image doesn't contain the Apache-2.0
LICENSEtext (.dockerignoreexcludes it). Fix: include and copy it. - CI never calls database-backed endpoints against a real MongoDB (the Compose smoke test only checks the UI and version; tests use mongomock). Fix: curl checks of the API in the Compose job, optionally a pytest job with a
mongo:7.0service. - Dependabot skips
docs/api/requirements.txt. Fix: add/docs/api.
Docs
- Contradictory upgrade instructions in
deployment/README.md: the 0.3.0 upgrade paragraph says to scale down and runhelm upgrade, the legacy-chart section says legacy releases must be uninstalled; the paragraph also uses the removeddeploy/<appName>. Fix: limit the paragraph to releases installed with the current chart. - Stale texts: the
check_admin_groupswarning still mentions "set the service info";deployment/README.mdsays "first release after 0.2.0" (0.2.0 was never tagged); README says "beta" whilepyproject.tomlsays "3 - Alpha".
Not taken up
- snake_case names in the added endpoints (
verified_at,service_id): decided for feat: let admins verify services #111. - Error media type of GA4GH endpoints (
application/problem+jsonvsapplication/jsonin the spec): covered by build: upgrade to FOCA 0.15 #104. - Pagination of
GET /services: deferred to the next Service Registry spec (see README).
Metadata
Metadata
Assignees
Labels
No labels
Activity
fix: keep shortened details within the limit
fix: address low-severity review findings (#121)