feat(myopencre): add CSV upload UI and wire to existing import endpoint #664
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please review after the above PR is merged.
Summary
Adds the next step of the MyOpenCRE user flow by introducing a frontend UI for CSV upload, allowing users to map their own security standards to OpenCRE without using curl.
This PR wires the existing CSV import backend endpoint to a simple, feature-flagged UI.
⸻
What this PR does
This PR introduces a MyOpenCRE frontend page that allows users to:
• ✅ Download the full CRE catalogue as a CSV
• ✅ Upload a CSV mapping a custom standard (e.g. SOC2) to existing CREs
• ✅ Import mappings via the existing /rest/v1/cre_csv_import endpoint
• ✅ Respect the CRE_ALLOW_IMPORT feature flag:
• Enabled for local execution
• Disabled on hosted OpenCRE (Heroku) to prevent resource abuse
This removes the need to use curl for CSV import/export and makes MyOpenCRE usable by non-technical users.
⸻
Why this is needed
The MyOpenCRE API has been stable for some time, but until now it required manual API usage via curl.
This PR:
• Exposes existing backend functionality through a UI
• Matches the original issue’s acceptance criteria
• Enables the intended user journey for mapping custom standards to CREs
No backend logic is changed — this PR focuses on UI enablement only.
⸻
Scope
• Frontend only
• Uses existing backend endpoints
• No changes to import logic or data model
• No async processing or progress tracking (intentionally out of scope)
⸻
How it was tested
• Ran OpenCRE locally with:
-> export CRE_ALLOW_IMPORT=true
-> make dev-flask
⸻
Screenshots
⸻
Dependencies
• #662 – CSV download of all CREs
Please review after the above PR is merged.
⸻
Future work (out of scope for this PR and most probably this issue)
The following are intentionally excluded to keep scope focused and reviewable:
• Async/background CSV import
• Import progress UI
• Improved error UX
• “Dry-run” / validation-only import mode
These are good candidates for follow-up PRs.