Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to Validate Trello Webhook Signatures in Golang Fiber ?

javmah December 3, 2023
 Node.js Reference in Golang Fiber But Hash is not the same as Given Hash,  Anyone kindly tell me what I missed? Thanks in advance.
secret := "****99510****b6e0****"
callbackURL := "https://****oposs.ngrok-free.app/trello-webhook?id=****ysht.com"

base64Digest := func(s string) string {
h := hmac.New(sha1.New, []byte(secret))
h.Write([]byte(s))
return base64.StdEncoding.EncodeToString(h.Sum(nil))
}


body := c.BodyRaw()

contentBuffer := bytes.NewBuffer(body)
contentBuffer.WriteString(callbackURL)
content := contentBuffer.String()


doubleHash := base64Digest(content)
headerHash := c.Get("x-trello-webhook")


fmt.Println("doubleHash : ", doubleHash)
fmt.Println("headerHash : ", headerHash)


// Your existing return statement
return c.Status(200).JSON(&fiber.Map{
"status":      true,
"information": "bismillah from customers-data_request!",
})
 

1 answer

0 votes
Sal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 5, 2023

Hi @javmah! If you need any code assistance when using Trello's API, I recommend you post your question in our developer community, which you can access through this link: https://community.developer.atlassian.com/c/trello/42. There, you'll find many other developers who can help you with your question, and you might also get your question answered by one of our developers who are actively monitoring it. I hope that helps! 

javmah December 5, 2023

Dear @Salomao Rosa, thank you for your reply. I posted a question but did not receive any response. Could you please take a moment to look at the question and provide me with any suggestions? Thank you.

Sal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 5, 2023

Hi @javmah! We don't provide support to coding or development support here since the developer community is the most suitable place for these types of questions. Also, you posted your question yesterday, so I'd recommend you wait a bit more to see if someone from the community will jump in to help. However, if you don't get a reply after a few days, I could ask someone from our team to help. 

javmah December 5, 2023

@Sal thank you so much.

Sal
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 5, 2023

You're welcome, @javmah

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events