Share an alert with a temporary public link
I maintainer di solito rispondono entro 3 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 45/100
Direzione di ricerca
Start by reading the API's existing alert routes, models, and access-control tests; the issue does not name specific files. Then trace how alert images get signed URLs and how organisation membership is checked. Done means users can create, list, and cancel organisation shares, while a public token route returns the specified read-only alert data and tests cover cross-organisation, expired, cancelled, and unknown tokens.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Context & Objective
Part of the epic pyronear/roadmap#31 (Alert sharing). A user wants to send an alert to someone with no account (a dispatcher, a mayor, another service). The link must open the alert without logging in, stay hard to guess, and stop working after a while or when it is cancelled.
What is done currently
- Everything is private to the organisation. The link to an alert only works for a logged-in user of the same organisation. Images are served by signed URLs from the organisation's storage.
What has to be done
- A table for the share links (alert, hashed token, creator, creation date, expiry, cancellation).
- Endpoints for a logged-in user of the organisation, flat under
/shares: create a share (returnsshare_id, the token once, and the expiry); list the shares of my organisation (withalert_id, optional filter by alert); cancel a share byshare_id, only within my organisation. - A public route that takes a token and returns the alert: image, detections, time, camera name, camera position, fire position. Not included: the livestream, and the occlusion masks (neither reading nor editing). Read-only.
- Token: random, at least 256 bits, never derived from the alert id. Only its hash is stored, so the link cannot be shown again after creation.
- Expiry: 48 hours by default. After that, or once cancelled, the route answers "expired".
- Images in the response use short-lived signed URLs, so they stop working with the link.
- Any user of the organisation can create and cancel a link for now.
Open questions
- Fixed duration (48 h), or chosen by the user among a few values?
- Protection of the public route (rate limiting, same answer for unknown and expired tokens).
- Does the API need a clean-up of expired links, or are they simply ignored?
- Can a user list and cancel every share of the organisation, or only their own? (Proposal: the organisation's, for now.)
Done when
- A logged-in user can create, list and cancel links for an alert of their organisation
- The public route returns the alert for a valid link, and "expired" after the delay or cancellation
- Tests cover the access rules (other organisations, expired, cancelled, unknown token)
- Lingua principale
- Python
- Stelle
- 30
- Fork
- 15
- Merge medio
- 4g 15h
- PR unite (30g)
- 16
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di pyronear/pyro-api
-
Return the number of alerts per day over a periodForse già presa @Majyles l’ha presa 7 giorni fa. Apertatype: feat
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
pyronear/pyro-api#719 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 3 giorni
-
type: feat
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
I maintainer di solito rispondono entro 3 giorni
-
type: feat
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
I maintainer di solito rispondono entro 3 giorni
-
type: feat
Difficoltà 4/5 3-5 giorni Idoneità per principianti 65/100
I maintainer di solito rispondono entro 3 giorni
Tutte le issue di pyronear/pyro-api
Issue simili
-
Admin member of a research group cannot see the HX2 allocation until they've been added to itAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 2 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
developmentseed/titiler-cmr#278 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 2 giorni