DeployBoard / DeployBoard/deployboard-python

Remove duplicate calls from every route

Offen
#2 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
api enhancement
Vorherrschende Sprache
Python
Sterne
10
Forks
1
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

There are two specific calls that _almost_ every route will require, but not _every_ route.

Every route called by a user requires a current_user object which we currently get via `Depends(get_active_current_user)`

https://github.com/DeployBoard/deployboard/blob/init/src/api/routes/users.py#L19

and `verify_role` here: https://github.com/DeployBoard/deployboard/blob/init/src/api/routes/users.py#L24

How can we build these two functions into the route to return the `current_user` object into the route function?

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.