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

15864 Spring Cloud Gate configuration with Swagger #16292

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

jalbinson
Copy link
Collaborator

@jalbinson jalbinson commented Oct 21, 2024

This PR updates the Auth service to use Spring Cloud Gateway configuration to forward requests rather than a wildcard request mapping. It also enabled swagger when running the application locally.

Test Steps:
To ensure Gateway is working as expected

  1. Run gradle quickRun to start up ReportStream
  2. Run gradle submissions:bootRun
  3. Run gradle auth:bootRun
    (Contact me if having an issue with a missing secret and I will share the staging okta secret with you)
  4. Run Arnej token script to retrieve access token
    (If this is a huge pain I can send you a valid access token)
  5. Make a request to POST http://localhost:9000/api/v1/reports
  6. If you get a 415 Unsupported Media Type response it made it to submissions

To see Swagger

  1. Run gradle submissions:bootRun
  2. Access http://localhost:9000/swagger/ui.html
  3. See Swagger!

Changes

  • Removed unneeded code
  • Implemented more configuration based gateway pattern
  • Included Swagger

Checklist

Testing

  • Tested locally?
  • Ran ./prime test or ./gradlew testSmoke against local Docker ReportStream container?
  • Added tests?

Linked Issues

…m:CDCgov/prime-reportstream into platform/jamie/15864-spring-cloud-swagger
) {

@Test
fun `successful healthcheck`() {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added a simple test here just to make sure project is compiling and healthcheck endpoint is functional.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I removed the AuthControllerTest as the AuthController no longer exists. I believe this style of test would be better suited for an end-to-end test in the future.

Since the auth and cloud gateway functionality are all now configuration classes I don't think unit tests are much help. The internal functionality of those plugins should already be tested by their own authors.

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.

Investigate Spring Cloud Gateway support for only allowing the proxying of certain URLs
1 participant