feat(oga-app): add template to render Trader submissions correctly in OGA portal#205
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
6d65f5a to
1bf025b
Compare
1bf025b to
ebbac63
Compare
8649135 to
901f6e7
Compare
There was a problem hiding this comment.
Code Review
This pull request successfully adds support for rendering trader-submitted information using view templates in the OGA portal. However, a critical security vulnerability has been identified: the new endpoint for retrieving file download URLs lacks authentication and relies on an insecure backend mechanism, potentially exposing sensitive trader documents to unauthorized access. This issue is exacerbated by the fact that the proxy generates permanent, unauthenticated URLs while presenting them as temporary, creating a significant security risk if deployed outside of a local development environment.
901f6e7 to
50c4f51
Compare
f3876b3 to
18452f8
Compare
|
@ginaxu1 can you rebase with current |
6cf591b to
68000c9
Compare
…ion (including file downloads) in the OGA portal's application detail view
1c11997 to
2c6ccfb
Compare
2c6ccfb to
fc0f3dc
Compare
fc0f3dc to
082f93a
Compare
sthanikan2000
left a comment
There was a problem hiding this comment.
Check the nit
Otherwise LGTM

Closes #188
Screen.Recording.2026-03-20.at.10.03.19.mov
Summary
Add OGA view template support to render Trader-submitted information (including file downloads if a file was uploaded by Trader) in the OGA portal's application detail view. Update backend in order to render specific view templates and enabling file downloads
Flow:
format:"file"in the .view.json schemagetDownloadUrl(key)→GET /api/oga/uploads/{key}HandleGetUploadURLhandler proxies the request to the NSW backendGET /uploads/{key}{download_url, expires_at}Changes
OGA Go service
oga/internal/service.goadd OgaForm field to the Application struct and .view form lookup logic in GetApplicationoga/internal/handler.goaddHandleGetUploadURLhandler (mapped toGET /api/oga/uploads/{key}). This endpoint constructs a direct download URL to the main backend's /content endpoint to bypass identity provider authentication gaps for OGA usersoga/internal/config.goadd BackendAPIBaseURL to the Config struct, defaulting to http://localhost:8080/api/v1 or the BACKEND_API_BASE_URL environment variableoga/cmd/server/main.goregister theGET /api/oga/uploads/{key}routeOGA frontend (oga-app):
portals/apps/oga-app/src/api.tsupdate the OGAApplication interface to include the ogaForm propertyportals/apps/oga-app/src/services/upload.tsupdate getDownloadUrl to fetch the URL from the OGA service's new proxy endpoint/api/oga/uploads/${key}portals/apps/oga-app/docker-entrypoint.sh: add VITE_API_BASE_URL to the runtime configurationBackend seed data
001_insert_seed_form_templates.sqladdsupportingDocumentswithformat: "file"to the Phytosanitary Certificate and Health Certificate forms001_insert_seed_workflow_node_templates.sqladdsubmission.request.metainto the Phytosanitary and Health Certificate nodes to allow the OGA service to identify the correct view templates001_insert_seed_pre_consignment_template.sqlupdate General Trader Verification node to use the structured submission block withrequest.metainstead of the deprecated submissionUrl.Testing