Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Share an alert with a temporary public link

Aperta
#720 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
fastapi, postgresql, python
Ambito
api, backend

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

type: feat
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 (returns share_id, the token once, and the expiry); list the shares of my organisation (with alert_id, optional filter by alert); cancel a share by share_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

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di pyronear/pyro-api

Tutte le issue di pyronear/pyro-api

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.