Giter Club home page Giter Club logo

Comments (10)

earthboundworm avatar earthboundworm commented on August 16, 2024

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.

earthboundworm avatar earthboundworm commented on August 16, 2024

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.

earthboundworm avatar earthboundworm commented on August 16, 2024

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.

hurngchunlee avatar hurngchunlee commented on August 16, 2024

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.

hurngchunlee avatar hurngchunlee commented on August 16, 2024

sorry. accidentally closed it. Reopen it now.

from hpc-webhook.

hurngchunlee avatar hurngchunlee commented on August 16, 2024

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.

earthboundworm avatar earthboundworm commented on August 16, 2024

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.

hurngchunlee avatar hurngchunlee commented on August 16, 2024

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.

hurngchunlee avatar hurngchunlee commented on August 16, 2024

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.

earthboundworm avatar earthboundworm commented on August 16, 2024

We have tested the following:

  1. Create a webhook with a certain webhook id as user A
  2. 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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.