Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIMSBIOHUB-239: Proxy BCTW/Critterbase requests through the SIMS backend using the SIMS Service Account #1077

Merged
merged 186 commits into from
Aug 31, 2023

Conversation

JeremyQuartech
Copy link
Contributor

@JeremyQuartech JeremyQuartech commented Aug 25, 2023

Links to Jira Tickets

Description of Changes

  • Adds new method to Keylcloak service to get service account token
  • Adds new service, 'BctwService', to make requests to the BCTW API
  • Adds new '/telemetry' API endpoint for generic lookups and calls that proxy straight through to BCTW API
  • Adds new 'CritterbaseService', to make requests to the Critterbase API
  • Adds '/critter-data' endpoint for generic lookup and xref proxied calls to the Critterbase API

Testing Notes

  • 'BCTW_API_HOST' must be added to your env file for the BctwService to function.
  • 'CB_API_HOST' must be added to your env file for CritterbaseService to work.
  • 'KEYCLOAK_ADMIN_USERNAME' and 'KEYCLOAK_ADMIN_PASSWORD' must be present in your env file for the Keycloak.getServiceToken method to work.
  • The changes required in BCTW API and Critterbase are live in their dev environments: BCTW_API_HOST=https://moe-bctw-api-dev.apps.silver.devops.gov.bc.ca, CB_API_HOST=https://moe-critterbase-api-dev.apps.silver.devops.gov.bc.ca/api

MacQSL and others added 30 commits July 18, 2023 10:27
…o critterbase calls, still need to implement automated signup
…mponents can now be added to form on button click
… calling cb api through hooks in the frontend. No more extra auth headers, now all done through keycloak JWT.
…rbase. Made a wrapper function for critterbase selects that uses existing Formik components
…der and the docker compose that we don't need anymore
curtisupshall
curtisupshall previously approved these changes Aug 29, 2023
api/src/paths/critter-data/critters/{critterId}.ts Outdated Show resolved Hide resolved
@NickPhura
Copy link
Collaborator

There are a couple of code smells for a few tests that don't have a complete assertion

@NickPhura NickPhura removed the Early Feedback Welcome PR is not finished, but early review feedback is welcomed label Aug 31, 2023
Copy link
Contributor

@al-rosenthal al-rosenthal left a comment

Choose a reason for hiding this comment

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

🌆

@sonarcloud
Copy link

sonarcloud bot commented Aug 31, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
1.9% 1.9% Duplication

@JeremyQuartech JeremyQuartech merged commit df258a0 into dev Aug 31, 2023
20 checks passed
@JeremyQuartech JeremyQuartech deleted the SIMSBIOHUB-239 branch August 31, 2023 20:34
KjartanE pushed a commit that referenced this pull request Sep 5, 2023
…using SIMS Service Account (#1077)

* Adds '/telemetry' endpoint to API for proxied BCTW requests.
* Adds new service to handle authenticated requests to Critterbase API.
* Adds new '/critter-data' endpoint to API for proxied Critterbase requests.
* Modifies Add Animal form's api hooks to point at /critter-data endpoint instead of Critterbase directly.
* Adds new method to Keycloak service for service account token retrieval.

---------

Co-authored-by: Mac Deluca <Mac.Deluca@quartech.com>
Co-authored-by: Graham Stewart <graham.stewart@quartech.com>
Co-authored-by: Alfred Rosenthal <alfred.k.rosenthal@gmail.com>
Co-authored-by: Curtis Upshall <curtisupshall@gmail.com>
Co-authored-by: Nick Phura <nickphura@gmail.com>
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.

6 participants