Skip to content

Conversation

@PRAteek-singHWY
Copy link
Contributor

@PRAteek-singHWY PRAteek-singHWY commented Dec 18, 2025

⚠️ This PR depends on:

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

•	Downloaded the CRE catalogue CSV
•	Added a test standard and mapped it to existing CRE IDs
•	Uploaded the CSV via the MyOpenCRE UI
•	Verified successful import response

Screenshots

image

Dependencies

⚠️ This PR depends on:
#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.

@PRAteek-singHWY
Copy link
Contributor Author

Review focus (apologies for noisy diff)

Apologies for the additional file changes — the actual functionality introduced in this PR is confined to:

  • application/frontend/src/pages/MyOpenCRE/MyOpenCRE.tsx
  • application/frontend/src/pages/MyOpenCRE/MyOpenCRE.scss
  • application/frontend/src/routes.tsx

Other modified files are unrelated to the MyOpenCRE upload flow and were pulled in while rebasing/syncing branches.

Happy to clean these up or move them into a separate PR if that’s preferred.

@PRAteek-singHWY
Copy link
Contributor Author

This PR is part of the MyOpenCRE frontend flow resolving #584. Full context and next steps are summarized on the issue.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant