Skip to content
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

First implementation #1

Open
abulte opened this issue Aug 3, 2017 · 2 comments
Open

First implementation #1

abulte opened this issue Aug 3, 2017 · 2 comments

Comments

@abulte
Copy link
Contributor

abulte commented Aug 3, 2017

Thoughts for an implementation with the v2 version of croquemort (webhook).

Workflow

  1. uData dispatches a signal when a resource URL is created or modified
  2. udata-croquemort extension hooks to this signal
  3. udata-croquemort sends a check request to croquemort (POST request) with a frequency (scheduled check) and a callback url (webhook)
  4. The callback url is a udata-croquemort view that feeds the extra of the udata resource with the check results — the view will be called (and the extras refreshed) regularly since the check is scheduled
  5. The frontend tests for the extras value of the resources and displays a status accordingly (not checked yet, OK at date XXX, KO at date XXX)

Challenges

  • Authentication : how do we ensure croquemort is the one calling the udata-croquemort callback url? We obviously do no want anyone to be able to set the check results on uData resources.
  • Match a check result and a resource: we probably need Webhook: add support for reference id etalab/croquemort#34 to be able to locate for which resource a check has been made when the webhook returns. Or use a join model url hash in croquemort <-> resource id in uData in udata-croquemort?
  • resource URL modification case: when a resource URL has been modified, we probably need to delete the scheduled check on croquemort of the old URL.
@noirbizarre
Copy link
Contributor

I think prior to that, we need to:

  • extract all croquemort related code here
  • abstract the link checking part in udata the same way it's done for tracker and udata-piwik

@davidbgk
Copy link
Member

davidbgk commented Aug 3, 2017

In ❤️ with point 4!

About challenges:

  1. auth: I don't think it's a problem for now. Let's make it work first.
  2. match: maybe reuse the underused notion of groups on the croquemort side or add something in this vein?
  3. old sheduled checks: add an entry point in croquemort to allow that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants