Badsender-com / LePatron.email

LePatron is an opensource email builder allowing to industrialize your email template production. Build tailor made email templates and make them available to your non-technical users.
https://www.lepatron.email
GNU General Public License v3.0
73 stars 12 forks source link

Feat: DSC API Request with User-Agent #795

Closed ntatoud closed 5 months ago

ntatoud commented 5 months ago

Description of changes

Before

To call DSC API you had to be registered in their whitelisted Pp addresses list When trying to call the DSC API from a non-whitelisted ip addresses, you would get:

Picture 1 error_not_whitelisted

After

To remove the need for DSC to whitelist every IP addresses, we will use a User-Agent provided in the request header to identify and get the authorization. When trying to call the DSC API from a non-whitelisted ip addresses, you wil get:

Picture2 image

How ?

Notes

Maybe we could extract the headers in an object since they are the same for all the request, to avoid duplication ?

Tests

On local env :

error_bad_name (The retrieved error message is the correct one)

sonarcloud[bot] commented 5 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud