Github webhook not posting to Amazon SQS queue due to UnknownOperationException - github

I'm trying to configure a Github repository to post to an Amazon SQS queue, via a webhook (not the pre-configured SQS Service). The queue has full permissions, so anyone can post a message to it - and when I post via curl, it works fine.
curl -d "Action=SendMessage&MessageBody=curl_testing" https://sqs.us-east-1.amazonaws.com/123/my_queue
However, when I use the same queue URL in a webhook and test it, I get a 404, and UnknownOperationException.
The default curl format is form-urlencoded, so I changed the webhook default format (application/json) to that - which made no difference. (Interestingly, I also switched curl to use application/json, and it failed with the same error.)
There aren't a lot of options on the webhook, but I tried them all (with/without a secret token, or SSL certs), with no success.
Is it possible to have a webhook post to SQS (with the expected repo information, such as commits, etc)? And if so, how?

In your curl example you can see that SQS is expecting Action and MessageBody attributes. You can specify them in body of POST request or as the URL parameters. This way it's possible to send notification to SQS queue but you will lost information from webhook which is formatted as JSON.
You can set the action and message body in the webhook Payload URL like this:
https://sqs.us-east-1.amazonaws.com/123/my_queue?Action=SendMessage&MessageBody=Webhook_triggered
This way whenever the webhook is activated, you will receive SQS message with "Webhook_triggered" body.

Related

Not receiving some messages via WhatsApp Cloud API webhook

I'm trying to get WhatsApp's Cloud API working. I managed to set up Meta Business Account and configure a WhatsApp app. Then I configured a webhook and subscribed to messages event (see the following screenshot).
I then managed to send a message via the API using the following request:
curl -i -X POST `
https://graph.facebook.com/v13.0/103690452403982/messages `
-H 'Authorization: Bearer MY_TOKEN' `
-H 'Content-Type: application/json' `
-d '{ \"messaging_product\": \"whatsapp\", \"to\": \"MY_NUMBER\", \"type\": \"template\", \"template\": { \"name\": \"hello_world\", \"language\": { \"code\": \"en_US\" } } }'
I received the message and it came through the webhook as well. If I reply to that message, it comes through the webhook too.
The problem
However, when I send a message to the associated number from a different WhatsApp number (not via the API) it is received but the webhook is not called.
I suspect some incorrect configuration on my side. When I text the number from a different phone, the chat has a notice about E2E encryption - something which is not present in a chat window of the API-sent message. I assume that E2E-encrypted messages cannot be passed to the webhook because only the recipients should be able to decrypt the message.
Any ideas what I might be missing?
Thank you in advance
If you're using your business manager as a BSP, then you must Subscribe to your WABA first, to get notifications over your webhook.
See whatsApp cloud API document here:
https://developers.facebook.com/docs/whatsapp/cloud-api/get-started-for-bsps#subscribe-waba
Here, in the Callback URL mention "webhook" after the trailing "/"
i.e.
https://your_callback_url.tld/webhook

GitHub WebHook call Action on another GitHub repository

Want to trigger a GitHub Action (Repository B) from another GitHub Repository (A) via WebHook.
So I try to configuring the WebHook on repository A but I can not specify the Authorization Header that is needed by GitHub Repository B.
Is this possible at all via WebHooks?
Both Repositories belong to the same Organization.
via WebHook
That means repo A WebHook URL is called, and your local endpoint (which listen to the wayhook payload) would need to receive a parameter representing the URL/name of repoB, which it then could curl -X POST in order to trigger its workflow (assuming you have the right token allowed to run API on repoB, in Authorization: bearer <token>).
Considering a webhook JSON payload for a push event include commit(s) message, I would push on repoA a commit with, in its message, the name or URL of repoB.
Your local webhook listener can then extract repoB, and tribber its workflow.

'request hooks' for Owasp ZAP

Is there a way I can trigger some action once a particular request is issued in ZAP?
For example, I want to send a POST request to an endpoint whenever there is a login/logout request.
Environment: I'm using a ZAP docker image.
Your best option is to use an HTTP Sender script - that will get invoked on every request and response sent or proxied through ZAP. You can test for your login/logout request and then send you POST request.
To add scripts to ZAP from the command line see this FAQ.

Hubot use github webhook

I am totally new in hubot, and I am stuck at something seems easy.
I want to use this plugin to send messages to users via slack when they have a mention comment or there's a comment on their pull requests.
But I have some trouble setting on Github webhook, how to fill in this form correctly? What's the hubot_url should be? If I test on my local machine, should the URL be http://localhost:port/hubot/github-pull-request?room=ROOM&only-mentioned=1?
And what's the port of hubot if I test it on my local machine? It seems I fill it with wrong data. The delivery failed and got a service timeout error.

Facebook Real-time Updates: (#2200) callback verification failed, code 2200

I am trying to get realtime updates from facebook for my application as documented in https://developers.facebook.com/docs/reference/api/realtime/. I am struggling now when it comes back to the Subscription Verification. I have set up a callback server which accepts both GET and POST requests. I verified that the server works by making curl requests to it.
However, I stil get this error when attempting to create a subscription issuing the POSt request below
{"error":{"message":"(#2200) callback verification failed:
","type":"OAuthException","code":2200}
From what I read in the documentation and other threads, I assume that this means that the single GET request to my callback URL fails. The callback url does not get requested by neither GET nor POST requests indeed. I suppose that facebook is somehow blocked from accessing the endpoint. However, I am able to auth as a user using the auth dialog (https://developers.facebook.com/docs/reference/dialogs/oauth/) where I pass a callback url on the same server as well. The server runs http (for now).
This is the curl I am using to post the subscription. Host file has an entry to redirect dev.minggler.com to localhost =>( 127.0.0.1 dev.minggler.com)
curl -XPOST 'https://graph.facebook.com/256139341164822/subscriptions?callback_url=http%3A%2F%2Fdev.minggler.com%3A3000%2Ffacebook%2Frealtimeupdates&object=user&fields=friends&verify_token=abcd123&access_token=$MYTOKEN'
Can anybody help me out on this?
finally found the problem. the server wasn't reachable from outside. resolving it solved the problem