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

LIMS-933: Attach auth header to shipping service requests #675

Merged
merged 2 commits into from
Sep 29, 2023

Conversation

MattPrit
Copy link
Contributor

@MattPrit MattPrit commented Sep 25, 2023

JIRA ticket: LIMS-933

Summary:

This change attaches an auth header to shipping service requests. This is either the user access token as a bearer token or basic auth using stored synchweb credentials.

Changes:

  • Added new separate configuration parameters for shipping service API and frontend URLS.
  • Added configuration parameters for shipping service basic auth credentials.
  • If the user session token cookie is present, it is added as a bearer token in shipping service requests. If not present, stored basic auth credentials are used.
  • AWB PDF email link has been changed to point to the frontend AWB page rather than a direct link to the PDF from the backend.

To test:

  • Check that, when a user books a shipping service shipment through the SynchWeb web application, an access token is used in shipping service requests.
  • Check that, when a shipping service shipment is booked without user SSO, basic auth is used in shipping service requests.

@John-Holt-Tessella
Copy link
Contributor

Do you need to update the configs for prod and staging to have the new urls in?

throw new \Exception("Shipping service auth error: no cookie found and basic auth credentials unset");
}

function __construct()
Copy link
Contributor

Choose a reason for hiding this comment

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

Constructing this object will fail if the setting are not set and might fail if they are null. Either:

  • make sure this is not constructed if the shipping service is not being used
  • make sure the constructor doesn't do anything if the shipping service is not used

@John-Holt-Tessella John-Holt-Tessella merged commit a2a7afd into prerelease Sep 29, 2023
2 checks passed
@John-Holt-Tessella John-Holt-Tessella deleted the fix/lims-933/use-shipping-service-auth branch September 29, 2023 15:49
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.

2 participants