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 authorization header in webhooks stored in secrets table #941

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

CamilleLegeron
Copy link
Collaborator

@CamilleLegeron CamilleLegeron commented Apr 18, 2024

@CamilleLegeron CamilleLegeron self-assigned this Apr 18, 2024
@CamilleLegeron CamilleLegeron marked this pull request as draft April 18, 2024 07:35
Copy link
Collaborator

@fflorent fflorent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Globally LGTM, few little remarks.

if (url) {
await this._dbManager.updateWebhookUrl(webhookId, docId, url);
await this._dbManager.updateWebhookUrlAndAuth(webhookId, docId, url, authorization || "");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should authorization be set to empty string? Or should it be set to null to express its absence?

I'd suggest to remain consistant with the rest of the code and allow it to be null or undefined

app/server/lib/Triggers.ts Outdated Show resolved Hide resolved
CamilleLegeron and others added 2 commits April 30, 2024 15:49
Authorizarion wuth capital A and add it in header call only if there is one

Co-authored-by: Florent <[email protected]>
@CamilleLegeron CamilleLegeron marked this pull request as ready for review April 30, 2024 15:21
@fflorent
Copy link
Collaborator

fflorent commented May 2, 2024

@CamilleLegeron Probably worth to take a look at the failures, I see some of them are related to Webhooks.

@@ -4889,6 +4891,7 @@ function testDocApi() {

const expectedFields = {
url: `${serving.url}/foo`,
authorization: '',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe also add a specific tests to ensure that a filled authorization header is passed to the webhook consumer?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good remark, adding this test I find a bug when calling patch call : before when we used patch call to update URL without giving information of authorization it removed it

@CamilleLegeron
Copy link
Collaborator Author

Hi, I send you a notif @paulfitz to know if you can review this PR or maybe other person in Gristlabs

Copy link
Collaborator

@fflorent fflorent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just have a simple question regarding your last addition.

app/gen-server/lib/HomeDBManager.ts Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants