-
-
Notifications
You must be signed in to change notification settings - Fork 90
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
Webhook #1346
Comments
You can find one here. It's not yet committed because it's part of #1333 |
Wow! What a happy coincidence! What would be the best way to add simple auth to this? |
Also, would the best place to do the actual storing of the data be on line 141? |
the easy way is to save on the file system using $state:subscriptions.Remove($data.url)
# Saving to ./state.json
Save-PodeState -Path './state.json'`
# Respond with a status message
Write-PodeJsonResponse -Value @{ message = 'Unsubscribed successfully!' } -StatusCode 200 and on line 79 $state:subscriptions[$data.url] = $true
# Saving to ./state.json
Save-PodeState -Path './state.json'`
# Respond with a status message
Write-PodeJsonResponse -Value @{ message = 'Subscribed successfully!' } |
for the authentication you can grab as example petstore https://github.com/Badgerati/Pode/blob/f16cc3a61a502485f3f2713b4c0aafd4d618def6/examples/PetStore/Petstore-openApi.ps1 Line 129 New-PodeAuthScheme -ApiKey -LocationName 'api_key' | Add-PodeAuth -Name 'api_key' -Sessionless -ScriptBlock {
|
Interesting! So you wouldn't use the /store endpoint? |
Sorry, I was saving the state, not the store. |
Great, thank you. Just to be clear, best to add to datastore on line 141 as validation would have passed? |
This is a sample theoretical; you don't need to print the content of your body. |
Thank you! |
Is there an example of a webhook server? I'm looking to have an endpoint that accepts anything that's thrown at it with auth in the header that writes the request to a file or database.
The text was updated successfully, but these errors were encountered: