Skip to content

feat: add POST /rest/v1/suggest_cre_mappings API endpoint#758

Open
Subh24ai wants to merge 2 commits intoOWASP:mainfrom
Subh24ai:feat/suggest-cre-mappings-api
Open

feat: add POST /rest/v1/suggest_cre_mappings API endpoint#758
Subh24ai wants to merge 2 commits intoOWASP:mainfrom
Subh24ai:feat/suggest-cre-mappings-api

Conversation

@Subh24ai
Copy link

Closes #585 (partial)

What this does

Exposes suggest_cre_mappings() as a REST API endpoint, making the
AI-powered CRE mapping feature accessible from the MyOpenCRE frontend.

Endpoint

POST /rest/v1/suggest_cre_mappings

Request: multipart/form-data with cre_csv file
Response:

{
  "mapped": [
    {
      "standard": {"name": "PCI-DSS", "section": "..."},
      "suggested_cre_id": "cre-db-id-123",
      "confidence": 0.85
    }
  ],
  "needs_review": [...]
}

How it works

  1. Accepts CSV upload of standard entries
  2. Parses using existing parse_export_format()
  3. Calls suggest_cre_mappings() from PR feat: add suggest_cre_mappings() for automatic CRE-to-standard mapping #753
  4. Returns high-confidence matches and low-confidence ones for human review

Tests

19 tests passing including new endpoint test.

Related

@Subh24ai Subh24ai force-pushed the feat/suggest-cre-mappings-api branch from 991f1ba to 703eb5f Compare February 27, 2026 11:53
Signed-off-by: Subhash Gupta <subhashgupta1591@gmail.com>
Signed-off-by: Subhash Gupta <subhashgupta1591@gmail.com>
@Subh24ai Subh24ai force-pushed the feat/suggest-cre-mappings-api branch from 703eb5f to 55968b4 Compare February 27, 2026 11:57
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.

MyOpenCRE: allow for mapping CREs to a standard automatically

1 participant