gabrielcsapo / gabrielcsapo/node-git-server

Keeping context between calbacks

Ouverte
#94 3 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
TypeScript
Étoiles
262
Forks
81
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

We have a `get-user-repo-access-info` procedure which is asynchronous - we run this in the `authenticate` callback as passed into the `Git` constructor. We do this to deny access to users before this library even looks for a git repo to use. However when we then get to the `push` event listener we're struggling to see how we can equate the original request with this specific callback. There is no shared state passed into the listener.

Would you be willing to help us rectify this? Honestly I'd be fine with just adding `http.IncomingMessage` to the `GitAuthenticateOptions` as `req` - I can then just add a property to that object :shrug:

It looks as though you've maybe kept the `authenticate` callback to accept the bare minimum of information though - if there's a specific reason for that perhaps we could add an empty `context` object to the `authenticate` callback which can then be passed to later event handlers. Avoiding giving the authenticate method any additional data to be mis-understood or used.

Thanks for the very helpful library, happy to open a PR for this, just wanted an idea of what is more likely to be merged.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

Commencez par suivre le callback authenticate transmis au constructeur de Git et le listener ultérieur de l’événement push, en vous concentrant sur GitAuthenticateOptions et les données context ou req proposées. Définissez comment l’état spécifique à la requête doit circuler entre ces callbacks, puis vérifiez que l’authentification et le traitement de push peuvent associer la même requête sans modifier les opérations Git non concernées.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
git, nodejs, typescript
Domaine
api, backend
Type d'issue
Fonctionnalité
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.