gabrielcsapo / gabrielcsapo/node-git-server

Keeping context between calbacks

Abierto
#94 3 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
TypeScript
Estrellas
262
Forks
81
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.