Commit Graph

975 Commits

Author SHA1 Message Date
Kubernetes Prow Robot 0e422616a4
Merge pull request #219 from cydu-cloud/askpass
Verify both username and password in the askpass_git test.
2019-12-19 17:03:33 -08:00
Chuanying Du 5c70f02656 Verify both username and password in the askpass_git test. 2019-12-19 16:48:23 -08:00
Kubernetes Prow Robot d8928aae96
Merge pull request #216 from cydu-cloud/master
Support GIT_ASKPASS_URL callback
2019-12-19 16:33:34 -08:00
Chuanying Du 0851cc5916 use free port 2019-12-19 16:26:46 -08:00
Chuanying Du 0b0f0a62d5 use random port for nc 2019-12-18 22:30:42 -08:00
Chuanying 27864c32cd
Merge branch 'master' into master 2019-12-18 22:11:57 -08:00
Kubernetes Prow Robot 59119978f1
Merge pull request #217 from cydu-cloud/passwordtest
Change git credential from cache to store and also add test for username/password case
2019-12-18 22:01:56 -08:00
Chuanying Du d8d9ff72b8 add e2e test for askpasswd_url 2019-12-18 21:07:01 -08:00
Chuanying Du b0bdc02e8b manually merge https://github.com/kubernetes/git-sync/pull/217 2019-12-18 20:05:51 -08:00
Chuanying Du 66244108ed fix tests 2019-12-18 17:57:28 -08:00
Chuanying Du d58a241648 add comments; use --one-time for testing 2019-12-18 17:13:37 -08:00
Chuanying Du 31f276dd58 fix comments 2019-12-18 10:59:20 -08:00
Chuanying Du c57553a2eb fix docs 2019-12-18 10:52:02 -08:00
Chuanying Du ac70751767 Change git credential from cache to store and also add test for
username/password case.

For cache to store change:
* By default, cache only last 900 seconds, gitsync will break after
  that. See https://git-scm.com/docs/git-credential-cache.
* The test won't work with cache since the test don't have access to
  the default unix socket location; XDG_CACHE_HOME override also can
  pre-create a socket in advance.
* `store` put the credential into a file, much easier to debug than cache.
* Considering anyone have access to the pod already able to get the
  credential via environment variables or yaml configs, so put it in
  file won't make it less secure.

For the new password test:
1. askpass_git.sh provided to simulate a git with password challenge.
2. Need and only need to similate "clone" action, need to bypass other
  actions like config/credential setup.
3. See `credential fill` is the official git action to ask password,
  see https://git-scm.com/docs/git-credential.

This change resolved issue #196.
2019-12-18 09:55:01 -08:00
Chuanying Du 34daaefbb8 update some docs to retrigger the scan 2019-12-17 11:24:03 -08:00
Chuanying Du 1f67515afa fix docs link 2019-12-17 11:16:06 -08:00
Chuanying Du 6c6c354c72 update docs from auth-url to askpass-url 2019-12-17 11:02:03 -08:00
Chuanying Du 67a0788aa2 Rename to GIT_ASKPASS_URL and also update related examples. 2019-12-17 10:48:20 -08:00
Chuanying Du 9cae624f8c Add a new authentiate method GIT_SYNC_AUTH_URL.
It specifies a HTTP URL which will return username&password which will
be used to authenticate access to the git repo.

This is mainly used for git repo accecpt dynamic password (for example
oauth bare token). Because the dynamic password might expire very soon,
so it's added to the main syncRepo loop.

Typical usage case is work with a sidecar called gce-node-auth on GKE,
it uses the GCE service account's oauth token as password to access
Cloud Source Repo.

Please see the repo below for how it worked.
https://github.com/cydu-cloud/gce-node-auth/blob/master/git-sync-with-gce-node-auth.yaml
2019-12-16 23:45:37 -08:00
Kubernetes Prow Robot a2a8f72733
Merge pull request #211 from thockin/log-cleanups
Log before running commands, not after
2019-11-27 23:33:03 -08:00
Kubernetes Prow Robot b56f73ba85
Merge pull request #209 from thockin/master
Clean up docs
2019-11-27 23:31:03 -08:00
Kubernetes Prow Robot 39de601ec4
Merge pull request #210 from thockin/rename-cleanups
Cleanups: rename vars and funcs, comments
2019-11-27 23:29:03 -08:00
Tim Hockin 0057fac0a4 Clean up docs 2019-11-26 14:12:47 -08:00
Tim Hockin eac27f505e Log before actions 2019-11-26 13:45:18 -08:00
Tim Hockin fc700779be Log chmod operation 2019-11-26 13:45:18 -08:00
Tim Hockin e97eff010f trivial comments 2019-11-26 13:42:15 -08:00
Tim Hockin 287a0e5464 var renames for readability 2019-11-26 13:42:15 -08:00
Tim Hockin 415303f900 Rename for clarity 2019-11-26 13:42:15 -08:00
Kubernetes Prow Robot 5d7622e6ec
Merge pull request #208 from thockin/code-move-cleanups
Code move cleanups
2019-11-26 01:05:10 -08:00
Kubernetes Prow Robot cbad455c2b
Merge pull request #205 from thockin/git-cat-file
Make revIsHash a bit safer
2019-11-23 02:41:49 -08:00
Kubernetes Prow Robot 97a5488a26
Merge pull request #207 from thockin/flag-help
Better flag help strings
2019-11-23 02:39:50 -08:00
Tim Hockin 74d3e9daab move code for readability 2019-11-21 21:57:53 -08:00
Tim Hockin d980b6d9d6 Move prune logic for cohesion 2019-11-21 21:57:53 -08:00
Tim Hockin dc5bdcb461 Better flag help strings 2019-11-21 21:47:15 -08:00
Kubernetes Prow Robot 147a5f5fff
Merge pull request #206 from thockin/cleanups
Rename snake_case variable
2019-11-21 14:31:30 -08:00
Kubernetes Prow Robot e394e55b0e
Merge pull request #204 from thockin/go-1.13
Bump Go to 1.13
2019-11-21 10:03:28 -08:00
Tim Hockin 1b295ad217 Make revIsHash a bit safer 2019-11-21 08:55:30 -08:00
Tim Hockin f433b067ca Rename snake_case variable 2019-11-21 08:48:36 -08:00
Tim Hockin 4f9273b91c Bump Go to 1.13 2019-11-21 08:39:08 -08:00
Kubernetes Prow Robot 4905dc62a5
Merge pull request #203 from thockin/e2e-various
e2e: various fixes and cleanups
2019-11-20 02:15:20 -08:00
Tim Hockin 27b43e624b e2e: move flags and better errors 2019-11-19 07:44:02 -08:00
Tim Hockin 2b11e078b0 Remove default-value flags in e2e 2019-11-19 07:44:02 -08:00
Tim Hockin 5a73199cf7 all e2e should use file://repo 2019-11-19 07:44:02 -08:00
Tim Hockin 405bfefdc2 e2e: don't pass one-time and wait 2019-11-19 07:44:02 -08:00
Tim Hockin 5e82e574ac e2e more random (I actually hit this) 2019-11-19 07:44:02 -08:00
Tim Hockin c94c8087de e2e --one-time tests can be sync 2019-11-19 07:44:02 -08:00
Tim Hockin bc0980b906 make e2e easier to read 2019-11-19 07:44:02 -08:00
Tim Hockin bde21410c6 Clean up e2e formatting 2019-11-19 07:44:02 -08:00
Kubernetes Prow Robot 6e604b38b9
Merge pull request #200 from thockin/followup-pr-193-webhook-cleanup
Clean up webhook a bit
2019-11-19 07:43:42 -08:00
Tim Hockin 5daf3a42f7 Clean up webhook a bit
Return hash so we don't need to recalculate.

Rename some funcs.
2019-11-17 13:22:38 -08:00