| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Codecov Report❌ Patch coverage is 79.24528% with 11 lines in your changes missing coverage. Please review.
@@ Coverage Diff @@
## main #116 +/- ##
==========================================
+ Coverage 86.83% 87.25% +0.42%
==========================================
Files 60 60
Lines 2340 2378 +38
Branches 275 282 +7
==========================================
+ Hits 2032 2075 +43
+ Misses 308 303 -5 ☔ View full report in Codecov by Harness.
|
Sorry, something went wrong.
|
OK, this is good to go now. Once this is merged, any PRs submitted from this repo will have access to the secret and will all of the remote tests. PRs submitted from forks of this repo will not have access to the secret and those tests will be skipped. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This is PR #104 resubmitted from a branch on this upstream repo rather than a branch on my fork, so that it has access to the secrets defined here. Comments from previous PR reproduced (see that PR for screencast):
This PR adds support for entering and using credentials (username and password) to authenticate https requests to allow git clone, git fetch and git push to remote private repositories on github. This only works for linux and macos builds, the wasm build will be done separately.
This uses the private git2cpp-test-private repository, and authentication is performed using a fine-grained github Personal Access Token (PAT) which I paste into the terminal. Note that the PAT is not echoed to screen so that it cannot be seen by others, which is the same behaviour that occurs with normal git. Credentiials are not stored or cached at all at this stage, so have to be entered separately for each clone, fetch or push subcommand.
Most of the new functionality here is in the new user_credentials function that is a libgit2 callback to prompt the user for a username and password. Actually using a PAT means that the username is ignored, but it may not be ignored for other remotes than github. The format of the callback function follows libgit2 standard practice but calling our own input_prompt function.
The new tests use an environment variable GIT2CPP_TEST_PRIVATE_TOKEN. If this is not present then the relevant tests are skipped, if it is present those tests are run. This env var needs to be a fine-grained PAT for the git2cpp-test-private repo with appropriate read and write permissions - I will pass one the token to other maintainers here via private messages. Once you have it locally you can run the tests using it via
This env var could be set permanently in your bash_profile or similar, which isn't very secure as all other processes on your computer will be able to read it, but since it only allows access to a specific github repo used for test purposes only this cannot do much damage. The token expires in one year.
I have added GIT2CPP_TEST_PRIVATE_TOKEN as a repository secret so that CI can run all the tests.