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

🐛 [[email protected]] SMTP connection URI with Sendgrid #2322

Open
MelanieVazquez22 opened this issue Mar 6, 2025 · 2 comments
Open
Labels
needs: author feedback Pending additional information from the author type: bug Something isn't working

Comments

@MelanieVazquez22
Copy link

MelanieVazquez22 commented Mar 6, 2025

Describe the problem:

When running the extension with my sendgrid credentials, i received the following log: API key does not start with "SG.". with a following error that my message couldn't be send.

I added a log of the config, and the password was omitted.

In the log.ts/js files in the source code, the config looks like this:

export const obfuscatedConfig = Object.assign({}, config,
{
smtpConnectionUri: "",
smtpPassword: "",
clientId: "",
clientSecret: "",
refreshToken: "",
}
);

When analyzing the code i noticed that in the index.ts/js the function sendWithSendGrid(payload: QueuePayload) uses sgMail.setApiKey(config.smtpPassword), but from the firebase console i can't configure the password (doesn't generate the create secret from the console)

To temporarily solve the problem, i created my own secret key as SMTP_PASSWORD as the variable in the config is set and commented the atrs. that were hard coded "" but it would be nice for this bug to be fix so that i don't have problems in future extension updates.

Hope my description helps.

Summary:

  • Fix in firebase console "create secret" button so i can add the password from there and avoid using custom secret keys that will be overwritten in future extension updates
  • Remove :
    {
    smtpConnectionUri: "",
    smtpPassword: "",
    clientId: "",
    clientSecret: "",
    refreshToken: "",
    }

or change the position in the assign with the config so it doesn't overwrite the config variables that contain the data needed. Ex:
Object.assign({
smtpConnectionUri: "",
smtpPassword: "",
clientId: "",
clientSecret: "",
refreshToken: "",
}, config);

  • Add the information when the message is sent (info attr. inside delivery - everything is blank or null)
@MelanieVazquez22 MelanieVazquez22 added the type: bug Something isn't working label Mar 6, 2025
@cabljac
Copy link
Contributor

cabljac commented Mar 10, 2025

Hi, i'm a bit confused -

export const obfuscatedConfig = Object.assign({}, config, { 
  smtpConnectionUri: "", 
  smtpPassword: "", 
  clientId: "", 
  clientSecret: "", 
  refreshToken: "", 
} );

this creates an obfuscated config, where the sensitive config values aren't exposed to cloud logs, and is intentional.

I will try to reproduce your issue,

I added a log of the config, and the password was omitted.

can you elaborate on this? How are you adding a log of the config?

@cabljac
Copy link
Contributor

cabljac commented Mar 10, 2025

using Object.assign is pretty oldschool though, should probably be updated to ... at some point

@cabljac cabljac added the needs: author feedback Pending additional information from the author label Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: author feedback Pending additional information from the author type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants