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.
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
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
How ?
Create an environment variable for the User-Agent
Add its value to the config
Pass it as a header for every call to DSC in DscProvider.
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 :
[x] Test on a non-whitelisted address IP, without the User-Agent header (see picture 1)
[x] Test on a non-whitelisted with the User-Agent header (see picture 2)
[x] Test on a non-whitelister with the User-Agent header and a bad naming :
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
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
How ?
DscProvider
.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 :
(The retrieved error message is the correct one)