janjaali / sendGrid-mock

SendGrid-Mock serves as a simple server mocking the sendgrid-apis for development purposes.
https://cloud.docker.com/repository/docker/ghashange/sendgrid-mock/general
MIT License
48 stars 19 forks source link

[Question] - API Key #73

Closed alejoFernandezSS closed 7 months ago

alejoFernandezSS commented 7 months ago

Hey there! Im trying to understand why the mock server needs an actual valid API key. I tried using a non valid (but with right format) key and its giving me an authentication error so Im guessing it actually uses it for something. I want to implement this on my development team but some people are concerned about sending our API Key to 3rd parties. Thanks!

alejoFernandezSS commented 7 months ago

Nevermind.... I just figured it out 🤦

fernandosesma commented 7 months ago

Wondering the same thing, what did you find?

alejoFernandezSS commented 7 months ago

Hi @fernandosesma ! Basically the API Key sent to the container needs to be same that you use in your sendgrid client. What I ended up doing was adding a MOCK_API_KEY variable to my .env file and when I want to use the docker container I initalize the sengrid client with that key instead of the actual real key. Keep in mind that the key needs to be the correct format, for example I used SG.123456 and it works just fine

fernandosesma commented 7 months ago

Hi @fernandosesma ! Basically the API Key sent to the container needs to be same that you use in your sendgrid client. What I ended up doing was adding a MOCK_API_KEY variable to my .env file and when I want to use the docker container I initalize the sengrid client with that key instead of the actual real key. Keep in mind that the key needs to be the correct format, for example I used SG.123456 and it works just fine

Ah okay great, thanks for the response! Appreciate it!