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

Add a test suma connection endpoint #2444

Merged
merged 4 commits into from
Mar 21, 2024
Merged

Conversation

nelsonkopliku
Copy link
Member

@nelsonkopliku nelsonkopliku commented Mar 20, 2024

Description

This PR adds an endpoint where connection against suma can be tested.

POST /api/v1/settings/suma_credentials/test

It either returns 200 or 422. If no settings were previously saved, 422 is returned.
No specific information about why the test failed is provided.

Added a 1s timeout for suma to login which in the worst case scenario where the last of the 5 attempts is successful would take around 5 seconds.
The other requests have a timeout of 5s by default.
A 10s timeout has been set to the genserver's calls, so that it covers for network timeouts and does not raise, but returns an error.

How was this tested?

Automated tests.

@nelsonkopliku nelsonkopliku changed the title Add setup as a Discovery callback Add a test suma connection endpoint Mar 20, 2024
@nelsonkopliku nelsonkopliku self-assigned this Mar 20, 2024
@nelsonkopliku nelsonkopliku added enhancement New feature or request user story elixir Pull requests that update Elixir code labels Mar 20, 2024
@nelsonkopliku nelsonkopliku marked this pull request as ready for review March 20, 2024 17:51
@nelsonkopliku nelsonkopliku merged commit 7cb7252 into main Mar 21, 2024
36 checks passed
@nelsonkopliku nelsonkopliku deleted the test-suma-connection-endpoint branch March 21, 2024 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
elixir Pull requests that update Elixir code enhancement New feature or request user story
Development

Successfully merging this pull request may close these issues.

None yet

2 participants