Comments (10)
At the moment we lean on both the end point for the DELETE HTTP request
http(s)://{QaasHost}:{QaasPort}/configuration/{WebhookID}
and the JSON body which contains the (hash, groupname, username), for example
{"hash": "550e8400-e29b-41d4-a716-446655440001", "groupname": "groupname", "username": "username", "description": ""}
from hpc-webhook.
We could introduce a DELETE HTTP request to delete ALL webhooks for a certain (groupname, username) with end point
http(s)://{QaasHost}:{QaasPort}/configuration
and a JSON body which contains the (groupname, username), for example
{"hash": "", "groupname": "groupname", "username": "username", "description": ""}
from hpc-webhook.
Delete functionality does not work.
The qaas server logs show invalid JSON body
.
It appears that the qaas server recieves a body that is empty from the qaas client.
from hpc-webhook.
But the client does sent request body. Using the -v
option of the client, you see the request data being sent.
DEBU[0000] request data: {"hash":"e3e5e1c2-f7d8-47fa-b989-607488d66472","groupname":"tg","username":"honlee","description":""}
ERRO[0000] fail to delete webhook e3e5e1c2-f7d8-47fa-b989-607488d66472: 404 Not Found (HTTP CODE: 404)
from hpc-webhook.
sorry. accidentally closed it. Reopen it now.
from hpc-webhook.
I think the invalid JSON body
is misleading due to the fact that the client firstly make a GET call to determine whether the webhook exists in the QaaS database. I have removed this check, but then I saw the following error in the qaas server's log:
[email protected] | &{src:0xc000238ea0 hdr:<nil> r:<nil> closing:true doEarlyClose:true mu:{state:0 sema:0} sawEOF:false closed:false earlyClose:false onHitEOF:0x662570}
[email protected] | pq: syntax error at or near "("
Looks like a SQL syntax error??
from hpc-webhook.
Fixed it. Was indeed a bug in the DELETE SQL statement.
Deleting a webhook now works. See commit 7c1510e. Also made a new release (v0.2.1) for demoing.
Note: When an attempt is made to delete a webhook with an incorrect (groupname, username) the webhook is not deleted in the database, which is what we want. However, the user is not notified in this case. An error should be reported.
from hpc-webhook.
This can also leave to the client to firstly "get" webhook from the server to check if the webhook to be deleted actually exists and belongs to the user/group before making the "delete" call. See the new issue #8.
from hpc-webhook.
The existence check before deletion is performed in the client code.
@rutgervandeelen This issue may be closed if the server ensures that the webhook information cannot be retrieved by a user that is not the same as the webhook creator.
from hpc-webhook.
We have tested the following:
- Create a webhook with a certain webhook id as user A
- Attempt to delete the webhook with the same webhook id as user B
The attempts were not succcessful as expected:
other users than the webhook creator cannot delete the webhook.
from hpc-webhook.
Related Issues (17)
- There is no need to create SSH key-pair per user HOT 1
- rename from qaas to webhook HOT 12
- support POST, PUT and GET HOT 17
- rename script.sh HOT 3
- Missing webhook path in the returned Webhook URL HOT 1
- hpcutil fails to connect on mentat005 HOT 5
- rename .webhooks to .webhook HOT 5
- SSH connection not closed properly HOT 1
- webhook server database being cleaned when service restarted HOT 5
- As a user, I would like the webhook server to handle trigger in asynchronous way HOT 3
- Return ConfigurationResponse in the ConfigurationHandler rather than in the WebhookHandler HOT 1
- Database table recreated after restart of container? HOT 1
- Add REST endpoint for getting detail about a webhook HOT 2
- Propose a way to secure webhook trigger HOT 4
- Return the webhook URL as part of the Webhook info HOT 4
- Getting webhoook information from database should also match username (and/or group name) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hpc-webhook.