Skip to content

chore: low findings of the v0.3.0 review #117

Closed

Description

@uniqueg

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's DELETE, _replace upserts 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 the user_names cleanup). /me computes admin from claim groups only, so an admin role granted through this API shows admin: false. Fix: document it (or keep it off the Ingress), compute /me's admin with the enforcer, add tests.
  • date-time formats 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 types can be created but not fetched (GET /services/types routes to getServiceTypes). Fix: reject types as a serviceId.
  • No length limits or per-user quotas on registrations. Fix: maxLength where 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 %r or 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.md points to "the release notes". Fix: add release notes (e.g. docs/releases/0.3.0.md) with breaking changes and upgrade steps, passed to gh 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 prepare job.
  • Chart: the default Ingress has no TLS or HTTP redirect, while the config advertises https://…:443. NOTES.txt warns, deployment/README.md doesn't. Fix: document it in the deployment README and/or add an SSL-redirect annotation.
  • Chart: security.auth.audience is not checked at render time (a missing audience only shows as a crash-looping pod), unlike the admin group mapping. Fix: render-time fail plus a chart test.
  • Chart hardening: set automountServiceAccountToken: false; optionally add a NetworkPolicy.
  • Chart values mix naming conventions (host_name, cloud_registry next 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 LICENSE text (.dockerignore excludes 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.0 service.
  • 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 run helm upgrade, the legacy-chart section says legacy releases must be uninstalled; the paragraph also uses the removed deploy/<appName>. Fix: limit the paragraph to releases installed with the current chart.
  • Stale texts: the check_admin_groups warning still mentions "set the service info"; deployment/README.md says "first release after 0.2.0" (0.2.0 was never tagged); README says "beta" while pyproject.toml says "3 - Alpha".

Not taken up

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions