Skip to content

Update configuration for API requests#1653

Merged
stephencdaly merged 2 commits intomainfrom
update-api-configuration
Sep 25, 2025
Merged

Update configuration for API requests#1653
stephencdaly merged 2 commits intomainfrom
update-api-configuration

Conversation

@stephencdaly
Copy link
Contributor

What problem does this pull request solve?

Trello card: https://trello.com/c/AiSEhwAu

Update configuration to talk to forms-admin rather than forms-api locally.

Stop sending the API key with requests and remove the configuration setting as forms-runner now makes requests to forms-admin rather than forms-api.

forms-admin does not require an API key for requests as the /api/ endpoints are only accessible from within the VPC in our deployed environments.

Things to consider when reviewing

  • Ensure that you consider the wider context.
  • Does it work when run on your machine?
  • Is it clear what the code is doing?
  • Do the commit messages explain why the changes were made?
  • Are there all the unit tests needed?
  • Do the end to end tests need updating before these changes will pass?
  • Has all relevant documentation been updated?

We have switched our deployed versions of forms-runner to make
requests to the forms-admin API endpoints through the internal load
balancer rather than to forms-api by setting this environment variable
for the ECS tasks.

Default the local configuration to make requests to forms-admin rather
than forms-api to match the deployed configuration.

Because we need to use the hostname for the internal load balancer in
the deployed environments, we need to keep a separate setting for this
URL to the `forms_admin.base_url` setting which is used to construct
links to the admin interface. We may want to consider renaming this
setting in future to make it not refer to forms-api.
forms-admin does not require an API key for requests as the /api/
endpoints are only accessible from within the VPC in our deployed
environments.

Stop sending the API key with requests and remove the configuration
setting as forms-runner now makes requests to forms-admin rather than
forms-api.
@stephencdaly stephencdaly force-pushed the update-api-configuration branch from 2401c9e to ae1dcc4 Compare September 24, 2025 15:58
@sonarqubecloud
Copy link

@github-actions
Copy link
Contributor

🎉 A review copy of this PR has been deployed! It is made of up two components

  1. A review copy of forms-runner
  2. A production copy of forms-admin

Important

Not all of the functionality of forms-runner is present in review apps.
Functionality such as sending emails, file upload, and S3 submission types are
deliberately disabled for the sake of simplifying review apps.

You should use the full dev environment to test the functionality which is disabled here.

It may take 5 minutes or so for the application to be fully deployed and working. If it still isn't ready
after 5 minutes, there may be something wrong with the ECS task. You will need to go to the integration AWS account
to debug, or otherwise ask an infrastructure person.

For the sign in details and more information, see the review apps wiki page.

@stephencdaly stephencdaly merged commit d299986 into main Sep 25, 2025
11 checks passed
@stephencdaly stephencdaly deleted the update-api-configuration branch September 25, 2025 08:21
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