gabrielcsapo / node-git-server

🎡 A configurable git server written in Node.js
https://gabrielcsapo.github.io/node-git-server
MIT License
253 stars 73 forks source link

[WIP] Authentication context (resolves #94) #97

Open willstott101 opened 2 years ago

willstott101 commented 2 years ago

Aside from the changes to authenticate every request the re-factoring was mostly to help me reduce the number of code paths that need to be supported.

The more optionally-async optionally-promise callbacks we support the messier the code becomes and it was hard for me to be confident all code branches were correct.

That being said I'm happy to go backwards on some of this refactoring now that it all seems to work.

Left as a WIP as I want to expand the test suite to cover more error cases.

gabrielcsapo commented 2 years ago

I left a few comments, it will take time to go through this change more thoroughly.

willstott101 commented 2 years ago

Sure, will address those a bit later today. Once using the library after this refactor... requiring throwing from authenticate feels a bit off. Do you think returning false would be better?