OWASP / OWASP/OpenCRE

Auth-wrap POST /rest/v1/cre_csv_import (deprecate anonymous MyOpenCRE import)

Open
#966 2 comments 0 reactions 1 assignee View on GitHub

@skypank-coder is already working on this.

Since Jul 9, 2026.

Dominant language
Python
Stars
180
Forks
137
Avg merge
3d 23h
Merged PRs (30d)
21

Description

Context

RFC #876 adds authenticated MyOpenCRE upload at POST /rest/v2/myopencre/upload. Today, POST /rest/v1/cre_csv_import is public (no auth) and writes directly into the shared graph via myopencre_parser — intended for local/self-hosted use.

Maintainer decision: cre_csv_import must be auth-wrapped for online deployment. Anonymous CSV import into the shared CRE graph is not acceptable on opencre.org.

Requirements

  • Add @login_required (or equivalent post-RFC TODO 1 session check) to POST /rest/v1/cre_csv_import
  • Return 401/302 for anonymous requests (consistent with auth route migration — see auth /rest/v1/auth/* issue)
  • Document that v1 import remains for authenticated admin/contributor use; per-user mapping flow is /rest/v2/myopencre/upload (RFC TODO 4)
  • Frontend MyOpenCRE page: if using v1 import path today, switch to v2 upload when available or require login for v1
  • Consider gating behind CRE_ALLOW_IMPORT and/or capabilities.myopencre in addition to login
  • Update tests in web_main_test.py / MyOpenCRE frontend tests

Migration notes

  • Local dev with NO_LOGIN=1 should continue to work for contributor workflows
  • GET /rest/v1/cre_csv template download may stay public (read-only) — confirm during implementation

Related

  • docs/rfc/user-auth-myopencre.md
  • #586
  • application/web/web_main.py import_from_cre_csv

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.