-
Couldn't load subscription status.
- Fork 147
feat: http filtering #415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: http filtering #415
Conversation
✅ Deploy Preview for endearing-brigadeiros-63f9d0 canceled.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've left a couple of comments; otherwise very straight forward and solid implementation 👍 ❤️ 🍰
I love my emojis...
cefeee8 to
7b21074
Compare
|
@coopernetes - can we resolve merge conflicts? I merged #409 which also had changes to the router in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🍰
Just need the merge conflict resolved and good to go!
7b21074 to
909e5fd
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #415 +/- ##
==========================================
+ Coverage 56.85% 57.15% +0.30%
==========================================
Files 39 39
Lines 1036 1055 +19
==========================================
+ Hits 589 603 +14
- Misses 447 452 +5 ☔ View full report in Codecov by Sentry. |
|
Oh, Codecov how we love you so. @coopernetes - happy to bump up the coverage before we merge? We should probably make the project level Action informational and the PR level breaking whilst we slowly bring up the coverage for the rest of the repository. |
Most of the required refactoring for getting additional coverage is not something I want to do in this PR. I would essentially have to rewrite the Express middleware & routing layer to abstract it into a set of testable functions. That's probably effort better spent on changes to move us to 2.x.
Let me see what codecov makes available in their configuration. I would like to preserve the PR comment for the report even if the status check isn't blocking builds. This gives needed feedback in the PR while we improve overall coverage. |
|
Looking at the details, I think we can retest this after #429 is merged. The "baseline" report is misreported against a different branch. https://app.codecov.io/gh/finos/git-proxy/tree/bugfix%2Fci-permissions |
|
@coopernetes - agree with your comment before last. #429 is now merged by the way 👌 |
|
@coopernetes - as long as we can keep a view of the coverage of suggested changes in the PR that is good enough for now. |
|
Looking at Codecov, it looks like it is already achieving this. We just don't want to return a failing state to CI. |
|
Now that #442 is merged, let me rebase again and retest. @JamieSlome are you good with the latest changes? Hoping to get this merged soon. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM @coopernetes ❤️
Would like to get an idea of the coverage percentage but happy to merge in any case. Will keep my eyes open for your re-base.
- Accept is only set for certain git actions so refactored into one validation function - pass routes correctly to express (fix TypeError on startup)
- separate out the HTTP git filtering logic from the URL parsing, which includes stripping the GitHub repo owner/name.
909e5fd to
3092274
Compare
|
* feat: filter non-git HTTP requests being proxied Fixes finos#410 * feat: refactor to one validation function - Accept is only set for certain git actions so refactored into one validation function - pass routes correctly to express (fix TypeError on startup) * feat: separate url stripping into its own function - separate out the HTTP git filtering logic from the URL parsing, which includes stripping the GitHub repo owner/name.
- new abstraction layers for creating & configuring providers - unify filter & provider configuration into a single properties class - allow filters to apply on push and/or fetch arbitrarily - prevent ProxyServlet from sending error'd requests (stop processing when the servlet sends an error back to the client) - re-worked GitClient to be more complete (all common ANSI colors included) and friendly for callers. Also, helper method to handle plain & emoji symbols Three filters are implemented so far: - a path-based whitelist (provider agnostic) on repository owners, names and/or full "slugs" - check that the client is sending authentication (GitHub only) - only permit proxy requests from valid git clients (a more complete version of finos#415)
- new abstraction layers for creating & configuring providers - unify filter & provider configuration into a single properties class - allow filters to apply on push and/or fetch arbitrarily - prevent ProxyServlet from sending error'd requests (stop processing when the servlet sends an error back to the client) - re-worked GitClient to be more complete (all common ANSI colors included) and friendly for callers. Also, helper method to handle plain & emoji symbols Three filters are implemented so far: - a path-based whitelist (provider agnostic) on repository owners, names and/or full "slugs" - check that the client is sending authentication (GitHub only) - only permit proxy requests from valid git clients (a more complete version of finos#415)
Fixes #410
(Hello from Git Proxy 👋)