Skip to content

APS Gateway#5296

Merged
brettedw merged 42 commits intomainfrom
task/asago-public-endpoints
Apr 20, 2026
Merged

APS Gateway#5296
brettedw merged 42 commits intomainfrom
task/asago-public-endpoints

Conversation

@brettedw
Copy link
Copy Markdown
Collaborator

@brettedw brettedw commented Apr 13, 2026

Config refs


  • Adds vscode launcher to run 1 or both of main api & asa-go api

For local testing I recommend:

  1. Start only the asa go api (can run both if you want to, but this will make it obvious the app is hitting asa-go api)
  2. Change your .env.development VITE_API_BASE_URL to port 8081
  3. Build & run app

closes #5249

Test Links:

Landing Page
MoreCast
Percentile Calculator
C-Haines
FireCalc
FireCalc bookmark
Auto Spatial Advisory (ASA)
HFI Calculator
SFMS Insights
Fire Watch
Weather Toolkit

Comment thread backend/packages/wps-api/src/app/asa_go_main.py Fixed
Comment thread backend/packages/wps-api/src/app/tests/asa_go/test_asa_go_router.py Fixed
Comment thread backend/packages/wps-api/src/app/tests/asa_go/test_asa_go_router.py Fixed
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 13, 2026

Codecov Report

❌ Patch coverage is 73.77049% with 32 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.34%. Comparing base (8552b0b) to head (7757a96).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
backend/packages/wps-api/src/app/asa_go_main.py 60.86% 16 Missing and 2 partials ⚠️
backend/packages/wps-api/src/app/routers/asa_go.py 80.00% 12 Missing and 1 partial ⚠️
backend/packages/wps-shared/src/wps_shared/auth.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #5296      +/-   ##
============================================
+ Coverage     67.76%   68.34%   +0.58%     
- Complexity        0       26      +26     
============================================
  Files           358      453      +95     
  Lines         15594    17946    +2352     
  Branches       1735     2118     +383     
============================================
+ Hits          10567    12266    +1699     
- Misses         4500     5061     +561     
- Partials        527      619      +92     
Flag Coverage Δ
android 24.68% <ø> (?)
asa_go 79.80% <100.00%> (?)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@brettedw brettedw changed the title asa go routes APS Gateway Apr 15, 2026
@brettedw brettedw marked this pull request as ready for review April 15, 2026 17:44

router = APIRouter(
prefix="/fba",
dependencies=[Depends(asa_authentication_required), Depends(audit_asa)],
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to remove these dependencies too

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR doesn't change or make the fba endpoints public, only the duplicate asa-go endpoints.
_=Depends(asa_authentication_required)) was removed from the endpoints below in this file because it was redundant

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind, saw the auth removals below and assumed this was the public API

run: |
DEPLOY_VERSION="${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" MODULE_NAME=api SECOND_LEVEL_DOMAIN="apps.silver.devops.gov.bc.ca" VANITY_DOMAIN="${SUFFIX}-dev-psu.apps.silver.devops.gov.bc.ca" ENVIRONMENT="development" bash openshift/scripts/oc_deploy.sh ${SUFFIX} apply

- name: Deploy ASA Go API to Dev
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can ASA Go API deployment be another workflow that can be reused across dev and prod?

Copy link
Copy Markdown
Collaborator Author

@brettedw brettedw Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably, I can try to put the bulk of it in an action

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added an action to try to reduce some of the workflow duplication in: d65957b. I pulled the setting of SUFFIX out of the oc-setup action so it could more easily be used in with: workflow expressions, but it is also used for more than just openshift now so I thought this way was a little more explicit

except HTTPException as exception:
logger.error("Could not validate the credential %s", exception)
except HTTPException:
# public audited routes intentionally allow anonymous access, so a missing bearer token
Copy link
Copy Markdown
Collaborator

@conbrad conbrad Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change needed only for audited non logged in users?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It isn't necessarily "needed", but if we still want to audit these endpoints, we get a lot of noise in the logs if the user doesn't have an idir (is public). If we do want to audit maybe we should ensure we aren't auditing if there is no idir....I'm not sure there would be any use in that

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

audit removed in 7d70768

Comment thread .github/workflows/cleanup.yml
Comment thread openshift/templates/allow_gateway_to_wps_asa_go_api.yaml
Comment thread backend/packages/wps-shared/src/wps_shared/auth.py Outdated
Comment thread openshift/scripts/oc_deploy_to_production.sh
Copy link
Copy Markdown
Collaborator

@conbrad conbrad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😎

Comment thread .github/actions/gwa-publish/action.yml Outdated
if [ -n "${QUALIFIER}" ]; then
gwa publish-gateway "${CONFIG_PATH}" --qualifier "${QUALIFIER}"
else
gwa publish-gateway "${CONFIG_PATH}"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What cases are there where we wouldn't want a qualifier? Is there a risk that user error could unintentionally prune configs?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, there isn't really a case anymore where we wouldn't want a qualifier, this should always require one

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in dd44c08

Comment thread openshift/templates/asa_go_api.yaml Outdated
app: ${APP_NAME}-${SUFFIX}-asa-go
name: ${APP_NAME}-${SUFFIX}-asa-go
annotations:
image.openshift.io/triggers: |-
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to use the deploy version idea we use in API?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm ya I could do that for consistency. We do have less race conditions/potential re-rollouts in this deployment because there's only 1 image, but I could change it to use deploy version to ensure there's only ever 1 rollout (potentially could be 2 now if image and template changed)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in f187e60

@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Collaborator

@dgboss dgboss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice dev ops work!

@brettedw brettedw temporarily deployed to production April 20, 2026 22:40 Inactive
@brettedw brettedw merged commit ff05b6b into main Apr 20, 2026
39 checks passed
@brettedw brettedw deleted the task/asago-public-endpoints branch April 20, 2026 22:48
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.

ASA Go: Use APS Gateway for public access

4 participants